resibots / libdynamixel

C++ interface to the dynamixel actuators
GNU General Public License v2.0
9 stars 15 forks source link

Make the speed instruction ready for the joint mode #2

Closed dogoepp closed 9 years ago

dogoepp commented 9 years ago

I'm not sure whether method overloading is the most optimal way of doing. Feel free to tell me how you would have done it.

Tested through the ROS service (only changing speeds for multiple actuators, not the one for a single).

jbmouret commented 9 years ago

Why changing the API?

dogoepp commented 9 years ago

It is one possible option that allows to use method overloading. Indeed, defining a speed for an actuator in joint mode or in wheel mode uses the same underlying message. The main difference is that a direction parameter would be used to chose in which direction a wheel would turn.

To define the target speed for a motor in joint mode, one can use the same calculations as for the wheel mode, only by defining direction to false. I thought that using a default parameter might be a good option.

Yet this is still an open question and if you feel that we better define two distinct methods, I only need the names you would like for these methods to do it.