dynamixel_motor icon indicating copy to clipboard operation
dynamixel_motor copied to clipboard

Multiple joint velocity controller

Open zweistein opened this issue 8 years ago • 2 comments

I would like to control the velocity of multiple MX 64 and 28 motors, by sanding the command signal for each motor in the same time. I found the implemented IO function def set_multi_speed(self, valueTuples), which is used for dual motor setup. I think this could also be used for more then two motors.

I'm struggling to figure out how to write a driver, which would handle all the motors velocity. Is there already a controller like this, or can anyone point me in the right direction to create my own controller?

zweistein avatar Mar 07 '16 14:03 zweistein

You might want to look at joint_trajectory_action_controller which is designed to control multiple joints simultaneously.

arebgun avatar Mar 07 '16 14:03 arebgun

Thank you for helping. I'm not so experienced with python, could you correct me if I see wrong some aspects of the trajectory action controller:

  • for each joint a joint_position_controller node is created;
  • what are actually stored in the self.port_to_io and self.port_to_joints attributes? If all my motors are on the same port, will this two attribute contain only one element {"my_only_port": [all my joints] }, {"my_only_port":"first_joint_controller.dxl_io"}?
  • the control tuple is sent from the trajectory action server within a loop:
 for port, vals in multi_packet.items():
                        self.port_to_io[port].set_multi_position(vals)

The port is referring to the serial port address (similarly as my previous question)? If I have all the motors on the same port the set_multi_position(vals) will be called only once?

I'm going to need some motor parameters and methods (e.g. RADIANS_PER_ENCODER_TICK, pd_rad_to_raw() ) for velocity control and this is in the self.joint_to_controller, right?

zweistein avatar Mar 08 '16 13:03 zweistein