How moveit/moveit2 works
1. This is a ROS 2 motion-planning workspace, not a single application.
The repository is a monorepo of many ROS 2 packages built with CMake/ament. The architecture is centered on MoveIt 2’s layered robotics stack: core motion-planning data structures, planner plugins, ROS-facing orchestration nodes, visualization tools, setup/config generation, and Python bindings.
2. The foundational layer is moveit_core.
This is the runtime-agnostic heart of the system. It contains the robot model, robot state, planning scene, collision detection backends, kinematic constraints, trajectory representations, transforms, dynamics, and utility code. Most higher-level packages depend on these classes rather than reimplementing robot semantics.
3. Planning data flows start from robot descriptions and configuration files.
Robot URDF/SRDF, joint limits, controller configs, and planner YAML files are loaded by packages such as rdf_loader, robot_model_loader, and moveit_configs_utils. These inputs produce the RobotModel, SRDF semantics, and planning configuration used everywhere else in the stack.
4. The planning pipeline is split into interfaces, adapters, and concrete planner plugins.
moveit_ros/planning provides the orchestration layer: planning_pipeline, plan_execution, trajectory_execution_manager, request/response adapters, and plugin loaders. Concrete planners live in moveit_planners, mainly OMPL, CHOMP, STOMP, and Pilz. The pipeline typically is: request comes in → request adapters sanitize/validate it → planner plugin generates a trajectory → response adapters post-process it → execution manager hands it to controllers.
5. Collision and state validity are backend-pluggable.
moveit_core defines collision interfaces and abstract environments; backend packages provide FCL, Bullet, distance-field, and all-valid implementations. Planning uses these backends through plugin loaders, so state validity checking is abstracted away from planner logic. This is one of the key architectural boundaries in the repo.
6. Perception updates the planning scene through dedicated monitors and updaters.
moveit_ros/perception, occupancy_map_monitor, and planning_scene_monitor feed sensor data into the world model. Depth images, point clouds, and octomap updates are converted into collision objects / occupancy representations, then merged into the PlanningScene. That scene is what planners and validity checks query.
7. Controller execution is separated from planning.
The execution side lives in trajectory_execution_manager and controller manager plugins under moveit_plugins and moveit_ros_control_interface. These packages translate a planned RobotTrajectory into controller-specific actions or joint trajectory commands. This keeps planner output independent of the actual hardware/control stack.
8. High-level ROS entry points are wrappers around the core pipeline.
move_group is the main service/action node exposing planning, cartesian path generation, scene operations, kinematics queries, and execution. moveit_cpp and move_group_interface are client-facing APIs for programmatic use. These layers sit above the pipeline and below user applications.
9. Visualization and interactive editing are separate UI consumers of the planning scene.
RViz plugins in moveit_ros/visualization render robot state, planning scenes, trajectories, and interactive markers. They subscribe to scene/state updates and provide user interaction, but they do not own planning logic. Their role is observability and manual manipulation of the planning workspace.
10. Specialized planner and motion-generation packages plug into the same framework.
moveit_kinematics supplies IK plugins such as KDL, IKFast, and cached IK. moveit_ros/moveit_servo provides high-rate servoing for joystick/pose/twist commands with collision monitoring. moveit_ros/hybrid_planning combines a global planner with a local controller and replanning logic. These are separate subsystems, but they all consume the same robot model, planning scene, and controller abstractions.
11. moveit_setup_assistant is the configuration-generation front end.
This Qt-based tool and its plugin packages generate robot packages, SRDF, controller configs, launch files, perception configs, and other boilerplate. Its output feeds directly into the runtime packages above, so it is part of the build-time/configuration path rather than the planning runtime path.
12. Python support mirrors the core C++ API, not a separate stack.
moveit_py exposes Python bindings for the main core and ROS wrappers, plus small helper modules and servo client utilities. The Python layer is a consumer of the C++ APIs, enabling scripting and integration without changing the architecture of the underlying motion-planning system.
13. Trajectories can be stored, replayed, benchmarked, and smoothed.
trajectory_cache, warehouse, and benchmarks support persistence and analysis of planning results. trajectory_processing and online_signal_smoothing provide smoothing/time-parameterization steps such as TOTG and Ruckig. These are post-planning utilities that sit between raw planner output and execution.
14. The repository is heavily plugin-driven and test-driven.
Many packages export plugin description XML files for planners, kinematics solvers, adapters, controllers, and RViz components. Tests and fixtures are distributed throughout the tree, alongside Docker and GitHub Actions files for repeatable CI across ROS 2 distributions. The plugin boundary is the key architectural mechanism that lets MoveIt support many robots and algorithms without hard coupling.
Main entry points: planning_pipeline Planning pipe · moveit_core Core · move_group Move Group · planning_scene Planning scene
Components 30
Core model
Runtime-agnostic motion-planning foundations and shared abstractions.
- Core · Foundation layer with robot model, state, planning scene, collision interfaces, constraints, trajectories, transforms, and utility code.
moveit_core - Robot model · Defines links, joints, groups, and robot structure semantics.
moveit_core/robot_model - Robot state · Holds joint/link state, attached bodies, interpolation, and conversions.
moveit_core/robot_state - Planning scene · World + robot state representation queried by planners and validity checks.
moveit_core/planning_scene - Collision API · Abstract collision environment, world model, collision matrices, and plugin contracts.
moveit_core/collision_detection - Plan API · Core request/response types plus adapters used to build planning pipelines.
moveit_core/planning_interface
ROS runtime
ROS-facing orchestration, perception, execution, and user entry points.
- RDF loader · Loads URDF/SRDF and related description data for runtime use.
moveit_ros/planning/rdf_loader - Model loader · Builds RobotModel and semantics from description/configuration inputs.
moveit_ros/planning/robot_model_loader - Scene monitor · Maintains the planning scene from robot state, trajectories, and external updates.
moveit_ros/planning/planning_scene_monitor - Occupancy map · Maintains occupancy representations and feeds environment updates.
moveit_ros/occupancy_map_monitor - Perception · Depth image, point cloud, mesh filtering, and semantic world updates into the planning scene.
moveit_ros/perception - Planning pipe · Orchestrates request adapters, planner plugins, response adapters, and pipeline execution.
moveit_ros/planning/planning_pipeline - Plan exec · Coordinates planning output, execution decisions, and sensing-aware plan management.
moveit_ros/planning/plan_execution - Trajectory exec · Sends robot trajectories to controller backends and manages execution timing.
moveit_ros/planning/trajectory_execution_manager - Move Group · Main service/action node exposing planning, scene operations, kinematics, and execution.
moveit_ros/move_group - MoveIt C++ · Programmatic C++ client layer above the planning runtime.
moveit_ros/planning/moveit_cpp - Group interface · Convenience interface for applications that talk to Move Group.
moveit_ros/planning_interface/move_group_interface - Visualization · RViz displays for robot state, planning scenes, trajectories, and interactive editing.
moveit_ros/visualization - Hybrid planning · Combines a global planner, local planner, replanning logic, and trajectory operators.
moveit_ros/hybrid_planning - Servo · Closed-loop servoing for high-rate pose, twist, and joint commands with collision monitoring.
moveit_ros/moveit_servo - Controllers · Controller manager and execution plugins that adapt trajectories to hardware control backends.
moveit_plugins
Planners
Concrete planning and kinematics plugins that implement algorithms.
- Kinematics · IK solver plugins including KDL, IKFast, cached IK, and service-based variants.
moveit_kinematics - Planners · Concrete planners and planner interfaces such as OMPL, CHOMP, STOMP, and Pilz.
moveit_planners
Setup and bindings
Configuration generation, Python APIs, and supporting tooling.
- Setup assistant · GUI and templates for generating robot packages, SRDF, controllers, perception, and launch configs.
moveit_setup_assistant - Config utils · Python helpers for generating and loading MoveIt configuration packages and defaults.
moveit_configs_utils - Python API · Python bindings and helpers mirroring the C++ core and ROS-facing APIs.
moveit_py
Data and tools
Persistence, benchmarking, and trajectory post-processing utilities.
- Trajectory proc · Time parameterization and smoothing such as TOTG and Ruckig.
moveit_core/trajectory_processing - Trajectory cache · Stores, reuses, and scores motion-planning results and execution metadata.
moveit_ros/trajectory_cache - Warehouse · Persistence layer for states, scenes, constraints, and trajectories.
moveit_ros/warehouse - Benchmarks · Measures and compares planning and collision-checking performance.
moveit_ros/benchmarks
Connections 40
- Core → Robot model: defines · Robot model is a primary core subsystem.
- Core → Robot state: defines · Robot state builds on the model and kinematics.
- Core → Planning scene: defines · Planning scene combines model, state, and world.
- Core → Collision API: defines · Abstract collision environment and plugin boundary.
- Core → Plan API: defines · Common planning request/response abstractions.
- Core → Trajectory proc: defines · Time parameterization and smoothing utilities.
- RDF loader → Model loader: feeds · Description data is loaded before model construction.
- Model loader → Robot model: builds · Constructs the runtime robot model from URDF/SRDF.
- Model loader → Planning scene: initializes · Supplies model semantics used by scenes and planning.
- Scene monitor → Planning scene: maintains · Synchronizes scene state from ROS sources.
- Scene monitor → Robot state: tracks · Tracks current robot state and trajectory updates.
- Occupancy map → Perception: updates · Perception and occupancy updates are merged into the scene.
- Perception → Planning scene: updates · Sensor data becomes world/collision updates.
- Planning pipe → Plan API: implements · Pipeline executes the generic planning contract.
- Planning pipe → Planners: loads · Uses concrete planner plugins.
- Planning pipe → Trajectory proc: post-processes · Adapters can smooth and time-parameterize output.
- Plan exec → Planning pipe: calls · Runs planning as part of execution flow.
- Trajectory exec → Controllers: uses · Dispatches planned trajectories through controller plugins.
- Move Group → Scene monitor: hosts · Main ROS node owns scene synchronization and services.
- Move Group → Planning pipe: invokes · Provides planning and cartesian path services.
- Move Group → Plan exec: orchestrates · Coordinates planning, sensing, and execution.
- Move Group → Trajectory exec: executes · Hands trajectories to controller execution.
- MoveIt C++ → Planning pipe: clients · C++ API wraps the planning runtime.
- Group interface → Move Group: clients · Application-facing interface communicates with the node.
- Visualization → Planning scene: renders · RViz plugins subscribe to scene and state updates.
- Visualization → Robot state: renders · Displays robot state and trajectories.
- Kinematics → Planning pipe: supports · IK solvers are consumed during planning and querying.
- Kinematics → Move Group: supports · Kinematics services and plugins are exposed through ROS entry points.
- Planners → Planning pipe: plug into · Planner implementations are loaded by the pipeline.
- Servo → Scene monitor: consumes · Uses live scene state for collision-aware servoing.
- Servo → Trajectory exec: bypasses · Produces motion commands directly rather than batch planning.
- Hybrid planning → Planning pipe: combines · Global planner component reuses the standard planning pipeline.
- Hybrid planning → Servo: coordinates · Local planning and replanning complement servo-like execution.
- Setup assistant → Config utils: generates · Build-time wizard emits configuration packages and defaults.
- Python API → Core: binds · Python mirrors core C++ APIs.
- Python API → Group interface: wraps · Python exposes ROS-facing client APIs.
- Trajectory cache → Group interface: stores · Caches request/response patterns from application use.
- Warehouse → Move Group: persists · Stores scenes, states, constraints, and trajectories.
- Benchmarks → Planning pipe: measures · Benchmarks planning performance and planner behavior.
- Benchmarks → Collision API: compares · Compares collision-checking backends and costs.