MoveIt2 Motion Planning#
Overview#
MoveIt2 is the primary motion planning integration for the WMX ROS2
application. It provides collision-aware trajectory planning, and the
follow_joint_trajectory_server node executes the planned trajectories
on real hardware via the WMX cubic spline engine.
Architecture#
Prerequisites#
MoveIt2 must be installed as part of the workspace dependencies:
sudo apt install ros-${ROS_DISTRO}-moveit*
See Getting Started for the complete dependency list.
Configuration#
The follow_joint_trajectory_server node must be configured with the
correct action name that MoveIt2 expects. This is set in the config YAML:
follow_joint_trajectory_server:
ros__parameters:
joint_number: 6
joint_trajectory_action: /movensys_manipulator_arm_controller/follow_joint_trajectory
The action name must match the controller configuration in the MoveIt2 setup for your robot.
The manipulator_state node must publish to /joint_states so MoveIt2
can read the current robot state:
manipulator_state:
ros__parameters:
encoder_joint_topic: /joint_states
Usage#
Launch the WMX ROS2 manipulator nodes (see Getting Started):
sudo --preserve-env=PATH \ --preserve-env=AMENT_PREFIX_PATH \ --preserve-env=COLCON_PREFIX_PATH \ --preserve-env=PYTHONPATH \ --preserve-env=LD_LIBRARY_PATH \ --preserve-env=ROS_DISTRO \ --preserve-env=ROS_VERSION \ --preserve-env=ROS_PYTHON_VERSION \ --preserve-env=ROS_DOMAIN_ID \ --preserve-env=RMW_IMPLEMENTATION \ bash -c "source /opt/ros/\${ROS_DISTRO}/setup.bash && \ source ~/wmx_ros2_ws/install/setup.bash && \ ros2 launch wmx_ros2_package \ wmx_ros2_cr3a_manipulator.launch.py \ use_sim_time:=false"
Launch MoveIt2 with your robot’s MoveIt configuration package.
Plan and execute trajectories through the MoveIt2 interface (RViz plugin or programmatic API).
Trajectory Execution Details#
When MoveIt2 sends a trajectory, the follow_joint_trajectory_server
processes it as described in the ROS2 Actions page:
Maximum 1000 waypoints per trajectory
Cubic spline interpolation via
AdvancedMotion::StartCSplinePos()The server blocks until motion completes
Returns
error_code = 0on success