Modular ROS 2 Nav2 Docker environment for UTNRG robots. Provides a reproducible, containerized ROS 2 setup with Nav2, pre-cloned robot-specific repositories, and support for dynamic configuration of platforms (Husarion Panther, Clearpath Warthog) and sensors (Ouster lidar, DepthAI cameras, etc.) via build-time selection.
Note these steps are only required if you are setting up a new robot. If someone has already installed and built this docker image on your robot, then you can skip to the Running section below
- Clone repo into your user workspace.
git clone git@github.com:UTNuclearRobotics/nav2-modular.git
- Edit the
<robot>.yamlconfig file located in/Docker/repos/directory to specify your robot specific repos for navigation and hardware - Modify the following variable in the
Dockerfileto match the name of your<robot>.yamlconfig fileARG CONFIG=<robot>
- Make the nav2 script executable
chmod +x nav2-modular/scripts/nav2
- Install NAV2-Modular CLI
cd ~/ros2_ws/nav2-modular<br> sudo usermod -aG docker $USER export PATH="$HOME/.local/bin:$PATH" make install (Optional): echo "alias nav2='<path_to_pkg>/nav2-modular/scripts/alias'" >> ~/.bash_aliases && source ~/.bashrc
- Build the docker image (Optional)
Only required if the image does not already exist.
nav2 build -v
- Start the docker image
nav2 start
- Added cyclone_panther.xml for CycloneDDS middleware implementation to nav2-modular/Docker/config/bagheera/cyclone_panther.xml
- This file is mounted in the container and the environment variables RMW_IMPLEMENTATION and CYCLONEDDS_URI have been added to docker-compose.yaml
- Added maps directory at nav2-modular/Docker/maps. If using AMCL, place maps in this directory and it will be mounted at /ros2_ws/maps
-
Launch Simulation (Optional)
nav2 shell
ros2 launch husarion_ugv_gazebo simulation.launch.py
-
Launch Sensors
nav2 shell
ros2 launch utexas_panther sensors.launch.py
-
Launch navigation package
nav2 shell
SLAM
ros2 launch utexas_panther bringup.launch.py namespace:=panther slam:=True use_composition:=False observation_topic:=/ouster/points
AMCL
ros2 launch utexas_panther bringup.launch.py namespace:=panther slam:=False use_composition:=False observation_topic:=/ouster/points map:=/ros2_ws/maps/map.yaml