ROSbot 2R - quick start
ROSbot 2R is an autonomous, open source robot platform for research and quick prototyping use cases. It can be used as a learning platform for Robot Operating System (ROS) as well as a base for a variety of robotic applications like inspection robots, custom service robots etc.
If you don't have one, you can get it here.
Unboxing
What's in the box:
- carrying case
- ROSbot 2R (with optional 3D camera and LiDAR already assembled)
- Wi-Fi 2.4GHz / 5GHz antenna
- 3x 18650 Li-Ion rechargeable batteries
- universal charger with power adapter
- charging cable
- microSD card with the software for ROSbot
- USB to Ethernet adapter
Inserting Li-ION batteries and mounting Wi-Fi antenna
Your ROSbot is assembled, but to get it ready to work, you need to provide a power supply and attach the antenna.
To mount batteries:
- turn ROSbot upside down
- unscrew battery cover mounted with two screws
- remove the battery cover
- place batteries accordingly to the symbols, keeping the black strip under the batteries
- place battery cover and mount it with screws
To charge the batteries, follow this guide.
To attach the antenna, screw it to the SMA antenna connector on the ROSbot rear panel.
Installing ROSbot's system image
Download one of these two operating system images for ROSbot 2R:
The table below contains more details about them:
ROS 2 Galactic OS image | ROS Noetic OS image | |
---|---|---|
Base OS | Ubuntu Server 22.04 LTS | Ubuntu Server 22.04 LTS |
Docker version | 20.10.17 | 20.10.17 |
Docker Compose version | v2.6.0 | v2.6.0 |
ROS packages | ros-galactic-ros-base ros-galactic-teleop-twist-keyboard | ros-noetic-ros-base ros-noetic-teleop-twist-keyboard |
Installed DDS (default bold) | rmw_fastrtps_cpp rmw_cyclonedds_cpp | - |
Graphical desktop environment | LXQt | LXQt |
VPN | Husarnet VPN Client | Husarnet VPN Client |
Burn the chosen system image on the SD card with Etcher or Raspberry Pi Imager.
Insert the SD card to the ROSbot and turn it on.
Accessing ROSbot's Linux terminal
To perform the initial network configuration, you need to access ROSbot's Linux terminal first. There are two options:
Option 1: Using display, mouse and keyboard
ROSbot is basically a computer running Ubuntu, so let's open it like a standard PC computer.
- Plug in a display with HDMI, mouse and keyboard into the USB port in the rear panel of ROSbot.
- Turn on the robot and wait until it boots.
- Open Application Launcher (Husarion Logo in top-left corner) > System Tools > Terminator app.
warning
ROSbot's graphical desktop environment requires about 3 minutes to start during first boot. The following ones require only about 1 minute after power on.
Option 2: Using an Ethernet adapter
In the ROSbot 2R set there is one USB-Ethernet card.
Turn on the robot and wait until it boots.
Plug in the Ethernet adapter (included in a set) to a USB port in the rear panel.
Plug in one end of the Ethernet cable into your computer and another one to the adapter.
Set a static IP address on your computer for its Ethernet card in a
192.168.77.0/24
subnet, eg:- IPv4:
192.168.77.27
- mask:
255.255.255.0
- IPv4:
To connect with ROSbot via ssh, type in your terminal application:
user@mylaptop:~$ ...ssh husarion@192.168.77.2
The default password for user
husarion
is alsohusarion
.
Connecting ROSbot to your Wi-Fi network
Find available Wi-Fi networks with this Linux command:
nmcli dev wifi
ROSbot 2R is using netplan instead of GUI Wi-Fi manager. It allows you to have all physical network interfaces configured from a single text file.
To connect your ROSbot to a Wi-Fi network edit /etc/netplan/01-network-manager-all.yaml
file, eg. with nano
:
sudo nano /etc/netplan/01-network-manager-all.yaml
And modify lines 31-32 by replacing PLACE_YOUR_WIFI_SSID_HERE
with your SSID (Wi-Fi network name) and PLACE_YOUR_WIFI_PASSWORD_HERE
with your Wi-Fi password:
network:
version: 2
renderer: networkd
ethernets:
# built-in Ethernet port
eth0:
dhcp4: no
dhcp6: no
addresses:
- 192.168.77.2/24
# USB Ethernet card
eth1:
dhcp4: no
dhcp6: no
addresses:
- 192.168.77.2/24
wifis:
# wlan0: # internal Raspberry Pi Wi-Fi (do not use it when the top cover is used)
# optional: true
wlan1: # external USB Wi-Fi card (with antenna)
dhcp4: true
dhcp6: true
optional: true
access-points:
"PLACE_YOUR_WIFI_SSID_HERE":
password: "PLACE_YOUR_WIFI_PASSWORD_HERE"
save the file then, apply the new network setup:
sudo netplan apply
You can check to which Wi-Fi network your ROSbot is connected by using this command:
iwgetid
If your Wi-Fi network setup is more complex (eg. if you want to connect to Eduroam based Wi-Fi that is popular in many universities), visit netplan configuration examples.
Open Linux terminal and type
ifconfig
to find your IP address (for wlan1
network interface). Save it for later.
Remote access in LAN
While ROSbot is connected to a Wi-Fi network, you can access it by using its IPv4 address by SSH:
ssh husarion@ROSBOT_IP
Remote access over the Internet (VPN)
Instead of using a local IPv4 address you can access the robot by using its hostname - both in LAN and over the Internet. You just need to setup a VPN connection (Husarnet VPN client is pre-installed)
Find the Join Code
To connect your devices to the same Husarnet VPN network you need to use the Join Code associated with that network.
You will find your Join Code in your account at https://app.husarnet.com
-> Click on the desired network
-> Add element
button
-> Join Code
tab
Connecting your laptop
Install Husarnet VPN client on your laptop:
curl https://install.husarnet.com/install.sh | sudo bash
sudo systemctl restart husarnet
sudo husarnet join PASTE_YOUR_JOIN_CODE_HERE mylaptop
Connecting your ROSbot 2R
sudo systemctl enable husarnet
sudo systemctl start husarnet
sudo husarnet join PASTE_YOUR_JOIN_CODE_HERE rosbot2r
Testing the connection
That's all - now you can use your device hostname instead of IPv4 addr, eg.:
ssh husarion@rosbot2r
After that you should see:
ROSbot ROS packages
At this stage you should have your ROSbot up and running, with remote (LAN or VPN) connection from your laptop.
You can run ROSbot's ROS packages natively on your ROSbot's host OS, by just cloning and building rosbot_ros repo, however the more convenient way is using Docker images for that.
Pulling the ROSbot docker image
Access your ROSbot's terminal and run:
docker pull husarion/rosbot:noetic
note
There is also a version for ROS Melodic: to pull it, just replace noetic
with melodic
tag
Flashing the firmware
Both husarion/rosbot:noetic
and husarion/rosbot:melodic
docker images include corresponding firmware for STM32F4 (a low level microcontroller that controls motors, GPIO ports and TOF distance sensors).
To flash the right firmware, open ROSbot's terminal and execute one of the following command (if you use ROS noetic tag):
for differential drive (regular wheels):
husarion@rosbot2r:~$ ...docker run --rm -it --privileged \
husarion/rosbot:noetic \
/flash-firmware.py /root/firmware_diff.binfor omnidirectional wheeled ROSbot (mecanum wheels):
husarion@rosbot2r:~$ ...docker run --rm -it --privileged \
husarion/rosbot:noetic \
/flash-firmware.py /root/firmware_mecanum.bin
Running the ROSbot Docker image (host mode)
To launch ROSbot node, paste the following command in the ROSbot's terminal (depending on the OS images you use):
- ROS 2 Galactic OS image
- ROS Noetic OS image
docker run --rm -it \
--device /dev/ttyAMA0 \
--network host \
-e SERIAL_PORT=/dev/ttyAMA0 \
-e ROS_IP=127.0.0.1 \
-e ROS_MASTER_URI=http://127.0.0.1:11311 \
husarion/rosbot:noetic \
roslaunch rosbot_bringup rosbot_docker.launch
and ROS 1 bridge in the 2nd terminal:
docker run --rm -it \
--network host \
--ipc host \
-e ROS_IP=127.0.0.1 \
-e ROS_MASTER_URI=http://127.0.0.1:11311 \
-e ROS_DOMAIN_ID \
-e RMW_IMPLEMENTATION \
husarion/ros:galactic-ros1-bridge \
ros2 run ros1_bridge dynamic_bridge
run ROSbot's node in the new terminal:
docker run --rm -it \
--device /dev/ttyAMA0 \
--network host \
-e SERIAL_PORT=/dev/ttyAMA0 \
-e ROS_IP=127.0.0.1 \
-e ROS_MASTER_URI=http://127.0.0.1:11311 \
husarion/rosbot:noetic \
roslaunch rosbot_bringup rosbot_docker.launch
Because we run ROSbot's Docker image with --network host
, ROS nodes from the container are available on the level of the host operating system.
Open the second terminal and check available ROS topics:
- ROS 2 Galactic OS image
- ROS Noetic OS image
ros2 topic list
rostopic list
Manual ROSbot driving with teleop_twist_keyboard
Now launch a teleop_twist_keyboard
ROS node for manual ROSbot control:
- ROS 2 Galactic OS image
- ROS Noetic OS image
ros2 run teleop_twist_keyboard teleop_twist_keyboard
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
After running the command, you will see the usage instruction:
Autonomous navigation demo
Now you know how to access ROSbot's ROS node from the Linux terminal.
Running ROS natively is fine for relatively small projects. For more complex ones, the full dockerized setup is a better approach.
We have created a reference project to show you how to run autonomous mapping and navigation on ROSbot using Navigation2 and SLAM Toolbox. Everything is Docker based, so running it is straightforward.
Open Source GitHub Demo
Controlling ROSbot running Navigation2 and SLAM Toolbox from Rviz running on your laptop.
The demo project contains ROSbot's ROS 1 node, but all others are ROS 2 nodes. Thanks to Docker combining ROS and ROS 2 nodes in the single system is easy and transparent.
Both setups for physical ROSbot and its Gazebo simulation are available.
Find the full demo here: