It has been some time since I’ve posted to the weblog, however recently 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 sequence:
The newest ROS2 launch got here out only a few weeks in the past. ROS2 Humble targets Ubuntu 22.04 and can be a long run help (LTS) launch, that means that each the underlying Ubuntu working system and the ROS2 launch get a full 5 years of help.
Since putting in working techniques on robots is commonly 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 adjustments to the low-level ROS2 APIs as issues are getting extra secure and mature. For some greater stage packages, akin to MoveIt2 and Navigation2, the story is a bit totally different.
One of many good issues concerning 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 creating in ROS1, which means you in all probability don’t need to improve all of your computer systems fairly but. Whereas my robotic now runs Ubuntu 22.04, my desktop remains to be operating 18.04.
Due to this fact, 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 fascinating, however thus far it’s probably not an RVIZ substitute – they seem like extra targeted on offline information visualization.
I then moved onto operating
rviz2 inside a docker setting – which works properly when utilizing the rocker software:
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
As a way to correctly visualize and work together with my UBR-1 robotic, I wanted so as to add the
ubr1_description package deal to my workspace with a view to get the meshes and likewise my rviz configurations. To perform this, I wanted to create my very own docker picture. I largely primarily based it off the underlying ROS docker photographs:
# 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
&& rm -rf /var/lib/apt/lists/*
# construct ubr code
RUN . /decide/ros/$ROS_DISTRO/setup.sh
&& colcon construct
# setup entrypoint
COPY ./ros_entrypoint.sh /
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.
# setup ros2 setting
supply “/decide/workspace/set up/setup.bash”
exec “[email protected]“
I might then create the docker picture and run rviz inside it:
docker construct -t ubr:essential
sudo rocker --net=host --x11 ubr:essential 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 often 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 help and the brand new Apple M1 silicon (and Apple’s varied 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 – nevertheless it’s a bit restricted on Mac. The MacOSX setting doesn’t permit opening the required ports, so the direct ROS2 matter streaming doesn’t work and you must use rosbridge. I discovered I used to be in a position to visualize sure subjects, however that switching between subjects often broke.
At this level, I used to be about to surrender, till I observed 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 (Word: 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 isn’t any arm64 desktop installer, so you must 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 general 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.
Word: 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 previous 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 have 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 matter 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 a variety of updates have been required simply to get the system began. I then made a extra detailed cross by 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 most recent ROS1 code since a variety of enhancements have occurred prior to now yr since I had initially ported to ROS2.
There are nonetheless a variety of 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.