Open and close the SF fingers

Note: Make sure you have calibrated your fingers before moving them.
Basic motion

The simplest method of controlling the motors is to command the positions of the motors. The motors will move at a default speed when commanded this way. When the hand is powered and connected to USB, you should be able to move the fingers like so:

roslaunch reflex reflex_sf.launch

(in a new terminal)

rostopic pub /reflex_sf/command_position reflex_msgs/PoseCommand "f1: 1.0 f2: 1.0 f3: 1.0 preshape: 0.0"

NOTE: The easiest way to enter this type of command in terminal is to type it up through PoseCommand, regularly tab-completing the longer sections, then hit tab to auto-fill the portion with f1, f2, etc. It is a pain to type that in by hand. You can also add a -1 right after pub to make the command send once and end, but then it won't tab-complete. I usually make the whole command and then go back to add -1. Such is the rostopic terminal tool.

When the hand is calibrated, the motors will go to the commanded positions (in radians). Try out a couple commands by hand. (Enter these one at a time)

rostopic pub /reflex_sf/command_position reflex_msgs/PoseCommand "f1: 1.0 f2: 1.0 f3: 3.0 preshape: 0.0"

rostopic pub /reflex_sf/command_position reflex_msgs/PoseCommand "f1: 1.0 f2: 1.0 f3: 3.0 preshape: 1.5"

rostopic pub /reflex_sf/command_position reflex_msgs/PoseCommand "f1: 1.0 f2: 1.0 f3: 3.0 preshape: 0.0"

rostopic pub /reflex_sf/command_position reflex_msgs/PoseCommand "f1: 0.0 f2: 0.0 f3: 0.0 preshape: 0.0"

Safety overloads

The code contains safety overrides for the motor torque, because if the motors overheat they lock and must be power cycled. Test this out by using position commands to close the hand when the fingers are blocked by something, like a water bottle or your arm.

# Close the hand (with a blockage in the way)

rostopic pub /reflex_sf/command_position reflex_msgs/PoseCommand "f1: 3.5 f2: 3.5 f3: 3.5 preshape: 0.0"

# Open the hand

rostopic pub /reflex_sf/command_position reflex_msgs/PoseCommand "f1: 0.0 f2: 0.0 f3: 0.0 preshape: 0.0"

In the terminal where reflex_sf.launch was run, you should see yellow warning printouts saying that the motors overloaded and were loosened, like so:


If you want the hand to grip with more force than it currently does, and you need to adjust/disable the safety overload, that is possible - just do so with caution. You just need to edit the reflex_sf.yaml file inside of the reflex package, as shown. Each motor has its own overload threshold, and can be edited.

NOTE: Changing the safety overloads can make the motors more likely to overheat. Just be aware, and power cycle your hand if you have locked motors.

For debugging

Try echoing the "/reflex_sf/hand_state/motor" topic when the hand is running if you want to see all available motor information. Echoing the topic is done like so:

 

rostopic echo /reflex_sf/hand_state/motor