Using ROS2 with OmniBot V2
This page introduces ROS2 Humble in a practical way for OmniBot V2 developers. The goal is not only to help you run commands, but to understand why ROS2 is powerful and how OmniBot V2 is designed to take advantage of that ecosystem.
Why ROS2 Matters on OmniBot V2
ROS2 gives you a standard communication framework for robotics software. Instead of writing one monolithic program, you compose behavior from interoperable nodes that exchange messages over topics, transforms, services, and actions.
With OmniBot V2, this means you can:
- Drive manually or autonomously with the same motion interfaces
- Swap sensors and control pipelines without rewriting the full stack
- Use common community tools (
RViz,rqt,Nav2,slam_toolbox,robot_localization) - Inspect and debug live system behavior from the command line
For OmniBot-specific nodes, see the Drivers page. This ROS2 page focuses on core framework workflows you will use every day.
Environment Setup (ROS2 Humble)
OmniBot V2 is designed for Ubuntu 22.04 with ROS 2 Humble.
In each new terminal:
source /opt/ros/humble/setup.bash
source ~/ros2_ws/install/setup.bash
If your package is not built yet:
cd ~/ros2_ws
colcon build --symlink-install
source install/setup.bash
ROS2 Graph Basics
A quick mental model:
- Nodes are processes (for example, controller, lidar driver, localization)
- Topics are message streams (for example,
/cmd_vel,/scan,/odom) - TF2 is the coordinate-frame tree (
map,odom,base_link, sensor frames) - Actions support long-running goals (for example, Nav2 navigation goals)
Essential CLI Tooling
Discover topics
ros2 topic list
Common OmniBot-related topics you will often see:
/cmd_vel/odom/scan/tf/tf_static
Inspect topic type and publishers/subscribers
ros2 topic info /odom
ros2 topic info /scan
Echo live message data
ros2 topic echo /odom
ros2 topic echo /scan
For a single sample:
ros2 topic echo --once /odom
Measure publish frequency
ros2 topic hz /odom
ros2 topic hz /scan
Publish test commands
You can manually send motion commands to test the command path:
ros2 topic pub --rate 10 /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.1}, angular: {z: 0.0}}"
Always test at low speed in a safe area.
Topic Remapping (Core ROS2 Skill)
Remapping lets you adapt node interfaces without modifying source code.
Example: remap teleop output from /cmd_vel to /cmd_vel_recv so a safety node can evaluate and forward to /cmd_vel:
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r /cmd_vel:=/cmd_vel_recv
General remap pattern:
--ros-args -r <from_topic>:=<to_topic>
This is one of the most useful ROS 2 capabilities when integrating OmniBot V2 with custom pipelines.
Understanding Key OmniBot Topics
/cmd_vel (commanded velocity)
- Message type:
geometry_msgs/msg/Twist - Typical use: high-level motion command input from teleop, planner, or autonomy node
- Important note: only one control source should command motion at a time unless you intentionally multiplex inputs
/odom (odometry)
- Message type:
nav_msgs/msg/Odometry - Contains estimated robot pose and velocity in the odometry frame
- Used by localization, visualization, and planning stacks
Check one message:
ros2 topic echo --once /odom
Check update rate:
ros2 topic hz /odom
/scan (2D lidar scan)
- Message type:
sensor_msgs/msg/LaserScan - Contains angle-indexed range measurements around the robot
- Used by obstacle detection, SLAM, and localization/navigation
Check scan rate:
ros2 topic hz /scan
TF2: The Coordinate Frame System
TF2 describes how frames relate over time. For mobile robots, this is foundational.
Typical OmniBot frame chain:
map->odom->base_linkbase_link->base_laser(orlaser)base_link-> camera frame (if camera transforms are published)
Why this matters:
- RViz needs valid TF to place sensor data correctly
- Nav2 depends on stable frame transforms
- If TF is wrong, maps, scans, and goals appear in incorrect locations
Useful TF commands:
ros2 run tf2_ros tf2_echo odom base_link
ros2 topic echo --once /tf
ros2 topic echo --once /tf_static
Important rule: only one node should publish each transform relationship (for example, odom -> base_link).
RViz: Visual Debugging and Validation
RViz is your main visualization and debugging tool for ROS 2.
Launch:
rviz2
Recommended displays when validating OmniBot bring-up:
TFLaserScan(topic:/scan)Odometry(topic:/odom)RobotModel(if URDF is loaded)Map(when SLAM/Nav2 map is available)
Typical workflow:
- Set Fixed Frame (
maporodom, depending on your stack state) - Confirm TF tree is connected
- Confirm scan data aligns with expected geometry
- Confirm odometry updates smoothly while moving
Nav2 on OmniBot V2
Nav2 provides autonomous goal-based navigation using planners, controllers, behavior trees, and lifecycle-managed nodes.
Typical prerequisites:
- Valid
/scan - Valid
/odom - Valid TF tree (
map,odom,base_link, sensor frames) - A localization source (AMCL or SLAM localization mode)
- A map (for map-based navigation mode)
Start Nav2 with a map (example):
ros2 launch nav2_bringup bringup_launch.py use_sim_time:=false map:=/home/gyropalm/maps/omnibot_lab.yaml
Open Nav2 RViz config:
rviz2 -d $(ros2 pkg prefix nav2_bringup)/share/nav2_bringup/rviz/nav2_default_view.rviz
In RViz:
- Set
2D Pose Estimateto initialize localization - Send a
Nav2 Goalto command autonomous motion
OmniBot V2 also supports convenience launch files in the OmniBot package for mapping and navigation workflows.
High-Value ROS2 Tools to Learn Next
rqt_graphto visualize node/topic wiringrqt_plotto plot values over time (for velocity and odometry diagnostics)ros2 bag recordto capture and replay dataros2 param list/get/setfor runtime tuningros2 node list/infofor process-level introspection
Quick Troubleshooting
If behavior is not as expected:
- Confirm environment is sourced (
/opt/ros/humbleand workspaceinstall/setup.bash) - Confirm expected nodes are running (
ros2 node list) - Confirm key topics exist and are active (
ros2 topic list,ros2 topic hz) - Confirm TF connectivity and frame names
- Confirm only one publisher owns each critical transform chain
- Validate command path from input source to
/cmd_vel
Final Takeaway
The strength of OmniBot V2 is not just the hardware. It is the combination of robust hardware plus a ROS2-native software interface that lets you inspect, customize, and scale behavior with industry-standard tools. Once you are comfortable with topics, TF2, RViz, and Nav2, you can build advanced autonomy workflows quickly and with confidence.