Dashboard client example

This example shows how to use the builtin Dashboard server to communicate with a robot.

Note

The Dashboard Server euqivalent for PolyScope X is called the Robot API. In the client library it is accessed through the DashboardClient, as well, as it is meant as a replacement for the Dashboard Server. It doesn’t offer full feature parity at the time of writing and is available only from Software 10.11.0 on.

The dashboard_example.cpp shows how to use this class:

Note

For the following example to work, the robot has to be in remote control mode. CB3 robots don’t require that.

At first, a DashboardClient object is created with the IP address of the robot and a DashboardClient implementation policy. That policy can be either POLYSCOPE_X or G5. To generalize this, the robot’s sofware version is queried using the primary interface beforehand. 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: