In this post we will document how we can install ROS Noetic and TurtleBot3 packages on Ubuntu 20.04.
Install ROS Noetic
You may follow the steps in the official documentation and note that ros-noetic-desktop-full
is recommended. One good thing about ros installation is we can verify it. After ros is installed, you may follow the steps in Understanding ROS Topics to run a TurgleSim
programm.
Install TurtleBot3 packages.
The installation of TurtleBot3 packages can be tricky. There are different ways to install the TurtleBot3 packages and you may find many posts that document the steps online. The official TurttleBot3 documentation is based on Ubuntu 18.04 and ROS Dashing Diademata and it proposes to use the following commands for the installation:
mkdir -p ~/turtlebot3_ws/src cd ~/turtlebot3_ws wget https://raw.githubusercontent.com/ROBOTIS-GIT/turtlebot3/ros2/turtlebot3.repos vcs import src < turtlebot3.repos colcon build --symlink-install
colcon
and the structure of the turtle3 repos.
cd ~/catkin_ws/src git clone https://github.com/ROBOTIS-GIT/turtlebot3.git git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git git clone https://github.com/ROBOTIS-GIT/turtlebot3_autorace.git cd .. rosdep install --from-paths src -i -y catkin_make source ~/catkin_ws/devel/setup.bash rospack profileThere are two differences between this approach and the official one:
- The build tool is different. In this approach we use
catkin_make
. - The repos structure is different. If you use the approach mentioned in the TurtleBot3 official document, you may get a different repos structure after you import the
turtlebot3.repos
.
catkin_make
command can be executed with the following repo structure:
./src ├── CMakeLists.txt -> /opt/ros/noetic/share/catkin/cmake/toplevel.cmake ├── turtlebot3 ├── turtlebot3_bringup ├── turtlebot3_msgs ├── turtlebot3_navigation ├── turtlebot3_simulations │ ├── turtlebot3_fake │ ├── turtlebot3_gazebo │ └── turtlebot3_simulations ├── turtlebot3_slam └── turtlebot3_teleop#### Trouble Shooting One of the difficulties I had when installing the TurtleBot3 packages is the package dependencies. The package dependency is specified in the
CMakeLists.txt
file in each package. For expample you may find the following code in a CMakeLists.txt
file:
find_package(catkin REQUIRED COMPONENTS rospy geometry_msgs )This means the current package depends on rospy and geometry_msgs. Note that these two packages are ros packages. In order to install a specific ros package, you could use the following command:
sudo apt install ros-noetic-<package-name>To find the missing ros package name, you could use the command below. For exmple if the build failed due to the missing rospy package, we could exectue
apt search ros-noetic | grep -i rospyThe output of the above command will provide a hint on the name of the missing ros pcakge.
----- END -----
©2019 - 2023 all rights reserved