Factor-Robotics / odrive_ros2_control

ODrive driver for ros2_control
Apache License 2.0
250 stars 82 forks source link

Unit of the position data #14

Open likemountain opened 2 years ago

likemountain commented 2 years ago

Hello,

My motor's CPR (count per revolution) is set to 4000. However, when I send position command 4000, it rotates more than 7 revolutions. What is the unit of the data I am sending through the topic, joint0_position_controller/commands?

Thank you

borongyuan commented 2 years ago

Hi,

We are using different units, adheres to REP-103. Joint position is expressed in rads rather than turns.

Thanks

likemountain commented 2 years ago

Ok, now I figured it out. I also had to multiply my gear ratio to the position and velocity commands in odrive_hardware_interface.cpp. Thank you so much!

borongyuan commented 2 years ago

It is recommended that gear transmission should be handled by transmission interface. That is not in the implementation of this hardware interface. The purpose the ros_control architecture is to allow developers to focus on the control of the joints, without considering the hardware implementation of joints. So the concepts of transmission and actuator are abstracted. You can find an introduction to the architecture here.

sharkbonebroth commented 2 years ago

It is recommended that gear transmission should be handled by transmission interface. That is not in the implementation of this hardware interface. The purpose the ros_control architecture is to allow developers to focus on the control of the joints, without considering the hardware implementation of joints. So the concepts of transmission and actuator are abstracted. You can find an introduction to the architecture here.

Hi, Do you by any chance have a sample code that shows the implementation of odrive_ros2_controls with a transmission interface? Thank you in advance!