Crates.io | sybot |
lib.rs | sybot |
version | 0.10.4 |
source | src |
created_at | 2024-05-07 14:45:40.47893 |
updated_at | 2024-05-25 19:08:49.435315 |
description | Rust library for coordinating components, defining robotic systems and their communication |
homepage | |
repository | https://github.com/SamuelNoesslboeck/sybot |
max_upload_size | |
id | 1232275 |
size | 64,815 |
A simple library to control groups of components and robots.
Extension library for the syact.
-- UNFINISHED DOCS --
Full documentation will be added soon
The following example creates a new SyArm robot, runs all setup functions and executes a GCode-script.
# ...
[dependencies]
# Include the library configured for the raspberry pi
sybot = { version = "0.8.2, features = [ "rasp" ] }
# ...
use sybot::{Robot, JsonConfig, ActRobot, Setup};
use sybot::robot::SyArm;
use sybot::intpr::Interpreter;
use sybot::intpr::gcode::init_intpr;
fn main() -> std::io::Result<()> {
// Load the standard-partlibs in order to use motor names as data
//
// ```json
// "device": {
// "consts": "MOT_17HE15_1504S", // Motor name, see
// // <https://docs.rs/syact/0.11.1/syact/data/struct.StepperConst.html#associatedconstant.MOT_17HE15_1504S>
// "pin_dir": 17,
// "pin_step": 26
// },
// ```
let libs = sybot::partlib::create_std_libs();
// Create the robot out of the [configuration file]
// (https://github.com/SamuelNoesslboeck/sybot/blob/master/res/SyArm_Mk1.conf.json)
let mut syarm = SyArm::from_conf(
JsonConfig::read_from_file(&libs, "res/SyArm_Mk1.conf.json")
)?;
// Run setup functions
syarm.setup();
// Enables async movements (multiple motors moving at once)
syarm.setup_async();
// DEBUG
// Select "NoTool" at index 2
syarm.set_tool_id(2);
//
// Create a new GCode interpreter
let intpr = init_intpr();
// Run a GCode script
dbg!(intpr.interpret_file(&mut syarm, "res/gcode/basicYZpos.gcode"));
Ok(())
}
(Source: "examples/in_action.rs")
For more features, see syact#features
If you encounter any issues or if you have any request for new features, feel free to create an issue at the GitHub repo.