The ROS 2 client libraries for C++ (
rclcpp) and Python (
rclpy).
rclcpp is faster, lower-level, and the right choice for drivers, controllers, and performance-critical nodes.
rclpy is slower but much faster to write — ideal for behavior scripts, data logging, and prototypes.
Practical: Most teams write the “hardware-near” nodes in C++ and the “logic” nodes in Python. Both libraries wrap the same
rcl (ROS Client Library) C interface, so they can coexist in the same system.
See also: Node (ROS 2),
Composition (ROS 2).
A tool and format for recording and playing back ROS 2 messages.
ros2 bag record -a records all topics;
ros2 bag play my_bag replays them.
Practical: Essential for debugging: record a bag while the robot runs, then replay it in a development environment to test changes without the hardware. Bags are stored as SQLite3 databases (ROS 2
.db3 format). Use
ros2 bag info my_bag to inspect contents. For long recordings, filter topics:
ros2 bag record -o robot_run /camera/image /scan /tf.
See also: Topic (ROS 2),
rqt.
A Qt-based GUI framework for ROS 2 with plugins:
rqt_graph (visualize the node/topic graph),
rqt_plot (plot numeric topic data),
rqt_reconfigure (dynamically tune parameters),
rqt_image_view (display camera images).
Practical: rqt_graph is the #1 tool when onboarding to an existing ROS 2 codebase — it shows you which nodes talk to which topics. Launch
rqt from the terminal with the same ROS domain as your running nodes. Plugins are extensible;
rqt_bag is a visual bag viewer.
See also: rosbag (ROS 2),
TF2 (Transform Library).
ros_gz (ROS 2–Gazebo Bridge)
#The official bridge package bridging ROS 2 and Gazebo communication. Maps Gazebo topics/ services to ROS 2 equivalents via a YAML configuration file.
Practical: The simplest bridge:
ros2 run ros_gz_bridge parameter_bridge /cmd_vel@geometry_msgs/msg/Twist@gz.msgs.Twist. Use a YAML config file for complex setups:
bridge: blocks mapping topics, with fields
ros_topic,
gz_topic,
type, and
direction (BIDIRECTIONAL, GZ_TO_ROS, ROS_TO_GZ).
ros_gz_sim provides spawn and delete entity services. Start seeing topic data with
gz topic -e -t /world/default/model/my_robot/link/odometry/odometry.
See also: Gazebo (ROS 2 Simulator),
Topic (ROS 2),
Parameter (ROS 2).
The standard framework for robot control in ROS 2. Defines a
Controller Manager (loads, unloads, switches controllers at runtime),
Hardware Interfaces (abstracts the real or simulated robot hardware), and
Controllers (e.g. joint trajectory, velocity, position).
Practical: All modern ROS 2 robots use ros2_control. Set up with a YAML config file describing your hardware (
<ros2_control> tags in URDF) and controllers (
ros2_controllers.yaml). Start the controller manager with
ros2 run controller_manager controller_manager, then load a controller:
ros2 control load_controller joint_state_broadcaster --set-state active. Common controllers:
joint_state_broadcaster,
joint_trajectory_controller,
diff_drive_controller,
position_controllers.
See also: URDF (Unified Robot Description Format),
Node (ROS 2),
Lifecycle Node.
A package for sensor fusion and state estimation using an Extended Kalman Filter (EKF) or Unscented Kalman Filter (UKF). Combines IMU, wheel odometry, GPS, visual odometry, and other sensors into a single filtered odometry estimate.
Practical: Configure via
ekf.yaml with sensor topics and noise covariances. Launch
ros2 run robot_localization ekf_node --params-file ekf.yaml. The node publishes
odometry/filtered (nav_msgs/Odometry) and
tf from
odom to
base_link. Key gotcha: set
two_d_mode: true for wheeled robots (fixes roll/pitch). robot_localization is the de facto state estimator for ROS 2 mobile robots — don't write your own filter.
See also: TF2 (Transform Library),
Nav2 (Navigation Stack),
SLAM Toolbox.
The 3D visualization tool for ROS 2. Displays robot models (URDF), sensor data (laser scans, point clouds, camera images), transforms (TF tree), paths, maps, and custom markers.
Practical: Launch with
rviz2 or
ros2 run rviz2 rviz2. Save your display configuration as a
.rviz file and load it:
rviz2 -d my_config.rviz. Essential displays: RobotModel (loads URDF), TF (shows coordinate frames), LaserScan, PointCloud2, Map, Path. For programmatic markers, use
visualization_msgs/Marker and
MarkerArray — publishing to
/rviz_markers with a namespace.
rviz_visual_tools provides a convenient C++/Python API for common shapes.
See also: URDF (Unified Robot Description Format),
TF2 (Transform Library),
rqt.
The micro-ROS executor that replaces the standard ROS 2 spinning loop. It is a cooperative, non-blocking scheduler that polls publishers, subscribers, services, timers, and guard conditions in a single thread with configurable timing.
Practical: Pattern:
rclc_executor_init(&executor, &support, num_handles, &allocator); rclc_executor_add_subscription(&executor, &sub, &msg, &callback); rclc_executor_spin_some(&executor, RCL_MS_TO_NS(100));. You control how much time the executor spends per cycle — critical for real-time control loops. Do not use blocking calls inside callbacks.
See also: Micro-ROS Client,
RCLC Support,
rclcpp (ROS 2 C++ Client Library).
The initialization struct that allocates all memory for a micro-ROS node. Created with
rclc_support_init(&support, 0, NULL, &allocator). Holds the DDS participant, the ROS 2 node handle, and the allocator.
Practical: You always allocate the support struct first, then create nodes, publishers, and subscribers from it. On constrained MCUs (like the RP2040 with 264 KB RAM), pre-allocate a pool and pass it via
rcl_get_default_allocator() or your own static allocator. The support struct must outlive all handles created from it.
See also: RCLC Executor,
Micro-ROS Client,
Transport (Micro-ROS).
The
ROS Middleware interface — an abstraction layer between the ROS 2 client library and the DDS implementation. In micro-ROS, the RMW is
rmw_microxrcedds, a minimal RMW that uses eProsima's Micro XRCE-DDS serialization instead of full DDS.
Practical: The micro-ROS RMW trades features (no QoS profiles beyond default, no multi-participant) for memory footprint (~50 KB RAM for a simple publisher + subscriber). You don't configure the RMW directly — it's baked when you build the firmware.
See also: DDS (Data Distribution Service),
Micro-ROS Client,
Transport (Micro-ROS).