ros-industrial / ros2_canopen

CANopen driver framework for ROS2
https://ros-industrial.github.io/ros2_canopen/manual/rolling/
143 stars 62 forks source link

Relative moves in profiled position mode #289

Open gsalinas opened 3 months ago

gsalinas commented 3 months ago

Is there a way to use CIA402 devices in profiled position mode to do relative moves? The standard lets profiled position commands be made relative to the current position by setting bit 6 of the control word, but I don't see any way to get that behavior from the drive. This would be helpful as it's more natural in some applications. Thank you so much!

hellantos commented 2 months ago

I had used that relative modes in another settings before. Right now, this is not supported. Would you need this to be switched during application, or could this be a setting that is static for one application and could be fixed in settings?

Implementing online switching could be quite some effort. The setting implementation should be rather straight forward.

The final "change" for setting relative mode would need to be made in canopen_402_driver/include/canopen_402_driver/profiled_position_mode.hpp in the write function. Basically cw.set(Command402::CW_Operation_mode_specific2) would need to be inserted.