-
This package is being created to add necessary features and improvements for our robots, specifically for ros2. This package is a ros2 porting of a indoor navigation project and implement integration with Slam and Navigation ROS2 package.
-
This package is exclusively built for ROS2. It is being tested on Ubuntu 20.04 with ROS2-Humble.
-
All the branches of this package are relative to a specific Sensor integration.
- Prerequisites
- Packages used in Dockerfile
- Image Compilation and Execution
- Usage
- What is launched with this?
- Navigation2 and Slam Toolbox Configuration
Before setting up the project, you have to install docker. If you already installed docker, go to the next session
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
# Install the Docker packages
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Add docker user
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
Then log out and log in.
- kmod
- minicom
- screen
- xacro
- rviz2
- librealsense2
- realsense2
- navigation2
- nav2-bringup
- slam-toolbox
- rmw-cyclonedds-cpp
- joint-state-publisher-gui External repositories included in this porject:
- TEB Local Planner
- Aruco Marker Pose Estimation
- Costmap Converter
- Clone the repo (complete the command)
git clone https://github.com/
- Open a terminal in the repo and source the build file
source docker_build.sh <IMAGE_NAME>
where <IMAGE_NAME> is a name for the image you want to build.
- In the terminal in the repo, source the run file
source docker_run.sh <IMAGE_NAME> <CONTAINER_NAME>
where <IMAGE_NAME> is the name of the image you have just built, while <CONTAINER_NAME> is a name for the container hosting the image.
-
The container's root password is "user" by default.
-
The container will be automatically destroyed once exited (--rm flag). If you want to attach additional terminals to the container you need to keep it running (docker_run.sh script). You can attach a new terminal by running the following command
docker exec -it $(docker ps -aqf "name=<CONTAINER_NAME>") bash
- It is recommended to check the correct time for successful image creation
- All apt-get performed inside the container will be removed one che container is closed. Please add all new dependacies to the Dockerfile and rebuild the image.
- Create a container using this project image on both rover PC an controller PC
- Set the same ROS domain ID on both rover PCs
export ROS_DOMAIN_ID=X #number
- Check if the containers times are synchronized, if not use:
sudo date --set="aa-dd-mm h:m:s.ms"
- On the robot terminal source the workspace, compile the project and source the bash.rc:
colcon build --symlink-install
source ./install/setup.bash
- Launch all the nodes on the robot via:
ros2 launch rover_bringup rover_bringup.launch
- On the controller PC terminal open rviz2
Launch files inside rover_bringup.launch: (1) The Robot Description, (2) The Robot Differential Driver, (3) Sensors Launch, and (4) SLAM and Navigation Launch.
- The Robot Description: responsible for publishing to the /tf topic and providing transforms between the base_link, base_footprint, and sensor links. Edit the URDF for your robot to define new frames or remove links
- The Robot Differential Driver: motor controller driver, responsible for interfacing with the robot and handling velocity commands and publish wheel odometry
- Sensors Launch: sensor particular launch file.
- SLAM and Navigation Launch: files to start the slam_toolbox to actuate SLAM and the nav2 pkg for the navigation stack, both files take as input a .yaml configuration file to setup the parameters.
All this launch files are available separately in the launch folder of the rover_bringup package.
It has been provided launch files and configs for Navigation2 and Slam Toolbox. They are available in the rover_bringup
package.
They can be launched with the following launch commands:
ros2 launch rover_bringup online_async_launch.py
ros2 launch rover_bringup navigation_launch.py
To change the SLAM and Navigation parameters, work on:
- mapper_params_online_async file in the confif folder.
- nav2_params file in the params folder.