Install ROS 2 Galactic with Create 3 Messages on an Ubuntu 20.04 Machine
Before you start
These directions should work on a machine natively running Ubuntu1 20.04, as well as in a virtualized container within another operating system. Note that there might be some network setup required if in a virtualized container; for example, RMWs seem to like running in a bridged network configuration rather than a NATted one.
These directions follow Open Robotics' official documentation on Installing ROS 2 on Ubuntu Linux, and more detailed information about what the commands below do can be found there.
Important
Some single board computers may have board specific instructions that differ from the step-by-step process outlined below. These instructions are available for the NVIDIA® Jetson™ and Raspberry Pi® 4.
Step-by-step
-
If you haven't already, download and install Ubuntu® Server 20.04 64-bit onto your machine.
-
Once logged in, check to ensure that you are using a UTF-8 locale by typing
echo $LANG
and ensuring "UTF-8" is at the end of the returned string.
-
Execute the following blocks of commands to install ROS 22:
sudo apt update && sudo apt install -y curl gnupg2 lsb-release build-essential git cmake
then
sudo curl -ksSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null sudo apt update && sudo apt install -y ros-galactic-ros-base python3-colcon-common-extensions python3-rosdep ros-galactic-rmw-fastrtps-cpp ros-galactic-rmw-cyclonedds-cpp ros-galactic-irobot-create-msgs
finally
echo "source /usr/share/colcon_cd/function/colcon_cd.sh" >> ~/.bashrc echo "export _colcon_cd_root=/opt/ros/galactic/" >> ~/.bashrc echo "source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash" >> ~/.bashrc echo "source /opt/ros/galactic/setup.bash" >> ~/.bashrc
-
At this point, we recommend setting your default RMW (ROS 2 middleware). The RMW you set here has to match the RMW on your robot, which can be found from its Application Configuration page. More detail on RMW can be found here. Right now, the Create® 3 robot supports
rmw_cyclonedds_cpp
andrmw_fastrtps_cpp
. The default for Galactic isrmw_cyclonedds_cpp
. Depending on your robot's RMW implementation, type one of the following:echo "export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp" >> ~/.bashrc
or
echo "export RMW_IMPLEMENTATION=rmw_fastrtps_cpp" >> ~/.bashrc
-
Finally, either log out and log back in, or simply
source ~/.bashrc
-
If both your computer and robot are on the same network, you should now be able to test things out with a
ros2 topic list
. If this does not work, please refer to ROS 2 Network Configuration for further configuration ideas. A full Create® 3 API description can be found here.