A ROS 2 Humble–based Jarabot simulator with Cartographer SLAM integration.
Yonguk Cho
Robotics Developer / ROS 2 Engineer
Creator of Jarabot Simulator
This repository extends the original Jarabot Simulator by adding Cartographer SLAM, enabling real-time map building and localization using simulated LiDAR data.
It is designed for ROS 2 SLAM education, simulation-based testing, and algorithm development without real hardware.
Keywords: ROS2 Simulator, Mobile Robot Simulator, LiDAR, RViz2, Odometry, TF, SLAM, Navigation2, Cartographer
- 2D differential-drive mobile robot simulator
- Simulated 2D LiDAR (
/scan) - Encoder-based odometry (
/odom) - TF tree broadcasting (
odom → base_link) - Cartographer SLAM integration
- RViz2 visualization
- Keyboard teleoperation
- Safety stop node for collision protection
- Ubuntu 22.04
- ROS 2 Humble
- RViz2
ros2 -h
echo $ROS_DISTRO # should output: humbleThis repository follows the standard ROS 2 colcon workspace layout:
jarabot_sim_ws
├── src
│ ├── jarabot_sim
│ ├── jarabot_sim_cartographer
│ ├── jarabot_sim_interfaces
│ ├── jarabot.png
│ ├── jarabot_sim_rviz.png
│ └── README.md
├── build
├── install
└── log
- Core simulator package.
- LiDAR simulation
- Encoder & odometry
- TF publishing
- RViz marker & path visualization
- Safety stop node
- Cartographer SLAM integration package.
- Cartographer configuration
- SLAM launch files
- Map generation in RViz
Custom message definitions for Jarabot.
These are needed to build and manage ROS workspaces.
sudo apt update
sudo apt install -y \
git \
python3-colcon-common-extensions \
python3-rosdep \
build-essentialRequired for simulation, TF handling, and RViz visualization.
sudo apt install -y \
ros-humble-rviz2 \
ros-humble-tf2-ros ros-humble-tf-transformations \
ros-humble-robot-state-publisher \
ros-humble-joint-state-publisher \
ros-humble-nav-msgs \
ros-humble-sensor-msgs \
ros-humble-geometry-msgs \
ros-humble-teleop-twist-keyboardUsed to generate a 2D map from simulated LiDAR data.
sudo apt install -y \
ros-humble-cartographer \
ros-humble-cartographer-rosmkdir -p ~/jarabot_sim_ws/src
cd ~/jarabot_sim_ws/src
git clone https://github.com/playros/jarabot-simulator-slam.git .cd ~/jarabot_sim_ws
colcon build
source install/setup.bashThis project is designed to be run using 5 separate terminals.
source ~/jarabot_sim_ws/install/setup.bash
ros2 launch jarabot_sim jarabot_simulator.launch.pysource ~/jarabot_sim_ws/install/setup.bash
ros2 launch jarabot_sim_cartographer cartographer_slam.launch.pysource ~/jarabot_sim_ws/install/setup.bash
rviz2source ~/jarabot_sim_ws/install/setup.bash
ros2 run teleop_twist_keyboard teleop_twist_keyboard \
--ros-args -r cmd_vel:=/cmd_vel_rawsource ~/jarabot_sim_ws/install/setup.bash
ros2 run jarabot_sim jarabot_sim_safety_stopros2 node listExpected:
- jara_sim_* nodes (encoder, odometry, lidar, marker, path)
- cartographer_node
- cartographer_occupancy_grid_node
📌 If Cartographer nodes are missing, SLAM is not running.
ros2 topic list | grep -E "/cmd_vel|/scan|/odom|/map|/tf"| Topic | Purpose |
|---|---|
/cmd_vel |
Robot velocity command |
/scan |
Simulated LiDAR |
/odom |
Odometry |
/map |
SLAM-generated map |
/tf |
Coordinate transforms |
ros2 topic hz /scan
ros2 topic hz /odom
ros2 topic hz /map✔ If frequency is not zero, the system is working.
ros2 run tf2_ros tf2_echo map base_linkExpected TF chain:
map → odom → base_link📌 If this is broken, the map will not appear correctly in RViz.
ros2 topic pub --once /cmd_velros2 topic pub --once /cmd_vel_raw geometry_msgs/msg/Twist "{linear: {x: 0.2}, angular: {z: 0.0}}" geometry_msgs/msg/Twist \
"{linear: {x: 0.2}, angular: {z: 0.0}}"- Robot moves
- Odometry changes
- Map updates in RViz
| Key | Action |
|---|---|
i |
Move forward |
, |
Move backward |
j |
Rotate left |
l |
Rotate right |
k |
Stop |
q / z |
Increase / decrease speed |
Ctrl + C |
Exit |
| Topic | Type | Description |
|---|---|---|
/scan |
sensor_msgs/LaserScan |
Simulated LiDAR |
/odom |
nav_msgs/Odometry |
Odometry |
/tf |
TF | Coordinate transforms |
/cmd_vel_raw |
geometry_msgs/Twist |
Raw velocity command |
/map |
nav_msgs/OccupancyGrid |
SLAM-generated map |
- Robot model & markers
- LiDAR scan
- SLAM map
- Robot trajectory
- TF tree
- ROS 2 SLAM education
- Cartographer configuration testing
- Navigation2 pre-integration testing
- Simulation-only robotics training
- This project provides a ROS 2 Humble–based 2D mobile robot simulator
- Includes virtual LiDAR, odometry, TF, and Cartographer SLAM
- Designed for education, SLAM testing, and algorithm development
MIT License
- Developed and maintained by Yonguk Cho
- Jarabot Simulator (also known as jarabot-simulator or jarabot simulator)


