arebgun/dynamixel_motor — pull request #2 by Tones29 (2013-11-13 17:21:06+00:00)
Title: Fix bug in velocity conversion

Hey,

I observed that the servo real-world velocity does not correspond to the joint_speed set in a joint_position_controller and also that velocity published in the motor state is not correct. Therefore, I investigated this issue and found a bug in the velocity conversion.

The factor for the velocity conversion from raw to radsec and the other way round is model-specific and does not depend on the maximum motor speed. This makes sense, as the motor can move quicker than specified under the influence of outside factors (compare e.g. http://www.crustcrawler.com/motors/RX28/docs/RX28_Manual.pdf, page 28). Each motor type has a conversion factor for raw-to-radsec. Therefore, this factor is added to the motor data and employed for all velocity conversions. I obtained the factor for each motor type from the available manuals.

The set motor velocity and the motor velocity in the servo state does now correspond with the real servo speed in radians per second.

The code was successfully tested on a Dynamixel AX-12A servo. After the merge, already configured servo speeds x have to be set to around 2*x in order to maintain a servo movement with the same real-world velocity as before.

Best, Andi