def run_driver():
# init moveit commander
moveit_commander.roscpp_initialize(sys.argv)
# specify move group
group = moveit_commander.MoveGroupCommander("arm")
# init ros node
rospy.init_node('real_servo_driver', anonymous=True)
print "============ Waiting for RVIZ..."
rospy.sleep(2)
# move grasper to init position
init_position(group)
# set ros publisher rate, 10hz = 10 seconds for a circle
rate = rospy.Rate(50)
while True:
group.set_random_target()
plan_msg = group.plan()
group.execute(plan_msg=plan_msg, wait=False)
rospy.sleep(5)
if is_exit:
break
# shutdown moveit commander
moveit_commander.roscpp_shutdown()
评论列表
文章目录