Setup
In this page you will find the information on how to set up your system for this HIL project. For this step you need the Husarion ROSBot 2, your computer and access to an active network.
Last updated
In this page you will find the information on how to set up your system for this HIL project. For this step you need the Husarion ROSBot 2, your computer and access to an active network.
Last updated
To get started, first you need to create a connection between the Husarion ROSbot 2 and your computer, so they can both access the same running ROS system.
1.a) Connect through WiFi
Connect both your computer and your robot to the same WiFi network.
For more information about how to connect to a WiFi network with an Ubuntu system, visit:
For more information about how to connect to a wifi network with the Husarion ROSbot 2, visit:
1.b) Connect with UTP cables
In case you don't have an available WiFi network, or the connection speed is too slow, you can use UTP cables to connect the robot and your computer to the same network.
For the next steps, you will need to know the IP address of both your computer and your robot. You can check the IP address for example by typing the following command in a terminal window:
Note: At this step it is important to have a correctly set-up network. If not done so there could be significant problems when trying to access the robot or with the ROS communication.
You can start this container directly on your computer or you can start it using the Asimovo platform. In case of the former, make sure you have docker with GPU support set up on your computer.
To build the container image, download the file linked above, go to the folder where this file is located, then use the command docker build . -t hil_setup_noetic_foxy
. This builds a container image with the name hil_setup_noetic_foxy
.
Further in this tutorial it will be assumed that you are working inside this container. To access a running container from other terminal windows you can use the command docker exec -it hil_setup_noetic_foxy /bin/bash
.
This feature is under development. Please come back later for more information.
You can use SSH to access the ROSbot from the container.
Enter the following command in a terminal of your running container to connect: ssh husarion@<ROSbot IP address>
For example if the IP address of your ROSbot is 192.168.103.76 then the connection command will look like: ssh husarion@192.168.103.76
After connecting, the system will ask you for a password. For the Husarion ROSbot 2 used in this project the password is husarion
.
The user should be the same in both the container and in the husarion rosbot's ssh-d terminals. For simplicity, in this tutorial the root user is used in both. You can use the sudo su
command to switch to the sudo user in th Husarion ROSbot ssh'd terminals. In the container by default the root the user is set.
For the ROS1 specific elements to work, you will need to set the following environmental variables:
You can do so by using the following commands:
For example if the IP address of your ROSbot is 192.168.103.76 and the IP address of your running container (in case of using the --net=host
option the P address of your computer) is 192.168.103.85, furthermore, we want to run ROS master on the ROSbot with the port 46335, then the commands above will look like:
On Husarion ROSbot 2:
On your locally running container :
Additionally you also need to modify the /etc/hosts
file in both the ROSbot and in the container, by adding the IP address and hostname of the computer (provided if the --net=host
setting is on when launching the container) and the ROSbot. This means adding the following lines:
For example if the IP address of your ROSbot is 192.168.103.76 and the IP address of your computer (provided if the --net=host
setting is on when launching the container) is 192.168.103.85, then on the Husarion ROSbot 2 you need to add the following two lines to the file /etc/hosts
:
and on your computer:
You're all set up. Now you can start with the HIL project of your choosing.
The Asimovo platform utilizes a container based setup. In this tutorial one of the simulation images of Asimovo will be used. The Dockerfile describing this image is available .
For more information about how to do so, visit: and for Nvidia GPU: .
For more information about Dockerfiles, visit:
After the build is complete you can use the run.sh script that is available to start a container instance.
For more information about ssh connections visit: .
As mentioned before, the Husarion ROSbot 2 has ROS1 Noetic installed, while the container has both ROS2 Foxy and ROS1 Noetic. To create a connection between the two ROS versions, the will be used, that is also installed in the container.
For more information about bashrc visit:
For more information about network setup with multiple machines for ROS1, visit: