26 This script provides a command line interface to save the current pose of the robot (made of an arm and hand). 27 Poses can be composed of either hand joints/arm joints/all joints. This can be useful for making smooth 28 movements where the hand and arm should move synchronously. However, there are no safeties! In particular, 29 if a hand and arm aren't both present , its behaviour is undefined. Likewise if more than one hand/arm are 30 present. There is also no checking to prevent overwriting existing database entries/otherwise damaging the 31 robot_states database. It is included here as it is a useful tool, but it should be considered a work in 32 progress and used with care. 34 You have been warned :) 39 rosrun sr_robot_commander grasp_saver_unsafe.py NAME_TO_SAVE WHAT_TO_SAVE 41 NAME_TO_SAVE is the name that will be used for the state in the database. 43 N.B. IF A STATE ALREADY EXISTS WITH THAT NAME IT WILL BE OVERWRITTEN WITH NO WARNING! 45 WHAT_TO_SAVE specifies which joints will be included. It can be "arm","hand" or "both". 47 If WHAT_TO_SAVE is omitted, it defaults to "both". 50 if "__main__" == __name__:
51 rospy.init_node(
"state_saver")
53 name = rospy.get_param(
"~name")
54 which = rospy.get_param(
"~which",
"all")
55 hand_h = rospy.get_param(
"~hand_h",
False)
56 save_target = rospy.get_param(
"~save_target",
False)
61 gs =
SrStateSaverUnsafe(name +
"_both",
"both", hand_h=hand_h, save_target=save_target)
63 gs =
SrStateSaverUnsafe(name +
"_" + which, which, hand_h=hand_h, save_target=save_target)