arebgun/dynamixel_motor — pull request #14 by pirobot (2014-03-06 02:05:22+00:00)
Title: Added an Enable service to turn a servo "on" or "off" so it ignores position requests

Hi Anton,

I added an Enable service to joint_controller.py and joint_position_controller.py that takes a value of True or False and sets a flag called self.enabled for that servo. The default value is self.enabled = True to ensure backward compatibility. If set to False, then a position request is simply ignored (see the modified process_command() function below).

My use case is that I have a node that monitors the temperature of each servo using the Diagnostics array and, if a servo overheats, I disable that servo to let it cool down. I tried it with a second node that does head tracking and it works nicely--if the tilt servo begins to overheat, my monitor node disables the tilt servo but the pan servo keeps working.

I deliberately did not call set_torque_enable() when calling set_enable() as I thought these two functions should be kept separate. So to truly let a servo cool down, my monitor node first calls set_torque_enable(False) and then set_enable(False) on the overheated servo.