Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages | Examples

ArServerInfoRobot Class Reference

Server component providing basic robot status information to clients. More...

#include <ArServerInfoRobot.h>

List of all members.

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.
virtual ~ArServerInfoRobot ()
 Destructor.

Protected Attributes

ArFunctor2C< ArServerInfoRobot,
ArServerClient *, ArNetPacket * > 
myActivityTimeInfoCB
ArFunctor2C< ArServerInfoRobot,
ArServerClient *, ArNetPacket * > 
myBatteryInfoCB
ArFunctor2C< ArServerInfoRobot,
ArServerClient *, ArNetPacket * > 
myPhysicalInfoCB
ArRobotmyRobot
ArServerBasemyServer
ArFunctor2C< ArServerInfoRobot,
ArServerClient *, ArNetPacket * > 
myUpdateCB


Detailed Description

Server component providing basic robot status information to clients.

This service accepts the following data requests:

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 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.

Examples:

drawingsExampleWithRobot.cpp, popupExample.cpp, serverDemo.cpp, and simpleServerExample.cpp.

Definition at line 81 of file ArServerInfoRobot.h.


Constructor & Destructor Documentation

ArServerInfoRobot::ArServerInfoRobot ArServerBase server,
ArRobot robot
 

Constructor.

Definition at line 32 of file ArServerInfoRobot.cpp.

References ArServerBase::addData(), myActivityTimeInfoCB, myBatteryInfoCB, myPhysicalInfoCB, myRobot, myServer, and myUpdateCB.

ArServerInfoRobot::~ArServerInfoRobot  )  [virtual]
 

Destructor.

Definition at line 67 of file ArServerInfoRobot.cpp.


Member Function Documentation

void ArServerInfoRobot::activityTimeInfo ArServerClient client,
ArNetPacket packet
 

The function that sends information about the time that the server mode was last active.

Definition at line 153 of file ArServerInfoRobot.cpp.

References ArBasePacket::byte4ToBuf(), client, ArRobot::lock(), myRobot, ArClientBase::sendPacketTcp(), and ArRobot::unlock().

void ArServerInfoRobot::batteryInfo ArServerClient client,
ArNetPacket packet
 

The function that sends battery info about the robot off to the client.

Definition at line 107 of file ArServerInfoRobot.cpp.

References client, ArNetPacket::doubleToBuf(), ArRobotConfigPacketReader::getLowBattery(), ArRobot::getOrigRobotConfig(), ArRobotConfigPacketReader::getShutdownVoltage(), ArRobotConfigPacketReader::hasPacketArrived(), ArRobot::lock(), myRobot, ArClientBase::sendPacketTcp(), and ArRobot::unlock().

void ArServerInfoRobot::physicalInfo ArServerClient client,
ArNetPacket packet
 

The function that sends information about the physical robot.

Definition at line 136 of file ArServerInfoRobot.cpp.

References ArBasePacket::byte2ToBuf(), client, ArRobot::getRobotLengthFront(), ArRobot::getRobotLengthRear(), ArRobot::getRobotSubType(), ArRobot::getRobotType(), ArRobot::getRobotWidth(), ArRobot::lock(), myRobot, ArClientBase::sendPacketTcp(), ArBasePacket::strToBuf(), and ArRobot::unlock().

void ArServerInfoRobot::update ArServerClient client,
ArNetPacket packet
 

The function that sends updates about the robot off to the client.

Definition at line 71 of file ArServerInfoRobot.cpp.

References ArBasePacket::byte2ToBuf(), ArBasePacket::byte4ToBuf(), client, ArRobot::getBatteryVoltage(), ArServerMode::getMode(), ArRobot::getRealBatteryVoltage(), ArRobot::getRotVel(), ArServerMode::getStatus(), ArRobot::getTh(), ArRobot::getVel(), ArRobot::getX(), ArRobot::getY(), ArRobot::lock(), myRobot, ArClientBase::sendPacketUdp(), ArBasePacket::strToBuf(), and ArRobot::unlock().


Member Data Documentation

ArFunctor2C<ArServerInfoRobot, ArServerClient *, ArNetPacket *> ArServerInfoRobot::myActivityTimeInfoCB [protected]
 

Definition at line 103 of file ArServerInfoRobot.h.

Referenced by ArServerInfoRobot().

ArFunctor2C<ArServerInfoRobot, ArServerClient *, ArNetPacket *> ArServerInfoRobot::myBatteryInfoCB [protected]
 

Definition at line 101 of file ArServerInfoRobot.h.

Referenced by ArServerInfoRobot().

ArFunctor2C<ArServerInfoRobot, ArServerClient *, ArNetPacket *> ArServerInfoRobot::myPhysicalInfoCB [protected]
 

Definition at line 102 of file ArServerInfoRobot.h.

Referenced by ArServerInfoRobot().

ArRobot* ArServerInfoRobot::myRobot [protected]
 

Definition at line 98 of file ArServerInfoRobot.h.

Referenced by activityTimeInfo(), ArServerInfoRobot(), batteryInfo(), physicalInfo(), and update().

ArServerBase* ArServerInfoRobot::myServer [protected]
 

Definition at line 97 of file ArServerInfoRobot.h.

Referenced by ArServerInfoRobot().

ArFunctor2C<ArServerInfoRobot, ArServerClient *, ArNetPacket *> ArServerInfoRobot::myUpdateCB [protected]
 

Definition at line 100 of file ArServerInfoRobot.h.

Referenced by ArServerInfoRobot().


The documentation for this class was generated from the following files:
Generated on Tue Feb 20 10:51:51 2007 for ArNetworking by  doxygen 1.4.0