Welcome to Transbot SE repository
1.MoveIt configuration
1. MoveIt configuration
1. MoveIt configuration1.1.Start the program1.2. Configuration processClick the [Browse] button, find the URDF model file, and click [Load Files] in the lower right corner to load.1.2.2. Create a collision-free inspection matrix1.2.3. Create a motion planning group1.2.3.1. Add robotic arm planning group1.2.3.2. Add gripper planning group1.2.4. Create preset poses (Robot Poses)1.2.5. Set end-effect joints1.2.6. Establish ROS controller1.2.7. Add simulation1.2.9. Add author information, if you don't add it, you can't generate1.2.10. Generate configuration file1.3. Detailed explanation of MoveIt configuration package1.3.1. Config folder1.3.2、launch folder1.4. Configuration Verification
1.1.Start the program
Start the roscore
roscore
Start the MoveIT
xxxxxxxxxxrosrun moveit_setup_assistant moveit_setup_assistant
1.2. Configuration process
1.2.1. Load the URDF model
If the error [Model not found] is reported when loading the model, exit MoveIt-->Enter the workspace-->Compile (sudo apt update)-->Update the environment (source devel/setup.bash)-->Start the MoveIt configuration again . The interface after startup is as follows:

If loading the model generation configuration for the first time, Click [Create New MoveIt Configuration Package]; If modifying the generated configuration file, Click [Edit Existing MoveIt Configuration Package].

Click the [Browse] button, find the URDF model file, and click [Load Files] in the lower right corner to load.
1.2.2. Create a collision-free inspection matrix
Collision detection is a very complex computational process. For multi-joint robotic arms or humanoid robots, the mechanical structure is complex and there are many joints, and collision detection needs to involve a lot of spatial geometric calculations. But for rigid body robots, some joints are impossible to collide with, such as limbs that are already adjacent. The purpose of generating self-collision here is to tell us which joints will not collide. In the subsequent collision detection algorithm, the detection between these joints can be directly skipped to improve the detection efficiency.
After the model is loaded, select [Self-Collisions] and click the [Generate Collision Matrix] button.

1.2.3. Create a motion planning group
Planning Group is one of the core of MoveIt. Click [Add Group] to add a planning group

1.2.3.1. Add robotic arm planning group
If there is no [trac-ik] in the system, execute the following command to install it.
xxxxxxxxxxsudo apt-get install ros-melodic-trac-ik*
Group Name: Create group name, set to [arm_group].
Kinematic Solver: Here we choose [trac_ik]
Kinematics solution tool, this is responsible for solving forward kinematics (Forward Kinematics) and inverse kinematics (IK). Generally, we use KDL, The Kinematics and Dynamics Library. This is a kinematics and dynamics library, which can better solve the forward and inverse kinematics problems of single-chain mechanical structures with more than 6 degrees of freedom.
Of course, you can also use other IK Solver, such as SRV or IK_FAST, and even you can develop a new Solver yourself and insert it.
Kin. Search Resolution: Sampling density of joint space
Kin. Search TImeout: The solution time, if the equipment performance is insufficient or there is no solution within the specified time during the actual application process, the time can be increased; for example, set it to [0.1], [0.01].
Click [Add Kin.Chain] to add a joint chain.

Click [Expand All], select Base Link as [base_footprint], and select Tip Link as [arm_link5]; click [save] to save.

1.2.3.2. Add gripper planning group
Click [Add Group] to add gripper planning group.
The creation group name is set to [gripper_group], no need to set the kinematics solver; click [Add Links] to add the gripper link.

Select the link of the gripper part, click [>], the right side is automatically added, and click [Save] to save.

1.2.4. Create preset poses (Robot Poses)
Select [Robot Poses] and then click [Add pose] to add poses.
Add the robot arm pose, the pose name Pose Name is set to [up]

Add [down]pose

Add [init]pose

Add [close]pose

Add [open]pose

1.2.5. Set end-effect joints
Select [End Effectors], set as shown below

1.2.6. Establish ROS controller
Select [ROS Control], click to automatically add follow joint track

1.2.7. Add simulation
Select [Simulation], click [Generate URDF]

1.2.8. Add and build 3D information (optional)
Select [3D Perception], select [Point Cloud].
1.2.9. Add author information, if you don't add it, you can't generate
Select [Author Information] and add the following content.
1.2.10. Generate configuration file
Select[Configuration Files],click[Browse],select the folder[x3plus_moveit_config] (the folder must be empty), and click the [Generate Package] button to generate the configuration file. When finished, click [Exit Setup Assistant].

1.3. Detailed explanation of MoveIt configuration package
Open the just created folder[x3plus_moveit_config], we found that there are two folders config and launch.
1.3.1. Config folder
- fake_controllers.yaml: This is the virtual controller configuration file, so that we can run MoveIt without a physical robot, or even without any simulator (such as gazebo) turned on.
- joint_limits.yaml: The limits of the position, speed and acceleration of each joint of the robot are recorded here, which will be used for future planning.
- kinematics.yaml:things set by the motion planning group, used to initialize the kinematics solver library.
- yahboomcar_X3plus.srdf:This is an important MoveIt configuration file.
- ompl_planning.yaml:Here are various parameters for configuring various algorithms of OMPL.
- SRDF file: SRDF is the configuration file of moveit, used with URDF. We can see that this is a configuration file in xml format, the root is robot, and there is an attribute name='yahboomcar_X3plus'. The following is what was just set in the Setup Assistant, including the definition of group, pose, terminal controller, virtual joint, and collision avoidance matrix ACM. In theory, as long as we have srdf and urdf, we can completely define a robot moveit information.
1.3.2、launch folder
- demo.launch: The demo is the summary point of the operation. When we open it, we can see that it includes other launch files.
- move_group.launch: As the name suggests, the function of move group is to make a planning group move. The default is to use the ompl motion planning library. Others are to set some basic parameters, which can be skipped for the time being.。
- planning_context.launch:Here we can see that the urdf and srdf files used are defined, as well as the kinematics solution library. It is not recommended to change these manually, but if you need to use a different urdf, srdf, you can change it here.
- setup_assistant.launch: If you need to change some configuration, you can run it directly.
1.4. Configuration Verification
Enter the workspace where the configuration file is located and execute the following command
xxxxxxxxxxcd ~/transbot_ws # enter work spacecatkin_make # compilesource devel/setup.bash # Update system environmentroslaunch transbot_se_moveit_config demo.launch # start moveITExamples are as follows
