Skip to content
PalletLab
ROS 2 and MoveIt

ROS 2 and MoveIt

ROS 2 (Robot Operating System 2) is not an operating system: it is the standard middleware and toolset for robot software. Programs are split into nodes that talk over a publish/subscribe network called DDS.

Core ideas

ConceptWhat it isIn this project
NodeA process with one jobpalletizer_planner
TopicA stream of messages, many-to-many/pallet_markers (visualization)
ServiceA request/response call/plan_pallet
ActionA long goal with feedback and cancelhow a real "place this carton" command would run
ParameterRuntime configurationalgorithm defaults
QoSDelivery guaranteesmarkers use transient local, so late joiners still get the last plan
TF2The tree of frames and their transformsworld → robot_base → pallet

The palletizer package

ros2/palletizer_interfaces defines the service:

string algorithm "ep"
uint32 box_count 40
uint32 seed 42
float64 min_support 0.75
---
bool success
geometry_msgs/Pose[] place_poses
geometry_msgs/Pose[] approach_poses
...

ros2/palletizer_ros wraps the C++ engine as a node: it answers /plan_pallet, publishes one cube marker per carton, and broadcasts static TF frames. It is built with colcon inside the official ROS 2 Jazzy Docker image and tested with gtest and launch_testing, which starts the real node and calls the service like any client would.

scripts/ros.sh build   # colcon build in Docker
scripts/ros.sh test    # unit + launch tests
scripts/ros.sh call    # → success=True placed=38 offered=40 fill_ratio=0.7064

Where MoveIt fits

MoveIt is ROS's motion-planning framework. Given a robot model (URDF + SRDF) and a planning scene (the pallet and already-placed cartons as collision objects), it computes collision-free joint trajectories. Our service already returns what MoveIt needs:

  • approach_poses and place_poses as geometry_msgs/Pose in the robot base frame;
  • the final descent is a straight vertical line, ideal for MoveIt's Cartesian path planner;
  • each placed carton becomes a collision object for the next plan.