robotont / robotont_demos

This repository is a ROS package that contains various demos showing the capabilities of the Robotont platform
Apache License 2.0
0 stars 1 forks source link

robotont_demos

This repository is a ROS package that contains various demos showing the capabilities of the Robotont platform

Build Status License

Before you begin

To run the demos it is necessary to have a Robotont robot and a user PC with Ubuntu Linux and ROS Noetic installed.

There are two approaches to get the Robotont and PC into the same ROS environment. A common prerequisite for both methods is that the hosts are connected to the same network. In the following examples, we assume the Robotont and the PC having the following configuration:

Machine Hostname IP-address
Robotont robotont-1 192.168.1.1
PC laptop-1 192.168.1.101

Method 1: Hostname based setup

In this configuration, the robot and PC query each other via hostnames. It means that both hosts need to have each other's names associated with IP addresses. These hostname <--> IP pairs are defined in the /etc/hosts file. Use your favorite text editor and make sure the following entries exist.

/etc/hosts on Robotont on-board computer:

127.0.1.1 robotont-1
192.168.1.101 laptop-1

/etc/hosts on PC:

127.0.1.1 laptop-1
192.168.1.1 robotont-1

Next, we need to tell the PC to look for a ROS Master on Robotont. We do that by modifying a special environment variable named ROS_MASTER_URI, which by default points to localhost.

on PC, open a terminal and enter:

export ROS_MASTER_URI=http://robotont-1:11311

Now all ROS nodes you run in this terminal will connect to the Master on the Robotont. Test it with e.g. rosnode list. Note that the environment variable has to be set for each terminal window! To make it automatic, you can add the line to the end of the .bashrc file in the home directory of the PC:

echo 'export ROS_MASTER_URI=http://robotont-1:11311' >> ~/.bashrc

Method 2: IP-address based setup

If you want to configure IP based communication there is no need to edit the hosts file. Instead, a ROS_IP environmental variable has to be set on both sides:

on Robotont on-board computer:

export ROS_IP=192.168.200.1

on PC:

export ROS_MASTER_URI=http://192.168.200.1:11311
export ROS_IP=192.168.200.101

Similarly to the hostname based setup, append the commands to .bashrc to set the variables automatically.

3D mapping

Prerequisites on Robotont on-board computer

This dependency can be obtained from apt by entering the following commands:

sudo apt update
sudo apt install ros-noetic-rtabmap-ros

Launching the demo

On Robotont on-board computer, launch 3d_mapping.launch

roslaunch robotont_demos 3d_mapping.launch

On PC, launch 3d_mapping_display.launch to visualize the result

roslaunch robotont_demos 3d_mapping_display.launch

2D mapping

Prerequisites installed on the Robotont on-board computer

To install gmapping, enter the following commands:

sudo apt update
sudo apt install ros-noetic-gmapping

Launching the demo

On Robotont on-board computer

Start the 2D SLAM:

roslaunch robotont_demos 2d_slam.launch

If hector_slam or cartographer have been installed in Robotont, one can select a different method with a mapping_method argument. For example, to use the default gmapping:

roslaunch robotont_demos 2d_slam.launch mapping_method:=gmapping

On PC, visualize the result in RViz with:

roslaunch robotont_demos 2d_slam_display.launch

AR tracking

Prerequisites installed on the Robotont on-board computer

Launching the demo

On Robotont on-board computer, launch ar_follow_the_leader.launch (change 5 with the AR tag number you intend to follow)

roslaunch robotont_demos ar_follow_the_leader.launch marker_id:=5

On PC, launch ar_marker_display.launch to visualize the result

roslaunch robotont_demos ar_marker_display.launch