Dashboard client example
This example shows how to use the builtin Dashboard server to communicate with a robot.
Note
The Dashboard Server is only available on CB3 and e-Series robots. It is not available on PolyScope X.
The dashboard_example.cpp shows how to use this class:
Note
For the following example to work on an e-Series (PolyScope 5) robot, the robot has to be in remote control mode.
At first, a DashboardClient object is created with the IP address of the robot. Then, the
client is connected to the robot. After that, the client sends a command to the robot and receives
the answer.
Some commands support getting the response from the robot. For example, the
commandPolyScopeVersion() function:
The DashboardClient can easily be used to cycle through the robot’s states, for example for
initialization:
All commands are blocking and will wait for the necessary action being done. The dashboard server’s
response will be compared with an expected response. For example, when calling
commandPowerOn(timeout), it is checked that the dashboard server is answering "Powering on" and
then it is queried until the robot reports "Robotmode: IDLE" or until the timeout is reached.
The example contains more commands that follow the same scheme.
If you want to send a query / command to the dashboard server and only want to receive the
response, you can use the sendAndReceive() function:
For checking the response against an expected regular expression use sendRequest():