Welcome to Transbot SE repository
7.MoveIt scene design
7. MoveIt scene design
This lesson takes the MoveIT simulation as an example. If you need to set the synchronization between the real machine and the simulation, please refer to the lesson [02, MoveIt Precautions and Controlling the Real Machine]. ! ! ! be careful! ! !
The effect demonstration is a virtual machine, and other masters are running (related to the performance of the master, depending on the actual situation).
If the scene does not appear after running, you can wait for the scene design node command to run and then run it again. The scene will be loaded.
7.1. Start
Start the MoveIT
roslaunch transbot_se_moveit_config demo.launch Start scene design node
xxxxxxxxxxrosrun transbot_se_moveit_config 06_set_Scene.pyThe effect diagram is as follows

7.2. Source code
Open gripper
xxxxxxxxxx #Simulation pub_joint = rospy.Publisher("/move_group/fake_controller_joint_states", JointState, queue_size=1000) Add end-of-arm clamps
xxxxxxxxxx p = PoseStamped() p.header.frame_id = end_effector_link p.pose.orientation.w = 1 p.pose.position.x += 0.1 p.pose.position.z -= 0.07 #Add tool scene.attach_box(end_effector_link, 'tool', p, [0.03, 0.03, 0.03])Add a stand
xxxxxxxxxx table_list = { "obj0": [[0.01, 0.08, 0.2], [0.11, 0.28, 0.05]], "obj1": [[0.01, 0.08, 0.2], [-0.11, 0.28, 0.05]], "obj2": [[0.22, 0.08, 0.01], [0, 0.28, 0.12]], "obj3": [[0.22, 0.08, 0.01], [0, 0.28, 0.02]], } #Add obj for i in range(len(table_list)): add_obj(p, table_list.keys()[i], table_list[table_list.keys()[i]][0], table_list[table_list.keys()[i]][1])Cycle planning between two points
xxxxxxxxxx i = 0 while i < 5: transbot.set_joint_value_target(target_joints1) transbot.go() transbot.set_joint_value_target(target_joints2) transbot.go() i += 1 print ("Plan {}th time!!!".format(i))