UBR-1 on ROS2 Humble – Robohub


It has been some time since I’ve posted to the weblog, however currently I’ve truly been engaged on the UBR-1 once more after a considerably lengthy hiatus. In case you missed the sooner posts on this collection:

ROS2 Humble

The newest ROS2 launch got here out only a few weeks in the past. ROS2 Humble targets Ubuntu 22.04 and can also be a long run assist (LTS) launch, that means that each the underlying Ubuntu working system and the ROS2 launch get a full 5 years of assist.

Since putting in working methods on robots is usually a ache, I solely use the LTS releases and so I needed to migrate from the earlier LTS, ROS2 Cunning (on Ubuntu 20.04). General, there aren’t many modifications to the low-level ROS2 APIs as issues are getting extra secure and mature. For some increased stage packages, comparable to MoveIt2 and Navigation2, the story is a bit completely different.


One of many good issues in regards to the ROS2 Cunning launch was that it focused the identical working system as the ultimate ROS1 launch, Noetic. This allowed customers to have each ROS1 and ROS2 put in side-by-side. Should you’re nonetheless creating in ROS1, meaning you in all probability don’t wish to improve all of your computer systems fairly but. Whereas my robotic now runs Ubuntu 22.04, my desktop continues to be working 18.04.

Subsequently, I needed to discover a method to visualize ROS2 information on a pc that didn’t have the most recent ROS2 put in. Initially I attempted the Foxglove Studio, however didn’t have any luck with issues truly connecting utilizing the native ROS2 interface (the rosbridge-based interface did work). Foxglove is actually attention-grabbing, however to date it’s not likely an RVIZ alternative – they look like extra centered on offline information visualization.

I then moved onto working rviz2 inside a docker atmosphere – which works nicely when utilizing the rocker device:

sudo apt-get set up python3-rocker
sudo rocker --net=host --x11 osrf/ros:humble-desktop rviz2

In case you are utilizing an NVIDIA card, you’ll want so as to add --nvidia together with --x11.

With a purpose to correctly visualize and work together with my UBR-1 robotic, I wanted so as to add the ubr1_description bundle to my workspace to be able to get the meshes and in addition my rviz configurations. To perform this, I wanted to create my very own docker picture. I largely based mostly it off the underlying ROS docker pictures:

ARG WORKSPACE=/decide/workspace

FROM osrf/ros:humble-desktop

# set up construct instruments
RUN apt-get replace && apt-get set up -q -y –no-install-recommends
&& rm -rf /var/lib/apt/lists/*

# get ubr code
RUN git clone https://github.com/mikeferguson/ubr_reloaded.git
&& contact ubr_reloaded/ubr1_bringup/COLCON_IGNORE
&& contact ubr_reloaded/ubr1_calibration/COLCON_IGNORE
&& contact ubr_reloaded/ubr1_gazebo/COLCON_IGNORE
&& contact ubr_reloaded/ubr1_moveit/COLCON_IGNORE
&& contact ubr_reloaded/ubr1_navigation/COLCON_IGNORE
&& contact ubr_reloaded/ubr_msgs/COLCON_IGNORE
&& contact ubr_reloaded/ubr_teleop/COLCON_IGNORE

# set up dependencies
RUN . /decide/ros/$ROS_DISTRO/setup.sh
&& apt-get replace && rosdep set up -q -y
–from-paths src
&& rm -rf /var/lib/apt/lists/*

# construct ubr code
RUN . /decide/ros/$ROS_DISTRO/setup.sh
&& colcon construct

# setup entrypoint
COPY ./ros_entrypoint.sh /

ENTRYPOINT [“/ros_entrypoint.sh”]
CMD [“bash”]

The picture derives from humble-desktop after which provides the construct instruments and clones my repository. I then ignore the vast majority of packages, set up dependencies after which construct the workspace. The ros_entrypoint.sh script handles sourcing the workspace configuration.

set -e

# setup ros2 atmosphere
supply “/decide/workspace/set up/setup.bash”
exec $@

I might then create the docker picture and run rviz inside it:

docker construct -t ubr:principal
sudo rocker --net=host --x11 ubr:principal rviz2

The total supply of those docker configs is within the docker folder of my ubr_reloaded repository. NOTE: The up to date code within the repository additionally provides a late-breaking change to make use of CycloneDDS as I’ve had quite a few connectivity points with FastDDS that I’ve not been in a position to debug.

Visualization on MacOSX

I additionally ceaselessly need to have the ability to work together with my robotic from my Macbook. Whereas I beforehand put in ROS2 Cunning on my Intel-based Macbook, the scenario is kind of modified now with MacOSX being downgraded to Tier 3 assist and the brand new Apple M1 silicon (and Apple’s numerous different locking mechanisms) making it more durable and more durable to setup ROS2 immediately on the Macbook.

As with the Linux desktop, I attempted out Foxglove – nonetheless it’s a bit restricted on Mac. The MacOSX atmosphere doesn’t enable opening the required ports, so the direct ROS2 subject streaming doesn’t work and you need to use rosbridge. I discovered I used to be in a position to visualize sure matters, however that switching between matters ceaselessly broke.

At this level, I used to be about to surrender, till I seen that Ubuntu 22.04 arm64 is a Tier 1 platform for ROS2 Humble. I proceeded to put in the arm64 model of Ubuntu inside Parallels (Observe: I used to be low-cost and initially tried to make use of the VMWare know-how preview, however was unable to get the installer to even boot). There are just a few tips right here as there is no such thing as a arm64 desktop installer, so you need to set up the server version after which improve it to a desktop. There’s a detailed description of this workflow on askubuntu.com. Putting in ros-humble-desktop from arm64 Debians was completely simple.

rviz2 runs comparatively fast contained in the Parallels VM, however total it was not fairly as fast or secure as utilizing rocker on Ubuntu. Nonetheless, it’s very nice to have the ability to do some ROS2 growth when touring with solely my Macbook.

Migration Notes

Observe: every of the hyperlinks on this part is to a commit or PR that implements the mentioned modifications.

Within the core ROS API, there are solely a handful of modifications – and most of them are literally merely fixing potential bugs. The logging macros have been up to date for safety functions and require c-strings just like the outdated ROS1 macros did. Moreover the macros are actually higher at detecting invalid substitution strings. Ament has additionally gotten higher at detecting lacking dependencies. The updates I made to robot_controllers present simply what number of bugs had been caught by this extra strict checking.

image_pipeline has had some minor updates since Cunning, primarily to enhance consistency between plugins and so I wanted to replace some subject remappings.

Navigation has probably the most updates. amcl mannequin kind names have been modified because the fashions are actually plugins. The API of costmap layers has modified considerably, and so various updates had been required simply to get the system began. I then made a extra detailed go by the documentation and discovered just a few extra points and enhancements with my config, particularly across the conduct tree configuration.

I additionally determined to do a correct port of graceful_controller to ROS2, ranging from the most recent ROS1 code since various enhancements have occurred prior to now yr since I had initially ported to ROS2.

Subsequent steps

There are nonetheless various new options to discover with Navigation2, however my rapid focus goes to shift in direction of getting MoveIt2 setup on the robotic, since I can’t simply swap between ROS1 and ROS2 anymore after upgrading the working system.

Michael Ferguson


Please enter your comment!
Please enter your name here