It has been some time since I’ve posted to the weblog, however recently I’ve really been engaged on the UBR-1 once more after a considerably lengthy hiatus. In case you missed the sooner posts on this sequence:
ROS2 Humble
The most recent ROS2 launch got here out only a few weeks in the past. ROS2 Humble targets Ubuntu 22.04 and can 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 programs 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). Total, there aren’t many adjustments to the low-level ROS2 APIs as issues are getting extra steady and mature. For some greater degree packages, corresponding to MoveIt2 and Navigation2, the story is a bit completely different.
Visualization
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. For those who’re nonetheless growing in ROS1, meaning you most likely 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 operating 18.04.
Due to this fact, I needed to discover a method to visualize ROS2 knowledge on a pc that didn’t have the newest ROS2 put in. Initially I attempted the Foxglove Studio, however didn’t have any luck with issues really connecting utilizing the native ROS2 interface (the rosbridge-based interface did work). Foxglove is actually attention-grabbing, however to this point it’s not likely an RVIZ substitute – they look like extra centered on offline knowledge visualization.
I then moved onto operating rviz2
inside a docker atmosphere – which works effectively when utilizing the rocker software:
sudo apt-get set up python3-rocker
sudo rocker --net=host --x11 osrf/ros:humble-desktop rviz2
If you’re 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 with the intention to get the meshes and likewise 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 photographs:
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
python3-colcon-common-extensions
git-core
&& rm -rf /var/lib/apt/lists/*
# get ubr code
ARG WORKSPACE
WORKDIR $WORKSPACE/src
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
ARG WORKSPACE
WORKDIR $WORKSPACE
RUN . /decide/ros/$ROS_DISTRO/setup.sh
&& apt-get replace && rosdep set up -q -y
–from-paths src
–ignore-src
&& rm -rf /var/lib/apt/lists/*
# construct ubr code
ARG WORKSPACE
WORKDIR $WORKSPACE
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.
#!/bin/bash
set -e
# setup ros2 atmosphere
supply “/decide/workspace/set up/setup.bash”
exec “$@“
I may then create the docker picture and run rviz inside it:
docker construct -t ubr:predominant
sudo rocker --net=host --x11 ubr:predominant 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 regularly 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 sort of modified now with MacOSX being downgraded to Tier 3 assist and the brand new Apple M1 silicon (and Apple’s varied different locking mechanisms) making it more durable and more durable to setup ROS2 straight on the Macbook.
As with the Linux desktop, I attempted out Foxglove – nevertheless it’s a bit restricted on Mac. The MacOSX atmosphere doesn’t permit 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 regularly 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 (Be aware: I used to be low cost and initially tried to make use of the VMWare expertise preview, however was unable to get the installer to even boot). There are a couple of 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 straightforward.
rviz2
runs comparatively fast contained in the Parallels VM, however general it was not fairly as fast or steady as utilizing rocker
on Ubuntu. Nevertheless, it’s very nice to have the ability to do some ROS2 improvement when touring with solely my Macbook.
Migration Notes
Be aware: every of the hyperlinks on this part is to a commit or PR that implements the mentioned adjustments.
Within the core ROS API, there are solely a handful of adjustments – 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 at the moment are 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 for the reason that fashions at the moment are plugins. The API of costmap layers has modified considerably, and so numerous updates had been required simply to get the system began. I then made a extra detailed move via the documentation and discovered a couple of 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 newest ROS1 code since numerous enhancements have occurred previously yr since I had initially ported to ROS2.
Subsequent steps
There are nonetheless numerous new options to discover with Navigation2, however my instant focus goes to shift in the 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