ROSJect installing ROS packages via apt & updates

Hello,

I have been preparing a ROSJect to share with my class (and also for various testing) using ROS2 Humble. I am trying to use the Husarion ROSbot (GitHub - husarion/rosbot_ros: ROS packages for ROSbot 2, 2R and 2 PRO) gazebo simulation using Husarion provided launch files.

I’m having trouble with the packages in the default ROSJect, and trying to install additional packages. I need to:

  • Install some additional ROS2 packages (such as ign-ros2-control, find-object-2d, plus a few others)
  • Update the existing packages to the latest versions in apt (the default installed ones are about a year old and don’t have some required elements to run Husarion’s examples)

Last year I seem to recall that I do both of the above in a ROSJect and it would save the state. However, now, every time I relaunch the rosject I have to reinstall everything. Is there a better solution to the above, or something obvious that I am missing?

Thank you.

Hell @time_wiley

Unfortunately, user-installed and updated packages are not persisted at this time. They have to be installed every time.

That said, there’s a workaround to make things a bit easier:

Create a Bash script named course_install.sh in /home/user and put all your install commands there.

  • For the first time, execute this script to install your packages.
  • The next time you come back to the rosject, this script will be executed automatically (and your packages will be installed/updated).

Hi @bayodesegun ,

Ok. Thank you for the response.
Is it possible to get the base humble packages ROSJect updated to the current ubuntu packages? This would save a lot of time.

Also, for this install script:

  • Do I just put the apt commands?
  • Is there feedback to the user on how long the install is taking?

This is possible but might break other rosjects using the same distro, so the best approach is to update these only for the rosject that needs it.

  • Yes, just put the install or setup commands in the order you want them executed (for sudo apt-get install commands, don’t forget to put sudo apt-get update -y first). Here is a sample script.
#!/bin/bash

install_simulation_dependencies() {
    sudo apt update
    sudo apt install -y ros-humble-controller-manager
    sudo apt install -y ros-humble-ros2-control
    sudo apt install -y ros-humble-gazebo-ros*
    sudo apt install -y ros-humble-controller-manager
    sudo apt install -y ros-humble-hardware-interface
}

# Call the function to execute the commands
install_simulation_dependencies
  • Yes, there’s visual feedback in the terminals when the script is being executed.

Hi @time_wiley,

If you have just a few packages to install, the solution proposed by @bayodesegun does the job.

You said:

such as ign-ros2-control, find-object-2d, plus a few others

Could you tell us which are the packages that you need to install?

If you need to do an upgrade in the humble base itself every time that you open the rosject, I think this may be a frustrating experience if it takes too much time.

If you tell us the list of packages, we can see how long it takes.

If it takes too much time, we can possibly upgrade the base like we did for you a year ago.

In summary:

  1. If you have just a few packages, you can create the ~/course_install.sh as proposed by Bayode.
  2. If you see that it takes too much time to install everything every time you open a rosject, we can possibly update the base and install the packages you need.

Hello @bayodesegun and @ralves ,

Thank you for your replies. I’ve been trialing various combinations of packages to install. Aside from the manually additional packages, it’s still a little unclear to me what packages are causing problems. In short, trying to use a launch file from the nav2_common package causes a C++ traits lookup issue. But I’ve yet to track down the ROS2 humble package causing the issue. However, upgrading the ROS2 install resolves the issue, so it’s one of the packages!

Hi Tim,
let us implement for you the updated ROS2 base system for projects.
We’ll let you know when ready

Hi @rtellez, and all,

That’s very kind. I don’t want to cause problems if it will break other rosjects / projects.

The course_install.sh script does seem to be doing the job for now, albeit with a bit of waiting.

Regards,
Tim

Not a problem at all! Those are things that make our platform improve and provide to you guys the tools that are really useful for you.
Do not hesitate to suggest, request, advice about other things that you may need or find useful. We will do our best to make your life easier in that sense!

Thank you for trusting us for your teachings!

Hi @time_wiley,

we already have the new Humble base with ROS Humble upgraded. Things worth knowing:

  1. Your existing rosjects will still use the old image.
  2. To use the new upgraded base, you just have to create a new ROS Humble rosject.

The new base already contains ros-humble-ign-ros2-control and ros-humble-find-object-2d, as we can see in the image below. Please let us know how your tests on the new base go:

1 Like

Hello @ralves ,

Thank you.
I haven’t yet had a chance to look at the new base ROSJect. I hope to do so in a few days and will report back.

1 Like

Hello @ralves ,

I have tested the new ROSject for Humble today, and everything seems to be functional. Thank you all for the assistance.

1 Like

Awesome, @time_wiley.

Thank you for your feedback.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.