Skip to content

Support [-pi, pi) motion range in position mode #5

@andreasBihlmaier

Description

@andreasBihlmaier

Setting [min_position, max_position] to [-pi, pi] in position mode does not work as intended. The minor issue is that the reported joint position is still in [0, 2pi] range. The bigger issue is that the servo doesn't move along the shortest path, e.g. from 0 to -0.1 it rotates in the positive direction, rotating close to a full rotation. I don't think this can be fixed while using the STS position mode. A viable workaround, especially for motion range [-pi, pi) is to center the 0 around encoder value 2048. This way the servo takes the expected path within the range instead of wrapping around.

Copilot (with Claude Opus 4.6) was able to make the necessary changes automatically. Not attaching a PR as the issue remains that for motion range [0, 2pi] one must use physical 0 as joint 0, while [-pi, pi] requires using physical 2048 as joint 0. Might still be worth adding this functionality along with some explanation.

Based on a bit of looking into this, the only workaround seems to be not using the inbuilt position mode, e.g. using velocity mode with a custom PD control on top - which will have many other drawbacks.

Thanks for the great STS ROS package btw!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions