Robotics StackExchange | Archived questions

TurtleBot2 on ROS2 Humble

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-on-ROS2 in cd ~/tb2ros2nav2/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/colconcd/function/colconcd.sh">> ~/.bashrc

echo "export colconcd_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 TURTLEBOT3MODEL=waffle
export GAZEBO
MODELPATH=$GAZEBOMODELPATH:/opt/ros/humble/share/turtlebot3gazebo/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 nav2bringup tb3simulation_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 ~/tb2ros2nav2/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 eclcommandline 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.

Asked by Djinn on 2023-04-17 08:58:36 UTC

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.

Asked by PRA008 on 2023-04-17 14:01:44 UTC

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.

Asked by Djinn on 2023-04-17 14:07:23 UTC

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.

Asked by ljaniec on 2023-04-17 17:13:02 UTC

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?

Asked by Djinn on 2023-04-18 06:43:25 UTC

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_ros/issues/41#issuecomment-1186729600 I don't exactly remember what was needed, but it is possible for sure.

Asked by ljaniec on 2023-04-18 07:00:23 UTC

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:

Asked by Djinn on 2023-04-18 07:18:16 UTC

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]

Asked by Victor4X on 2023-04-18 08:52:04 UTC

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!

Asked by Djinn on 2023-04-18 10:14:39 UTC

So I have not received an answer yet, if you have some spare time could you take a glance at the issue @ljaniec . Did you have this problem?

Asked by Djinn on 2023-04-19 08:11:24 UTC

@Djinn I fixed this temporarily by commenting out ecl_enable_cxx_warnings() in cmakelists.txt in kobuki_core.
With sed:

sed -i 's/ecl_enable_cxx_warnings()/#ecl_enable_cxx_warnings()/g' src/kobuki_core/CMakeLists.txt

Asked by Victor4X on 2023-04-19 14:02:02 UTC

@Victor4X was colcon build --symlink-install successful afterwards? What about the command ros2 turtlebot2_bringup turtlebot_bringup.launch.py, was it working? Thank you for your answer!

Asked by Djinn on 2023-04-20 08:01:40 UTC

And did you have those issues with compiling the kobuki_core packages or the ecl_linear_algebra packages like me?

Asked by Djinn on 2023-04-20 08:16:21 UTC

I had the same issues as you I am pretty sure. They are resolved in the Dockerfile, however.
colcon build --symlink-install was successful, but ros2 turtlebot2_bringup turtlebot_bringup.launch.py says that turtlebot2_bringup isn't a valid command. I haven't had the time to actually look at how to use the turtlebot now. I just went to bed after getting the dependencies to build properly.. What would you suggest I try?
If you are comfortable with docker, I would love for you to mess around with it as well. gist

Asked by Victor4X on 2023-04-20 09:53:33 UTC

Since there is no undo for the sed command I will wait for my professors approval. I'll keep you updated!

Asked by Djinn on 2023-04-20 10:25:09 UTC

Just wanted to come in and say that I got everything working, and updated the gist with instructions :)

Asked by Victor4X on 2023-05-01 09:05:58 UTC

@Victor4X I have just looked into your gist. First of all thank you very much for sharing ! Have you tried using the ros launch turtlebot2_bringup turtlebot_bringup.launch.py command or rather cloned the Turtlebot2 on ROS2 packages?

Asked by Djinn on 2023-05-02 06:55:55 UTC

Answers