unknown_robot2 is a ROS 2 mobile robot project for simulation, SLAM, localization, and autonomous navigation using Nav2.
This project contains the robot description, Gazebo simulation files, navigation configuration, maps, launch files, and RViz setup for a custom differential-drive mobile robot.
- Simulate a custom mobile robot in Gazebo
- Visualize robot model, TF, laser scan, odometry, and map in RViz2
- Build a map using SLAM Toolbox
- Navigate autonomously using Nav2
- Test global planner and local planner behavior
- Tune costmaps, inflation layer, controller, and planner parameters
- ROS 2 Jazzy / Ubuntu 24.04 support
- Gazebo simulation
- Differential-drive robot model
- LiDAR sensor support
- Camera sensor support
- IMU support
- SLAM Toolbox mapping
- Nav2 autonomous navigation
- AMCL localization
- RViz2 visualization
unknown_robot2_ws/
βββ LICENSE
βββ README.md
βββ src
βββ unknown_robot2_bringup
βΒ Β βββ LICENSE
βΒ Β βββ package.xml
βΒ Β βββ resource
βΒ Β βΒ Β βββ unknown_robot2_bringup
βΒ Β βββ setup.cfg
βΒ Β βββ setup.py
βΒ Β βββ test
βΒ Β βΒ Β βββ test_copyright.py
βΒ Β βΒ Β βββ test_flake8.py
βΒ Β βΒ Β βββ test_pep257.py
βΒ Β βββ unknown_robot2_bringup
βΒ Β βββ __init__.py
βββ unknown_robot2_description
βΒ Β βββ CMakeLists.txt
βΒ Β βββ include
βΒ Β βΒ Β βββ unknown_robot2_description
βΒ Β βββ launch
βΒ Β βΒ Β βββ display.launch.py
βΒ Β βββ LICENSE
βΒ Β βββ media
βΒ Β βΒ Β βββ materials
βΒ Β βββ meshes
βΒ Β βββ package.xml
βΒ Β βββ rviz
βΒ Β βΒ Β βββ nav2_test.rviz
βΒ Β βΒ Β βββ odom_test.rviz
βΒ Β βΒ Β βββ slam_toolbox_test.rviz
βΒ Β βΒ Β βββ unknown_robot2.rviz
βΒ Β βββ src
βΒ Β βββ urdf
βΒ Β βββ unknown_robot2.urdf.xacro
βββ unknown_robot2_gazebo
βΒ Β βββ config
βΒ Β βΒ Β βββ empty_world.config
βΒ Β βββ launch
βΒ Β βΒ Β βββ empty_gazebo.launch.py
βΒ Β βΒ Β βββ gazebo.launch.py
βΒ Β βΒ Β βββ gz_slam_world.launch.py
βΒ Β βββ LICENSE
βΒ Β βββ package.xml
βΒ Β βββ resource
βΒ Β βΒ Β βββ unknown_robot2_gazebo
βΒ Β βββ setup.cfg
βΒ Β βββ setup.py
βΒ Β βββ test
βΒ Β βΒ Β βββ test_copyright.py
βΒ Β βΒ Β βββ test_flake8.py
βΒ Β βΒ Β βββ test_pep257.py
βΒ Β βββ unknown_robot2_gazebo
βΒ Β βΒ Β βββ __init__.py
βΒ Β βΒ Β βββ odom_to_tf.py
βΒ Β βββ worlds
βΒ Β βββ auto_test_world.sdf
βΒ Β βββ empty.sdf
βββ unknown_robot2_navigation
βββ behavior_trees
βΒ Β βββ nav_to_pose_clear_costmap.xml
βββ config
βΒ Β βββ nav2_map_params.yaml
βΒ Β βββ nav2_slam_params.yaml
βββ launch
βΒ Β βββ nav2_map.launch.py
βΒ Β βββ nav2_slam.launch.py
βββ LICENSE
βββ maps
βΒ Β βββ auto_test_map.pgm
βΒ Β βββ auto_test_map.yaml
βββ package.xml
βββ resource
βΒ Β βββ unknown_robot2_navigation
βββ setup.cfg
βββ setup.py
βββ test
βΒ Β βββ test_copyright.py
βΒ Β βββ test_flake8.py
βΒ Β βββ test_pep257.py
βββ unknown_robot2_navigation
βββ __init__.py
- Ubuntu 24.04
- ROS 2 Jazzy
- Gazebo Harmonic
- Nav2
- SLAM Toolbox
- RViz2
ros_gzbridge packages
Install common dependencies:
sudo apt update
sudo apt install -y \
ros-jazzy-ros-gz-bridge \
ros-jazzy-ros-gz-sim \
ros-jazzy-slam-toolbox \
ros-jazzy-navigation2 \
ros-jazzy-nav2-bringup \
ros-jazzy-tf2-ros \
ros-jazzy-tf2-tools \
ros-jazzy-rviz2 \
ros-jazzy-nav-msgs \
ros-jazzy-geometry-msgs \
ros-jazzy-sensor-msgs \
ros-jazzy-tf2-msgs \
python3-colcon-common-extensions \
python3-rosdep \
python3-venv \
python3-pipClone the repository:
cd ~
git clone git@github.com:wattanatum/unknown_robot2.git unknown_robot2_ws
cd unknown_robot2_wsInstall dependencies:
rosdep update
rosdep install --from-paths src -y --ignore-srcBuild the workspace:
colcon build --symlink-installSource the workspace:
source install/setup.bashOptional: add to .bashrc:
echo "source ~/unknown_robot2_ws/install/setup.bash" >> ~/.bashrc
source ~/.bashrcros2 launch unknown_robot2_description display.launch.pyros2 launch unknown_robot2_gazebo gazebo.launch.py ros2 launch slam_toolbox online_async_launch.py use_sim_time:=trueros2 launch unknown_robot2_navigation nav2_slam.launch.pyrviz2Open RViz2 config in this path:
~/unknown_robot2_ws/src/unknown_robot2_description/rviz2/slam_toolbox_test.rviz
ros2 run nav2_map_server map_saver_cli \
-f ~/unknown_robot2_ws/src/unknown_robot2_navigation/maps/auto_test_mapros2 launch unknown_robot2_gazebo gazebo.launch.py ros2 launch unknown_robot2_navigation nav2_map.launch.pyrviz2Open RViz2 config in this path:
~/unknown_robot2_ws/src/unknown_robot2_description/rviz2/nav2_test.rviz
| Topic | Description |
|---|---|
/cmd_vel |
Robot velocity command |
/odom |
Odometry data |
/scan |
LiDAR scan |
/imu |
IMU data |
/tf |
Dynamic transforms |
/tf_static |
Static transforms |
/map |
Occupancy grid map |
/goal_pose |
Navigation goal pose |
This project uses Nav2 for autonomous navigation.
Main Nav2 components:
- Planner Server
- Controller Server
- Behavior Tree Navigator
- AMCL
- Map Server
- Global Costmap
- Local Costmap
- Recovery Behaviors
- Velocity Smoother
Inflation layer example:
inflation_layer:
plugin: nav2_costmap_2d::InflationLayer
inflation_radius: 0.25
cost_scaling_factor: 3.0Lower inflation_radius reduces the obstacle safety area.
Higher cost_scaling_factor makes obstacle cost drop faster.
cd ~/unknown_robot2_ws
colcon build --symlink-install
source install/setup.bashCheck:
ros2 topic echo /cmd_vel
ros2 topic echo /odom
ros2 run tf2_tools view_framesCheck:
ros2 topic list | grep map
ros2 topic echo /map --onceCheck:
ros2 topic echo /scanCheck:
ros2 run tf2_ros tf2_echo odom base_linkKasiphat Uppaphak
GitHub: wattanatum


