Skip to content

6. Cartographer Setup ROS Noetic

sanket369 edited this page Aug 11, 2023 · 3 revisions

Devlopment

Running TortoiseBot on Noetic

Dependencies:

sudo apt-get install ros-noetic-map-server ros-noetic-move-base ros-noetic-navigation ros-noetic-dwa-local-planner ros-noetic-ira-laser-tools ros-noetic-teleop-twist-keyboard

Install Google-Cartographer

sudo apt-get update
sudo apt-get install -y python3-wstool python3-rosdep ninja-build stow

After the tools are installed, create a new 'carto_ws' workspace inside your existing ‘catkin_ws’.

mkdir ~/catkin_ws/carto_ws
cd ~/catkin_ws/carto_ws
wstool init src
wstool merge -t src https://raw.githubusercontent.com/cartographer-project/cartographer_ros/master/cartographer_ros.rosinstall
wstool update -t src
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y

if you face a problem, do the following:

sudo nano ~/catkin_ws/carto_ws/src/cartographer/package.xml

go to line number 46 and comment it out

<!-- <depend>libabsl-dev</depend> -->

then cd into src and clone the following repositories

git clone -b melodic-devel https://github.com/ros-perception/perception_pcl.git
git clone https://github.com/ros-perception/pcl_msgs
git clone -b noetic-devel https://github.com/jsk-ros-pkg/geometry2_python3.git

and then go back to carto_ws and run

rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
src/cartographer/scripts/install_abseil.sh

Run this from carto_ws:

catkin_make_isolated --install --use-ninja -j4 -l4

Source both the workspace in the given order:

(http:https://wiki.ros.org/catkin/Tutorials/workspace_overlaying) First source the carto_ws, Now we need to overlay the catkin_ws so delete the devel and build folder from catkin_ws and then redo catkin_make then source your main catkin_ws

source ~/catkin_ws/devel/setup.bash

Demos

  • Git Clone The Repo for Noetic
git clone -b noetic https://github.com/rigbetellabs/tortoisebot.git
  • Generating a MAP
roslaunch tortoisebot_gazebo tortoisebot_playground.launch
roslaunch tortoisebot_firmware server_bringup.launch 
roslaunch tortoisebot_slam tortoisebot_slam.launch 
  • Control the Robot and create the MAP:
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
  • Save the MAP:
rosrun map_server map_saver -f ~/map