TurtleBot2 on ROS2 Humble

asked 2023-04-17 08:58:36 -0500

Djinn gravatar image

updated 2023-04-17 10:44:31 -0500

Hello, I am fairly new to ROS and currently trying to use ROS2 Humble on a TurtleBot2. I am using Ubuntu 22.04 and built Humble from source and also cloned https://github.com/igrak34/TurtleBot2... in cd ~/tb2_ros2_nav2/src. Afterwards I have used @ljaniec setup but have some questions and problems I would like to ask/share.

ROS 2 setup after installation (https://docs.ros.org/en/galactic/Inst...)

echo "source/opt/ros/humble/setup.bash" >> ~/.bashrc

sudo apt install python3-colcon-common-extensions

echo "source/usr/share/colcon_cd/function/colcon_cd.sh">> ~/.bashrc

echo "export _colcon_cd_root=/opt/ros/humble/" >> ~/.bashrc

echo "source/usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash">> ~/.bashrc

So my first question is, how is it possible to use the debian galactic installation which is supported by Ubuntu 20.04 but source with humble? How can you link those two distributions?

sudo apt install ros-galactic-navigation2
sudo apt install ros-galactic-nav2-bringup
sudo apt install ros-galactic-turtlebot3*
sudo apt install ros-humble-turtle*
export TURTLEBOT3_MODEL=waffle
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/humble/share/turtlebot3_gazebo/models

I have installed these binaries using the same command line except that I have exchanged the distribution to humble in every command. Using

ros2 launch nav2_bringup tb3_simulation_launch.py

to test also worked. Is it necessary to export the model and gazebo model path since I am working with a TurtleBot2 and not a TurleBot3.

cd ~/tb2_ros2_nav2/ros2_ws/

sudo rosdep install -i --from-path src --rosdistro galactic -y

sudo rosdep install (with distro change to humble) wasn't working and it kept telling me "ERROR: your rosdep installation has not been initialized yet. Please run:

rosdep update

so I used rosdep update but still was not able to use sudo rosdep install afterwards.

colcon build --symlink-install

I tried to build the kobuki packages but got the problem that ecl_command_line is missing which is a part of ecl_core and thus not supported by humble. How can I bypass this problem?

Thank you in advance and if someone has a different setup which works for Humble and the TurtleBot2 please share it.

edit retag flag offensive close merge delete

Comments

At sudo apt install ros-galactic-.......... you should try changing galactic to humble because you are using that version if it's compatible then the install should go fine. I ever tried turtlebot3 by replacing foxy with humble and it worked, hope it helps you some.

PRA008 gravatar image PRA008  ( 2023-04-17 14:01:44 -0500 )edit

Thank you for your answer! I‘ve already changed the distribution to humble for every sudo apt ros-galactic so it seems like that wasn’t the problem.

Djinn gravatar image Djinn  ( 2023-04-17 14:07:23 -0500 )edit
1

I made a mistake with Ctr+C & Ctrl+V in my instructions (I had two versions, for galactic and humble). It should be humble everywhere. Please update the commands in the question. From the errors you got - you have to have rosdep init before the rosdep update, I forgot about it, because I had it initialized before.

ljaniec gravatar image ljaniec  ( 2023-04-17 17:13:02 -0500 )edit

I already used rosdep init before whenever I type rosdep init this comes:

  • ERROR: default sources list file already exists
    • /etc/ros/rosdep/sources.list.d/20-default.list
    • Please delete if you wish to re-initialize

I also tried using rosdep install -i --from-path src --rosdistro humble -y instead of sudo rosdep install -i --from-path src --rosdistro humble -y which led to this warning:

  • ERROR: the following packages/stacks could not have their rosdep keys resolved to system dependencies:
  • kobuki_node: Cannot locate rosdep definition for [ecl_sigslots]
  • kobuki_core: Cannot locate rosdepdefinition for [ecl_time]
  • kobuki_auto_docking: Cannot locate rosdep definition for [ecl_linear_algebra]

So I have checked here whether those are available for humble and they were not. How do you get those packages for humble?

Is it possible that its not working because I built from source and not with debian?

Djinn gravatar image Djinn  ( 2023-04-18 06:43:25 -0500 )edit
1

Did you clone the Kobuki packages? I built them from sources. Please refer to this GitHub issue regarding the ECL and Sophus problems: https://github.com/kobuki-base/kobuki... I don't exactly remember what was needed, but it is possible for sure.

ljaniec gravatar image ljaniec  ( 2023-04-18 07:00:23 -0500 )edit

Yes, I have followed your setup step by step (cloned them into cd ~/tb2_ros2_nav2/ros2_ws/src). I tried cloning this humble-test fork of ecl_core into cd ~/tb2_ros2_nav2/ros2_ws/src where the kobuki packages are but the following error appeared:

Djinn gravatar image Djinn  ( 2023-04-18 07:18:16 -0500 )edit

Hi! I've been trying to get this all running in a docker container, and am experiencing the same issue as Djinn.
https://gist.github.com/Victor4X/3478b7d51b6b8c5b15d66e8d2357a757
The only thing I've changed from your original instructions is on line 19 in the Dockerfile. Installing everything related to "turtle*" felt excessive, and took a very long time.

Either way, the error I am getting is the same as Djinn:

updated cache in /root/.ros/rosdep/sources.cache
ERROR: the following packages/stacks could not have their rosdep keys resolved to system dependencies:
kobuki_auto_docking: Cannot locate rosdep definition for [ecl_linear_algebra]
kobuki_core: Cannot locate rosdep definition for [ecl_time]
kobuki_node: Cannot locate rosdep definition for [ecl_sigslots]

Victor4X gravatar image Victor4X  ( 2023-04-18 08:52:04 -0500 )edit

I have cloned all necessary packages and rosdep install -i --from-path src --rosdistro humble -y was successful but colcon build --symlink-install revealed that the sophus package had some errors so I have opened an issue and hope that after the problems are solved the colcon build will be successfull. I will keep you updated. Thank you very much for your help!

Djinn gravatar image Djinn  ( 2023-04-18 10:14:39 -0500 )edit