Robot CLI Client
Difficulty: Easy
Duration: 5 minutes
Prerequisites: Configure SSH Access / Experiment CLI Client
Description: This document shows how to use the Robot CLI Tool utility on the SSH frontend. You will learn, how to get infomation about robots trajectories, and after submit an experiment, how you could interact with robots and launch commands to get status or update mobility.
First step
Connect to frontend SSH and get the help :
my_computer$ ssh <login>@<site>.iot-lab.info <login>@<site>:~$ iotlab-robot -h usage: iotlab-robot [-h] [-u USERNAME] [-p PASSWORD] [-v] [--jmespath JMESPATH] [--format FORMAT] {status,update,get} ... ...
If you didn’t authenticate using iotlab-auth, do it now, replace <login> with your IoT-LAB login:
<login>@<site>:~$ iotlab-auth -u <login>
Get circuits
Firstly you need to know predefined circuits declared in the testbed. To get this list execute:
<login>@<site>:~$ iotlab-robot get -l { "grenoble": [ { "coordinates": { "0": { "theta": 0, "x": 43.71, "y": 26.4 }, "1": { "theta": 3.14, "x": 62.51, "y": 26.4 } }, "loop": true, "name": "circuit1", "points": [ "0", "1" ], "site": "grenoble", "type": "predefined" }, ...
Fot each site, you will have a list of predefined circuits. Each circuit is defined by a set of points the robot will reach successively, in a loop if this paramater is at a true value
Then you will be able to specify a circuit for your mobile node while submiting an experiment, by adding a mobility argument to the resources list:
<login>@<site>:~$ iotlab-experiment submit -d 20 -n robot_mobility -l lille,m3,258,mobility=square1
Status command
Once your experiment is running, you will be able to check the status of robots. Use of arguments is identical to other CLI clients: you don’t need to use the -i
option if you have only one experiment running, and if you don’t specify a -l
option it will return result for all your nodes of your running experiment.
<login>@<site>:~$ iotlab-robot status -l lille,m3,258 { "0": { "m3-258.lille.iot-lab.info": { "bookable": false, "position": { "theta": -1.6028136988227362, "x": 3.9351276319399218, "y": 2.115901876101309 }, "power": { "battery_level": "high", "kobuki_battery_source": "None", "kobuki_percentage": "88.4848", "laptop_battery_status": "OK", "laptop_percentage": 99, "robot_battery_status": "Healthy" }, "robot_state": "GOING_POINT" } } }
The JSON response contains:
- its position, with x, y in meters and theta in radians
- power indicators, regarding the robot base and the embedded laptop
- a bookable indicator, always false when an experiment is running, true when the robot is not used, docked and batteries enough charged
- and the current state of the robot in the state machine
Update mobiliy
During an experiment, you can update the circuit of the robot:
<login>@<site>:~$ iotlab-robot update -l lille,m3,258 lille,triangle