ArNetworking: ArServerInfoRobot Class Reference

- Main Page
- Classes
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# ArServerInfoRobot Class Reference

`#include <ArServerInfoRobot.h>`

List of all members.

## Detailed Description

Server component providing basic robot status information to clients. This service accepts the following data requests:

- `update`
- `physicalInfo`
- `batteryInfo`
- `activityTimeInfo`

For bandwidth savings you should use `updateNumbers` and `updateStrings` instead of `update`.

The `update` request returns data regarding the current state of the robot. It replies with the following data packet:

1. Status (Null-terminated string)
2. Mode (Null-terminated string)
3. Battery voltage (times 10) (2 Byte integer)
4. X position (4 byte floating point number)
5. Y position (4 byte floating point number)
6. Theta (2-byte floating point number)
7. Forward velocity (2-byte integer)
8. Rotation velocity (2-byte integer)

The `updateNumbers` request returns data regarding the current state of the robot. It replies with the following data packet:

1. Battery voltage (times 10) (2 Byte integer)
2. X position (4 byte floating point number)
3. Y position (4 byte floating point number)
4. Theta (2-byte floating point number)
5. Forward velocity (2-byte integer)
6. Rotation velocity (2-byte integer)

The `updateStrings` request broadcasts data regarding the current state of the robot. Request this at -1 to get the broadcasts and an initial packet with the inital data. It replies with the following data packet:

1. Status (Null-terminated string)
2. Mode (Null-terminated string)

The `physicalInfo` request returns data regarding the physical characteristics of the robot. This information does not change during the robot execution. It replies with the following data packet:

1. Robot type (Null-terminated string)
2. Robot sub-type (Null-terminated string)
3. Robot width in mm (2 byte integer)
4. Robot front length - mm from center of rotation to front of robot (2 byte integer)
5. Robot rear length - mm from center of rotation to back of robot (2 byte integer)

The `batteryInfo` request replies with the following data packet:

1. Warning voltage (double)
2. Shutdown voltage (double)

The `activityTimeInfo` request replies with the following data packet:

1. Sec since - the ArServerMode::getActiveModeActivityTimeSecSince value (4-byte int)

These requests are in the `RobotInfo` command group.

## Public Member Functions
void | activityTimeInfo (ArServerClient *client, ArNetPacket *packet)
| The function that sends information about the time that the server mode was last active.
| ArServerInfoRobot (ArServerBase *server, ArRobot *robot)
| Constructor.
void | batteryInfo (ArServerClient *client, ArNetPacket *packet)
| The function that sends battery info about the robot off to the client.
void | physicalInfo (ArServerClient *client, ArNetPacket *packet)
| The function that sends information about the physical robot.
void | update (ArServerClient *client, ArNetPacket *packet)
| The function that sends updates about the robot off to the client.
void | updateNumbers (ArServerClient *client, ArNetPacket *packet)
| The function that sends updates about the robot off to the client.
void | updateStrings (ArServerClient *client, ArNetPacket *packet)
| The function that sends updates about the robot off to the client.
virtual | ~ArServerInfoRobot ()
| Destructor.
## Protected Member Functions
void | userTask (void)
## Protected Attributes
ArFunctor2C< ArServerInfoRobot, ArServerClient *, ArNetPacket * > | myActivityTimeInfoCB
ArFunctor2C< ArServerInfoRobot, ArServerClient *, ArNetPacket * > | myBatteryInfoCB
std::string | myMode
std::string | myOldMode
std::string | myOldStatus
ArFunctor2C< ArServerInfoRobot, ArServerClient *, ArNetPacket * > | myPhysicalInfoCB
ArRobot * | myRobot
ArServerBase * | myServer
std::string | myStatus
ArFunctor2C< ArServerInfoRobot, ArServerClient *, ArNetPacket * > | myUpdateCB
ArFunctor2C< ArServerInfoRobot, ArServerClient *, ArNetPacket * > | myUpdateNumbersCB
ArFunctor2C< ArServerInfoRobot, ArServerClient *, ArNetPacket * > | myUpdateStringsCB
ArFunctorC< ArServerInfoRobot > | myUserTaskCB

The documentation for this class was generated from the following file:

- ArServerInfoRobot.h