5 import moveit_commander
6 import geometry_msgs.msg
8 from tf.transformations
import quaternion_from_euler
10 from std_msgs.msg
import UInt8
15 rospy.loginfo(
"PID Gain Preset. No." + str(pid_gain_no))
17 preset_no.data = pid_gain_no
18 pub_preset.publish(preset_no)
23 rospy.init_node(
"preset_pid_gain_example")
24 arm = moveit_commander.MoveGroupCommander(
"arm")
25 arm.set_max_velocity_scaling_factor(0.3)
26 arm.set_max_acceleration_scaling_factor(1.0)
28 while len([s
for s
in rosnode.get_node_names()
if 'rviz' in s]) == 0:
36 arm.set_named_target(
"vertical")
38 arm.set_named_target(
"home")
47 for i
in range(sleep_seconds):
48 rospy.loginfo(str(sleep_seconds-i) +
" counts left.")
51 arm.set_pose_target(arm.get_current_pose())
56 arm.set_named_target(
"home")
58 arm.set_named_target(
"vertical")
64 if __name__ ==
'__main__':
66 pub_preset = rospy.Publisher(
"preset_gain_no", UInt8, queue_size=1)
69 if not rospy.is_shutdown():
71 except rospy.ROSInterruptException:
def preset_pid_gain(pid_gain_no)