For this workshop specifically:
You don’t have to worry about the whole process of setting up ROS, installing the code base, getting environment setup, sourcing the right files, etc. as the web software we will be using, ConstructSim, gives you the space pre-built with everything ready to go. Start from the note after Step 2.
Many visualization tools from this workshop will load and run on Guacamole inside your ROSject, which is a Remote Desktop that emulates the software. This will be more clear in a bit.
Though ROS1 exists, upgrades for ROS1 have stopped and ROS2 is being continuously improved with newer versions released every year. Different ROS2 versions lose support over time so it is important to keep everything up-to-date. However, switching between versions of ROS2 is very easy. Switching from ROS1 to ROS2 or vice versa takes a very very very long time.
System Requirements
To get started with ROS, you will need to have a UNIX-shell based operating system, such as Ubuntu, Mac OS, Debian, Arch Linux, etc. (though there are workarounds for Windows, about 99% of support and development is for and on UNIX-based operating systems). Ubuntu is the most widely used OS for ROS development.
Ubuntu Version | ROS2 Version | Support |
---|---|---|
18.04 | Rolling Ridley | Rolling Dev Release, No longer supported |
20.04 | Foxy Fitzroy | Support will stop this year |
20.04 | Galactic Geochelone | No longer Supported |
22.04 | Humble Hawksbill | Current Most Active Support |
22.04 | Iron Irwini | Latest, Recent Active Support |
Installing ROS2 Humble
No-one explains ROS setup better than ROS docs themselves, so if you ever have to do so:
Ubuntu (Debian packages) — ROS 2 Documentation: Humble documentation
IF YOU ARE USING ConstructSim, (which will be the case if you are live for the workshop)
Follow this to open your ROSject (ROS Project on ConstructSim) for this workshop.
Login at https://app.theconstructsim.com/login
Navigate to My ROSjects
under Develop in the left tabs list.
Create New ROSject
→ Select ROS2 Humble
as your ROS Distro, Give it a name and a Description and Run it
Your ROSject should now be running - notice the timer in the bottom (it should be 07:59 or close to that if this is your first time running it today), that’s the amount of time you have left to work on that ROSject today. ConstructSim ROSjects are a free service and they limit how much you can use their servers.
Checking Install - Running basic Examples
Now that you have ROS installed, you want to make sure that the install happened the correct way and that you can use ROS packages as expected.
Before you start, let’s update the installation candidate that you’re working with.
sudo apt update
First, you want to source the ROS environment to make sure it exists:
source /opt/ros/jazzy/setup.bash
This should just run with no output and errors.
Now enter just ros2
in the terminal and check if shows a bunch of ros2 information and commands. Just typing ros2
should give you the following output in the terminal:
usage: ros2 [-h] [--use-python-default-buffering] Call `ros2 <command> -h` for more detailed usage. ...
ros2 is an extensible command-line tool for ROS 2.options:
-h, --help show this help message and exit
--use-python-default-buffering
Do not force line buffering in stdout and instead use the python default buffering, which might
be affected by PYTHONUNBUFFERED/-u and depends on whatever stdout is interactive or not
Commands:
action Various action related sub-commands
bag Various rosbag related sub-commands
component Various component related sub-commands
control Various control related sub-commands
daemon Various daemon related sub-commands
doctor Check ROS setup and other potential issues
interface Show information about ROS interfaces
launch Run a launch file
lifecycle Various lifecycle related sub-commands
multicast Various multicast related sub-commands
node Various node related sub-commands
param Various param related sub-commands
pkg Various package related sub-commands
run Run a package specific executable
security Various security related sub-commands
service Various service related sub-commands
topic Various topic related sub-commands
wtf Use `wtf` as alias to `doctor`
Call `ros2 <command> -h` for more detailed usage.
In your current terminal, enter:
ros2 run demo_nodes_cpp talker
Leave that terminal open, now open a new terminal, and enter:
ros2 run demo_nodes_py listener
You should see the talker
saying that it’s Publishing
messages and the listener
saying Iheard
those messages. (Subscribing
)
Similarly, try the following:
Terminal 1:
ros2 run turtlesim turtlesim_node
# this should open turtlesim on a pop-up window of Guacamole
Terminal 2:
ros2 run turtlesim turtle_teleop_key
# when your cursor is in this terminal and you use your arrow keys,
# you should be able to control the turtle in 2D
Create package:
ros2 pkg create --build-type ament_python <pkg_name>