Skip to main content

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 OSUbuntu Server 22.04 LTSUbuntu Server 22.04 LTS
Docker version20.10.1720.10.17
Docker Compose versionv2.6.0v2.6.0
ROS packagesros-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 environmentLXQtLXQt
VPNHusarnet VPN ClientHusarnet VPN Client

Burn the chosen system image on the SD card with Etcher or Raspberry Pi Imager.

using etcher for flashing ROS system image

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.

  1. Plug in a display with HDMI, mouse and keyboard into the USB port in the rear panel of ROSbot.
  2. Turn on the robot and wait until it boots.
  3. Open Application Launcher (Husarion Logo in top-left corner) > System Tools > Terminator app.

using etcher for flashing ROS system image

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.

  1. Turn on the robot and wait until it boots.

  2. Plug in the Ethernet adapter (included in a set) to a USB port in the rear panel.

  3. Plug in one end of the Ethernet cable into your computer and another one to the adapter.

  4. 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
  5. 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 also husarion.

Connecting ROSbot to your Wi-Fi network

Find available Wi-Fi networks with this Linux command:

husarion@rosbot2r:~$ ...
nmcli dev wifi

show awailable wifi networks in linux

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:

husarion@rosbot2r:~$ ...
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:

/etc/netplan/01-network-manager-all.yaml
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:

husarion@rosbot2r:~$ ...
sudo netplan apply

You can check to which Wi-Fi network your ROSbot is connected by using this command:

husarion@rosbot2r:~$ ...
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

husarion@rosbot2r:~$ ...
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:

user@mylaptop:~$ ...
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:

user@mylaptop:~$ ...
curl https://install.husarnet.com/install.sh | sudo bash
user@mylaptop:~$ ...
sudo systemctl restart husarnet
user@mylaptop:~$ ...
sudo husarnet join PASTE_YOUR_JOIN_CODE_HERE mylaptop

Connecting your ROSbot 2R

husarion@rosbot2r:~$ ...
sudo systemctl enable husarnet
husarion@rosbot2r:~$ ...
sudo systemctl start husarnet
husarion@rosbot2r:~$ ...
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.:

user@mylaptop:~$ ...
ssh husarion@rosbot2r

After that you should see:

ROSbot terminl

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:

husarion@rosbot2r:~$ ...
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.bin
  • for 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)

ROSbot Docker image for hardware (ROS Melodic & Noetic)   ROSbot Docker image for simulation (ROS Melodic & Noetic)

To launch ROSbot node, paste the following command in the ROSbot's terminal (depending on the OS images you use):

run ROSbot's node in the 1st terminal:
husarion@rosbot2r:~$ ...
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:

husarion@rosbot2r:~$ ...
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

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:

husarion@rosbot2r:~$ ...
ros2 topic list

ROSbot with Navigation2 and Slam Toolbox

Manual ROSbot driving with teleop_twist_keyboard

Now launch a teleop_twist_keyboard ROS node for manual ROSbot control:

husarion@rosbot2r:~$ ...
ros2 run teleop_twist_keyboard teleop_twist_keyboard

After running the command, you will see the usage instruction:

ROSbot with Navigation2 and Slam Toolbox

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.

ROSbot with Navigation2 and Slam Toolbox

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:

https://github.com/husarion/rosbot-docker/tree/ros1/demo