Closed tongtybj closed 2 years ago
Also refactor the homing_offset
calibration for dynamixel servo in 006497b. The core process is
@Takuzumi240
Please have a glance at this PR, which sends a command about joint servo from ROS to Spinal (via rosserial), then Spinal to Neuron (via CAN).
What is this
This PR can compensate the round offset between servo and joint.
Detail
The joint pulley may make an undesired round offset between servo abs encoder and joint real angle. For example, in case of a pulley ratio of 1:2 (servo:joint), the servo encoder need a true value over 360 deg for joint angle with more than 180 deg. But the abs encoder can only have an initial value around 0~360 deg, which means the abs encoder will give a very small initial value theta for joint angle more than 180 deg.
This PR enables manual compensation by user with rosservice of
Spinal/SetBoardConfig
. Command ID is11
, and the command data should be[slave_id, servo_index, compensate_servo_angle]
.We also provide an automatic compensate code:
This will automatically find the initial joint (servo) angles from the Servo.yaml. The joint angle in simualtion (e.g., https://github.com/jsk-ros-pkg/jsk_aerial_robot/blob/master/robots/dragon/config/quad/Servo.yaml#L32-L33) will be used to compensate the pully round offset.