Welcome to DOFBOT SE repository
10. MoveIt Collision Detection
Moveit Collision Detection
Moveit Collision Detection1. Environment2. Driving the Real Machine2.1 Starting the Real Device2.2 Starting MoveIt23. Collision Detection3.1. Visualization3.2. Launch Command
1. Environment
Ubuntu 22.04
ROS2: Humble
2. Driving the Real Machine
Driving the real machine involves subscribing to Moveit2's /joint_states topic to convert the joint state information of the robotic arm into control data for a real robotic arm.
Note: Since the real robotic arm lacks obstacle avoidance, some poses may encounter obstacles; therefore, the planned robotic arm movements should be as reasonable as possible and avoid obstacle-prone areas.
(It is recommended to use preset poses for demonstrating the real device)
2.1 Starting the Real Device
Without driving the real device, the robotic arm movements will be simulated in MoveIt:
xxxxxxxxxxros2 run dofbot_driver dofbot_driver
2.2 Starting MoveIt2
xxxxxxxxxxros2 launch dofbot_moveit demo.launch.py
3. Collision Detection
After the program runs, RViz2 will add a cuboid obstacle next to the robotic arm. The robotic arm will plan to the target position in the program, and the entire planning and execution process will automatically avoid the obstacle.
3.1. Visualization
Before executing the launch command, you must add the MarkerArray plugin in RViz2 to display the planned path. For the MarkerArray, you need to select the arm_group topic.


3.2. Launch Command
Once the robotic arm has successfully loaded in MoveIt and the message You can start planning now! appears, run the following command: the robotic arm will automatically plan a path to avoid the rectangular obstacle and move to the specified target position.

xxxxxxxxxxros2 run dofbot_moveit obstacle_avoidance
In the simulation interface, you can observe the robotic arm maneuvering to avoid the rectangular obstacle.
