This crash course introduces MoveIt 2 with ROS 2 for controlling robotic arms. It guides users through the essential steps of setting up a six-axis robotic arm, starting with MoveIt 2 installation and configuring the URDF to include necessary collision elements. The video then demonstrates the comprehensive process of using the MoveIt Setup Assistant to define self-collisions, virtual joints, planning groups, and robot poses, along with integrating ROS 2 Control configurations. Finally, it addresses common debugging issues encountered when launching the MoveIt demo, such as incorrect data types in joint limits and controller action namespace problems, enabling successful motion planning and execution in RViz.
MoveIt 2 Crash Course: Robotic Arm Configuration and Motion Planning with ROS 2
0:00 Introduction to MoveIt 2: This course teaches MoveIt 2 basics for robotic arms, covering installation, URDF configuration, using the MoveIt Setup Assistant, and motion planning. Prerequisites include ROS 2 basics and URDF knowledge.
1:46 MoveIt 2 Installation & Cyclone DDS: MoveIt 2 is installed using a single apt install command. The video recommends and demonstrates how to install and configure Cyclone DDS as the ROS 2 middleware for better compatibility.
4:35 Setting up the Robot URDF: A provided URDF for a six-axis robotic arm is used as a starting point. Instructions are given to create a ROS 2 workspace, build the my_robot_description package, source it, and visualize the robot in RViz using a display.launch.xml file.
10:10 URDF Package Overview: A quick tour of the my_robot_description package, detailing the main my_robot.urdf.xacro file, common properties, arm.xacro (containing links and joints), and the inclusion of a virtual "tool link" for future end-effector attachments.
14:21 Adding Collision Tags to URDF: Collision elements are crucial for MoveIt's collision computation. The video shows how to add <collision> tags to each link in the arm.xacro file, emphasizing the importance of simplifying collision shapes (e.g., using a box instead of a cylinder) for computational efficiency, and how to visualize these collision models in RViz.
27:21 Configuring the Robot with MoveIt Setup Assistant: The process of launching and using the MoveIt Setup Assistant is demonstrated:
29:08 Self-Collisions: Generating a collision matrix to disable collision checking for adjacent or physically impossible link pairs.
30:08 Virtual Joint: Creating a "virtual_joint" named "world" as the parent of the robot's "base_link" to attach the robot to an external frame of reference.
31:20 Planning Groups: Defining the "arm" planning group, selecting the "KDL kinematics plugin" as the solver, and adding all relevant joints from the robot.
33:15 Robot Poses: Creating and naming specific robot poses (e.g., "home," "pose_1," "pose_2") for easy recall during motion planning.
35:49 ROS 2 Control Integration: Configuring command (position) and state (position) interfaces for each joint to prepare for ROS 2 Control, which bridges software and hardware.
39:18 Launch Files & Author Information: Generating all necessary MoveIt launch files and providing author details to complete the setup.
39:59 Generating the Package: Saving the entire configuration as a new ROS 2 package, my_robot_moveit_config.
43:10 Overview of the Generated MoveIt Package Files: A detailed look at the my_robot_moveit_config package structure, including key configuration files like joint_limits.yaml, my_robot.srdf (containing planning groups, poses, and disabled collisions), and my_robot.urdf.xacro (which integrates the base URDF with ROS 2 Control settings).
51:54 Fixing joint_limits.yaml: Debugging a common error where MoveIt expects float values (e.g., 1.0) for max velocity and acceleration in joint_limits.yaml, not integers (1).
55:27 Fixing Controller Action Namespace: Resolving an error where the controller cannot be found by adding action_ns: follow_joint_trajectory and default: true to the arm_controller in moveit_controllers.yaml.
56:53 Motion Planning in RViz: Demonstrating how to use the Motion Planning plugin in RViz to plan and execute robot movements between defined poses, adjust velocity scaling, and visualize the end-effector's trajectory using "show trail."
58:11 Cartesian Path Planning: Explaining Cartesian path planning for linear end-effector movement and its limitations (e.g., encountering singularities, leading to failed plans) compared to joint space planning.
1:01:42 Conclusion & Further Learning: Recaps the course's achievements and promotes a full MoveIt 2 course for advanced topics like URDF creation from scratch, gripper integration, C++/Python API usage, and connecting MoveIt to real hardware.