SLAM project with Duckietown for Intelligent Robotics (M.EIC041), FEUP.
catkin_workspace
: ROS workspace for the ORB SLAM 3 ROS packagesrc
: ROS packagesduckie_bot_pkg
: ROS package for a translator from CompressedImage to Imageduckie_sim_pkg
: ROS package for the DuckieTown Gym Simulator, with a script to publish images from the simulator to a ROS topicorb_slam3_ros
: ROS package for ORB-SLAM 3
assets
: Assets used in the projectlib
: Libraries used in the projectgym-duckietown
: DuckieTown Gym Simulator
- python==3.8
- Ubuntu==20.04.6
- Running
xhost + local:docker
on host machine (for GUI support)
From the root directory of the repo:
./setup_sim.sh
Follow the instructions in the ROS Noetic Website. Make sure to also install dependencies for package building.
sudo apt install -y python3-catkin-tools
As in the orb_slam3_ros repository:
-
Install dependencies:
sudo apt install -y libeigen3-dev libopencv-dev ros-noetic-rviz
-
Install Pangolin:
cd ~ git clone --recursive https://github.com/stevenlovegrove/Pangolin.git cd Pangolin # Next command requires you to confirm the installation of dependencies sudo ./scripts/install_prerequisites.sh recommended mkdir build && cd build cmake .. make sudo make install
-
Verify OpenCV is installed (required at least 3.0):
pip3 install opencv-python python3 -c "import cv2; print(cv2.__version__)"
-
(Optional) Hector trajectory server
sudo apt install -y ros-[DISTRO]-hector-trajectory-server
From the root directory of the repo, build the ROS
workspace:
source /opt/ros/noetic/setup.bash
cd catkin_workspace
rosdep install --from-paths src --ignore-src -r -y
catkin build # This will most likely fail the first time, if it does, run the next line
# catkin build -j1
In a terminal:
source /opt/ros/noetic/setup.bash
cd catkin_workspace
source devel/setup.bash
roslaunch orb_slam3_ros duckie_sim.launch
In another terminal:
source /opt/ros/noetic/setup.bash
cd catkin_workspace
source devel/setup.bash
rosrun duckie_sim_pkg ros_script.py
docker buildx build -f Dockerfile.orbslam3 -t orbslam3 .
docker buildx build -f Dockerfile.duckiesim -t duckiesim .
docker run --rm -t --net=host ros:noetic roscore
# Allow docker to access the host's display
xhost + local:docker
docker run --gpus all --rm -it --ipc=host --net=host --privileged \
--env="DISPLAY=unix$DISPLAY" \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
--runtime=nvidia \
duckiesim
# Allow docker to access the host's display
xhost + local:docker
# Run the ORB SLAM 3 container
docker run --gpus all --rm -it --ipc=host --net=host --privileged \
--env="DISPLAY=unix$DISPLAY" \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
--runtime=nvidia \
orbslam3
docker buildx build -f Dockerfile.orbslam3 -t orbslam3 .
docker buildx build -f Dockerfile.duckiebot-translator -t duckiebot-translator .
docker run --rm --net=host \
-e ROS_MASTER_URI=http://pato.local:11311 \
duckiebot-translator
# Allow docker to access the host's display
xhost + local:docker
# Run the ORB SLAM 3 container
docker run --gpus all --rm -it --ipc=host --net=host --privileged \
--env="DISPLAY=unix$DISPLAY" \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
--runtime=nvidia \
-e ROS_MASTER_URI=http://pato.local:11311 \
orbslam3
# Start the line following demo
dts duckiebot demo --demo_name lane_following --duckiebot_name pato
# Start the keyboard control demo with the line following control
dts dts duckiebot keyboard_control pato