Transmitting a real-time video feed from the ROSbot XL to the RViz interface on a distant computer, while operating the robot using a Logitech F710 gamepad (or a teleop twist keyboard) linked to that computer. This setup functions across the Internet using Husarnet VPN.
Note
There are two setups on two separate branches available
| branch name | description |
|---|---|
| ros2router | Running ROS 2 containers on ROSbot and on PC with the interface in RViz |
| foxglove | Running ROS 2 containers only on ROSbot with a web user interface powered by Foxglove |
For the execution of this project you need to have ROSbot XL in the Telepresence Package or Telepresence PRO Package.
It is available for purchase as a complete set at our online store.
Note
To simplify the execution of this project, we are utilizing just.
Install it with:
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sudo bash -s -- --to /usr/binTo see all available commands just run just:
husarion@rosbotxl:~/rosbot-xl-telepresence$ just
Available recipes:
connect-husarnet joincode hostname # connect to Husarnet VPN network
sync hostname="${ROBOT_NAMESPACE}" password="husarion" # Copy repo content to remote host with 'rsync' and watch for changes
flash-firmware # flash the proper firmware for STM32 microcontroller in ROSbot XL
start-rosbot # start containers on a physical ROSbot XL
start-pc # start containers on PC
run-joy # start containers on PC
run-teleop # run teleop_twist_keybaord (host)
run-teleop-docker # run teleop_twist_keybaord (inside rviz2 container)Ensure that both ROSbot XL and your laptop are linked to the same Husarnet VPN network. If they are not follow these steps:
- Setup a free account at app.husarnet.com, create a new Husarnet network, click the [Add element] button and copy the code from the Join Code tab.
- Run in the linux terminal on your PC:
cd rosbot-xl-telepresence/ # remember to run all "just" commands in the repo root folder export JOINCODE=<PASTE_YOUR_JOIN_CODE_HERE> just connect-husarnet $JOINCODE my-laptop
- Run in the linux terminal of your ROSbot:
export JOINCODE=<PASTE_YOUR_JOIN_CODE_HERE> sudo husarnet join $JOINCODE rosbotxl
Important
note that rosbotxl is a default ROSbot hostname used in this project. If you want to change it, edit the .env file and change the line:
ROBOT_NAMESPACE=rosbotxlCopy the local changes (on PC) to the remote ROSbot
just sync rosbotxl # or a different ROSbot hostname you used in Step 1 p.3Note
This just sync script locks the terminal and synchronizes online all changes made locally on the robot. rosbotxl is the name of device set in Husarnet.
To ensure proper user configuration, review the content of the .env file and select the appropriate configuration (the default options should be suitable).
LIDAR_BAUDRATE- depend on mounted LiDAR,MECANUM- wheel type,ROBOT_NAMESPACE- type your ROSbot device name the same as in Husarnet.
Important
The value of the ROBOT_NAMESPACE parameter in the .env file should be the same as the Husarnet hostname for ROSbot XL.
-
Connect to the ROSbot.
ssh husarion@rosbotxl cd rosbot-xl-autonomy[!NOTE]
rosbotxlis the name of device set in Husarnet. -
Flashing the ROSbot's Firmware.
To flash the Micro-ROS based firmware for STM32F4 microcontroller responsible for low-level functionalities of ROSbot XL, execute in the ROSbot's shell:
just flash-firmware # or just flash -
Running autonomy on ROSbot.
just start-rosbot # or just rosbot
To initiate RViz user interface, execute below command on your PC:
just start-pc
# or just pcTo control the robot from the teleop_twist_keyboard ROS 2 package run:
just run-teleop
# or just teleopRather than employing the teleop_twist_keyboard ROS 2 package, you have the option to use the Logitech F710 gamepad. To utilize it, plug it into your PC's USB port and launch the joy2twist container on your PC:
just run-joy
# or just joyTo assess the data rate of a video stream being transmitted over the Husarnet VPN (which appears in your OS as the hnet0 network interface), execute the following:
husarion@rosbot:~$ ifstat -i hnet0
wlan0
KB/s in KB/s out
6.83 2744.66
1.67 2659.88
1.02 2748.40
