RoArm-M2-S 4. Drag-and-drop Interactions in Moveit2

From Waveshare Wiki
Jump to: navigation, search
RoArm-M2-S 4. Drag-and-drop Interactions in Moveit2
RoArm-M2-S.jpg

I2C, UART
TTL Serial Bus Servo Control Interface,
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

4. Drag-and-drop Interactions in Moveit2

4.1 Moveit2 Introduction

MoveIt2 is an open-source software for the robotic movement plan, operation and control. It provides a series of simple user interfaces for helping developers handle complicated issues related to movement plans.
MoveIt2 supports a variety of algorithms and strategies, including motion planning, motion execution, motion monitoring, kinematic parsing, and collision detection. Its powerful features make it widely used in industry, research and education.
MoveIt2 runs in the ROS2 (Robot Operating System 2) environment and can be seamlessly integrated with other ROS2 tools and libraries, which greatly improves the efficiency and convenience of robot development.
In this tutorial, we will use MoveIt2 to control the movement of the robot arm. By dragging and dropping the endpoints of the robot arm, MoveIt2 is able to automatically calculate the movement path of the arm and control the actual movement of the arm through the driver nodes.

4.2 Moveit2 Drag-and-drop Demo

If you are following the previous tutorials down, before running this demo, you need to close the previous Rviz2 Robotic Arm Model Joints interface by pressing Ctrl+C in the Run View Rviz2 Robotic Arm Model Joints terminal window to close this process. The running terminal of the robotic arm driver node does not need to be closed, otherwise it will not be able to control the real robotic arm.
If you terminate the process of robotic arm's driving nodes, you need to reoperate it following this guide. Keep running robotic arm's driving nodes, and then run the Moveit2 drag-and-drop interaction demo.

  • After closing the Rviz2 Robotic Arm Model Joints interface, you can run the Moveit2 drag-and-drop demo in this interface. Run the following commands to start Rviz2:
ros2 launch roarm_moveit interact.launch.py rviz_config:=~/roarm_ws_em0/src/roarm_main/roarm_moveit/config/interact.rviz
  • You can also run it in the New Terminal interface. To run it in the New Terminal interface, you must first enter the workspace of the robotic arm ROS2, and then run the demo for the drag-and-drop interaction of the robotic arm Moveit2, as follows:
cd roarm_ws_em0
ros2 launch roarm_moveit interact.launch.py rviz_config:=~/roarm_ws_em0/src/roarm_main/roarm_moveit/config/interact.rviz

CAUTION: After executing this command, the arm will rotate (the small arm is extended directly in front and parallel to the horizontal plane), do not place fragile items around the arm and keep it away from children.

After starting Rviz2, if the robotic arm is not identified, click Display -> Fixed Frame -> map, and then change it to "base_link". Press "Enter" key to confirm, as shown below.
M2-S-drag-and-drop.png
Then click "Add" in the bottom left corner, select "MotionPlanning" and click "OK". Now you can see the model of the robot arm traveling in the Rviz2 visualization interface. You can refer to section 3.5 to change the viewpoint of the robot arm.
M2-S-drag-and-drop1.png
The robotic arm's attitude can now be changed by dragging the drag ball located at the end of the arm or the XYZ axis. After dragging and dropping to change the attitude, you need to click "Plan & Execute" in the Planning tab on the right side of the Rviz2 visualization interface to let the robot arm execute the dragged attitude movement. After the execution, you need to reset the arm to the initial position in the Rviz2 startup interface, then change the "Goal State" option in the Planning tab to "home", and then click "Plan & Execute" again. After that, click "Plan & Execute" again to let the robot arm respond to the motion.

RoArm-M2-S ROS2 Humble + Moveit2 Tutorial