Teleoperation


In robotics, teleoperation is the action of operating a robot remotely. In these sense, teleoperation can be seen as the extension of human sensory capabilities and the ability to modify the environment by using robots. Operating robots remotely allows for the accomplishment of tasks that would otherwise put humans in risk—for example, the response to disaster scenarios and the operation of reactive disposals.

It is possible to identify five key roles in the teleoperation of a robot: the human operator; the teleoperation interface; the control and communications system; and the robot. This session focuses on the teleoperation interface; a key component that allows operators to communicate to the robot the actions it must perform.

Objective

The objective of this practical session is to implement a teleoperation interface to control the Summit-XL. The interface must translate keyboard and mouse inputs from your computer into appropriate commands for the robot. You will use this interface to drive the robot in the scenario.

General remarks

The interface that you will develop has two components: an input interface that reads the inputs of your keyboard and mouse; and software that process the inputs and produces commands to control the camera and the velocity of the robot. The first component is already given to you in the course materials, the second component is partially provided and is where you will develop your code.

You can enter the directory of this practical session by entering the commands

cd ~/catkin_ws/src/teleoperation/scripts

Execute this two extra commands to patch the scripts to run in Ubuntu 20.04

sed -i 's/python/python3/g' interface_node.py
sed -i 's/python/python3/g' teleoperation_node.py

There you will find two files: interface_node.py—the input interface; and teleoperation_node.py—the software to process the inputs and command the robot.


Exercise

Building a teleoperation interface requires to map commands that an operator can send to commands that the robot can understand. In the practical session P1.0 you drove the robot using commands introduced in the Linux terminal. In this exercise, you will send equivalent commands using your keyboard and mouse.

Launching the experiment

1 - Open a terminal and enter the directory that contains the materials for this practical session.

cd ~/catkin_ws/src/teleoperation/scripts

2 - Run the simulation in Gazebo.

roslaunch sandbox_summit_xl sandbox.launch

3 - Open a new terminal and start the visualization of the camera.

4 - Open a new terminal and run the input interface.

rosrun teleoperation interface_node.py

Experimental setup

At the beginning of the experiment, the Summit-XL is spawned in the scenario you explored in the practical session P1.0. In addition to the Gazebo interface and the window that visualizes the camera, you will see the input interface too.

Teleoperation setup

Input interface

The input interface register can register the input that you provide from the keyboard and the mouse. You can activate the interface by clicking on it. The interface works on the basis of events—that is, it registers actions you execute while the interface is active. If the interface is not active, it will not register the input you might provide.

The interface can register the following events:

1 - You press the any of the keys in the set {q,w,e,a,s,d}. The event is registered only once for each time that you press a key. If you press multiple keys, the interface will register only the last one you pressed. The interface outputs once the key that was pressed.

2 - You click in any point of the white area. The event is continuously registered if you maintain pressed the button of the mouse. At every time, the interface reports the position of the mouse with respect to the coordinate system of the input interface. The coordinate system, and the possible output for this event is shown below.

Input interface

If the mouse leaves the interface while the click button remains pressed, the interface will output the value (-1).

Teleoperation interface

Your task is to transform the information registered by the input interface into commands for the robot. The script teleoperation_node.py has been prepared to receive the information from the input interface and store in variables you can access. It also contains the variales in which you must set the output. Details are provided in the Python script.

The interface you will implement must have the functionalities indicated below.

  • Keyboard

1 - Keys {q,w,e} must position the pan of the camera at -45°, 0°, and 45°, respectively. The tilt must be set always to 12.5°.

2 - Key {s} must set the maximum linear and angular velocity of the robot to 0.

3 - Keys {a,d} must decrease and increase the maximum linear and angular velocity of the robot by 10%, respectively. That is, the input of this keys must be used to scale the maximum velocity between 0% and 100%, without considering the direction of movement of the robot.

  • Mouse

1 - After clicking in any point of the interface, the movement of the mouse must drive the movement of the robot.

2 - Up and down movements must drive the robot forward and backwards, respectively.

3 - Movements to the left and to the right must turn the robot to the left and to the right, respectively.

4 - The distance traveled by the mouse after clicking must indicate the velocity of the robot—the more you move the mouse, the faster the robot must go.

5 - The maximum velocity of the robot must be regulated by the input of the keys {a,d}.

Testing the teleoperation interface

At any time you can test your teleportation interface. Open a new terminal and enter the command

rosrun teleoperation teleoperation_node.py

If no error is reported, you can activate the input interface and try moving the robot.

If you wish to try something else, click on the terminal running the teleoperation interface and press Ctrl + C until the process stops.

After finishing the interface, try entering the football in the two goals. Is it easier to drive the robot by command lines or with your interface?

Proposed solution

A proposed solution for the exercise will be available to download after midnight.


Further readings

The following reading discusses why an how ROS can be used to develop teleoperation interfaces .

1 - Roladan, J. J. et al. (2019). Multi-robot systems, virtual reality and ROS: developing a new generation of operator interfaces.