Add cu_feetech component for Feetech servo bus (STS3215, SO101)#844
Conversation
|
Hi! Thanks for opening this pull request. Because this is your first time contributing to this repository, please read our contributor guide: |
gbin
left a comment
There was a problem hiding this comment.
Some nits, feel free to push back, awesome contribution!!
| } | ||
|
|
||
| // Read the variable-size portion: error + data + checksum. | ||
| let mut remaining = vec![0u8; length]; |
There was a problem hiding this comment.
try to use fixed size structures on the stack as much as possible like smallvec or heapless. This helps reducing the jitter on tight executions.
There was a problem hiding this comment.
Thanks, done by using heapless
| } | ||
|
|
||
| // ---- Ticks per revolution (model-dependent; used for deg/rad) ---- | ||
| let ticks_per_rev = cfg.get::<f64>("ticks_per_rev")?.unwrap_or(4096.0) as f32; |
There was a problem hiding this comment.
No you're right on that, switched to u32
| /// | ||
| /// Values are `f32` so they can carry raw ticks, degrees, or radians | ||
| /// depending on the bridge configuration. | ||
| pub type JointPositions = CuArray<f32, MAX_SERVOS>; |
There was a problem hiding this comment.
nit but feel free to ignore: if they are ticks we could template that with an uint32? or uint16? (some MCUs love ints).
There was a problem hiding this comment.
They are either raw ticks, degrees or radians, depending on the configuration passed by the .ron file so that's why I set it up as f32
| | Mission | Description | | ||
| |-------------------|-------------| | ||
| | **arm_publisher** | Read positions from one arm and log them. | | ||
| | **leader_follower** | Leader arm (serial0) is moved by hand; follower arm (serial1) copies its positions. Each arm uses its own calibration file. | |
- Use heapless Vec instead of Vec - Have tick_per_rev as u32 instead of f32
|
good to go, if CI passes I'll merge it, thanks for the awesome contrib! |
|
Forgot to fix format before pushing my previous commit - CI will probably fail |
Summary
This PR adds cu_feetech bridge component as well as an example for it.
It allows to control the SO-101 arm which uses Feetech STS3215 servo bus
Adds a calibration tool so messages can be passed as Raw, Deg, Rad or Normalized
The demo demonstrates usage of 1 SO101 arm or 2 arms in leader - follower context.
Tested with SO101 at home!
First PR on the repo, highly open for feedbacks/changes
Related issues
Changes
Testing
just fmtjust lintjust testjust std-ci(if std/runtime paths are impacted)just nostd-ci(if embedded/no_std paths are impacted)pro-tip:
justwith no parameters in the root defaults tojust fmt,just lint, andjust test.Checklist
Breaking changes (if any)
Additional context