Implementing NAV2 and SLAM on mobile robot with gazebo environment.
This repository contains a Gazebo simulation for a differential drive robot, equipped with an IMU, a depth camera, camera and a 2D LiDAR. The primary contriution of this project is to support ROS2 and nav2. Currently, the project supports the following versions -
Each of the following sections describes depedencies, build and run instructions for each of the above combinations
In addition to ROS2 Humble and Gazebo Classic installations, we need to manually install gazebo_ros_pkgs (since the same branch supports Classic and Fortress)
sudo apt-get install ros-humble-gazebo-ros-pkgs
Remainder of the dependencies can be installed with rosdep
# From the root directory of the workspace. This will install everything mentioned in package.xml
rosdep install --from-paths src --ignore-src -r -y
colcon build --packages-select rav_bot
To launch the robot in Gazebo,
ros2 launch rav_bot rav_gazebo.launch.py
To view in rviz,
ros2 launch rav_bot rviz.launch.py
To launch the robot in Gazebo,
ros2 launch bcr_bot ign.launch.py
To view in rviz,
ros2 launch bcr_bot rviz.launch.py
SLAM Toolbox is an open-source package designed to map the environment using laser scans and odometry, generating a map for autonomous navigation.
NOTE: The command to run mapping is common between all versions of gazebo.
To start mapping:
ros2 launch rav_bot mapping.launch.py
Use the teleop twist keyboard to control the robot and map the area:
ros2 run teleop_twist_keyboard teleop_twist_keyboard cmd_vel:=/bcr_bot/cmd_vel
To save the map:
cd src/bcr_bot/config
ros2 run nav2_map_server map_saver_cli -f bcr_map
Nav2 is an open-source navigation package that enables a robot to navigate through an environment easily. It takes laser scan and odometry data, along with the map of the environment, as inputs.
NOTE: The command to run navigation is common between all versions of gazebo.
To run Nav2 on bcr_bot:
ros2 launch bcr_bot nav2.launch.py
- plan to use this simulation with rav2 and use to get some more tutorial on it with plannars, behaviors and learn more.
- use Hardware to integrate with same urdf design (hardware project will be in another repo).