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

ArServerHandlerCamera Class Reference

Accepts and processes camera pan/tilt/zoom requests from the client, and provides information about the camera (such as its current position). More...

#include <ArServerHandlerCamera.h>

Inheritance diagram for ArServerHandlerCamera:

ArCameraCollectionItem List of all members.

Public Member Functions

virtual void addToCameraCollection (ArCameraCollection &collection)
 ArServerHandlerCamera (ArServerBase *server, ArRobot *robot, ArPTZ *camera)
 This constructor is maintained for backwards compatibility.
 ArServerHandlerCamera (const char *cameraName, ArServerBase *server, ArRobot *robot, ArPTZ *camera, ArCameraCollection *collection)
void camera (ArServerClient *client, ArNetPacket *packet)
 Handles the camera network packet, with information stored as byte integers.
void cameraAbs (ArServerClient *client, ArNetPacket *packet)
 Handles the cameraAbs network packet, with information stored as byte integers.
void cameraInfo (ArServerClient *client, ArNetPacket *packet)
 Handles the cameraInfo network packet, with information returned as byte2 integers.
void cameraModeLookAtGoal (void)
 Puts the camera into a mode where it will look at the goal.
void cameraModeLookAtGoalClearGoal (void)
 Clears the goal for the camera mode that points at the goal.
void cameraModeLookAtGoalSetGoal (ArPose pose)
 Sets the goal for the camera mode that points at the goal.
void cameraModeLookAtPoint (ArPose pose)
 Puts the camera into a mode where it will look at a point.
void cameraModePosition (void)
 Puts the camera in position mode.
void cameraPct (ArServerClient *client, ArNetPacket *packet)
 Handles the cameraPct network packet, with information stored as byte integers.
void cameraUpdate (ArServerClient *client, ArNetPacket *packet)
 Handles the cameraUpdate network packet, with information returned as byte2 integers.
const char * getCameraName ()
void handleCameraModeUpdated (ArServerClient *client, ArNetPacket *packet)
 Refer to handleSetCameraMode for a description of the supported modes and the various packet structures.
void handleGetCameraData (ArServerClient *client, ArNetPacket *packet)
void handleGetCameraInfo (ArServerClient *client, ArNetPacket *packet)
void handleGetCameraModeList (ArServerClient *client, ArNetPacket *packet)
void handleResetCamera (ArServerClient *client, ArNetPacket *packet)
void handleSetCameraAbs (ArServerClient *client, ArNetPacket *packet)
void handleSetCameraMode (ArServerClient *client, ArNetPacket *packet)
 The following modes are currently supported: Position: The user controls the camera position; no additional parameters in the packet LookAtGoal: The robot automatically points the camera in the direction of its destination goal; no additional parameters in the packet LookAtPoint: The robot "looks" at a specified point in the map; the packet contains: byte4, the x coordinate; byte4, the y coordinate.
void handleSetCameraPct (ArServerClient *client, ArNetPacket *packet)
void handleSetCameraRel (ArServerClient *client, ArNetPacket *packet)
void resetCamera (bool lockRobot=true)
 Resets the camera.
void setCameraAbs (double pan, double tilt, double zoom, bool lockRobot=true)
 Sends the camera absolute commands to the camera (and puts it in position mode).
void setCameraPct (double panPct, double tiltPct, bool lockRobot=true)
 Sends the camera percent commands to the camera (and puts it in position mode).
void setCameraRel (double pan, double tilt, double zoom, bool lockRobot=true)
 Sends the camera relative commands to the camera (and puts it in position mode).
virtual ~ArServerHandlerCamera ()
 Destructor.

Protected Types

enum  { DOUBLE_FACTOR = 100 }
enum  CameraMode { CAMERA_MODE_POSITION, CAMERA_MODE_LOOK_AT_GOAL, CAMERA_MODE_LOOK_AT_POINT }

Protected Member Functions

void addDoubleToPacket (double val, ArNetPacket &packet)
 The "double" value is really a 2-byte integer multiplied by the DOUBLE_FACTOR.
void buildModePacket (void)
double getCurrentZoomRatio ()
 Gets the current camera zoom as a ratio of its zoom range.
double getDoubleFromPacket (ArNetPacket &packet)
 The "double" value is really a 2-byte integer multiplied by the DOUBLE_FACTOR.
double getZoomRange ()
 Gets the range of the camera's zoom.
double getZoomRatio (double absZoom)
 Converts the given absolute zoom value to a ratio of the camera's zoom range.
void userTask (void)

Protected Attributes

ArPTZmyCamera
 Camera that is controlled.
ArFunctor2C< ArServerHandlerCamera,
ArServerClient *, ArNetPacket * > 
myCameraAbsCB
ArFunctor2C< ArServerHandlerCamera,
ArServerClient *, ArNetPacket * > 
myCameraCB
ArCameraCollectionmyCameraCollection
 Pointer to the camera collection (if any).
ArFunctor2C< ArServerHandlerCamera,
ArServerClient *, ArNetPacket * > 
myCameraInfoCB
CameraMode myCameraMode
std::map< CameraMode, std::string > myCameraModeNameMap
ArNetPacket myCameraModePacket
std::string myCameraName
 Unique name of the associated camera.
ArFunctor2C< ArServerHandlerCamera,
ArServerClient *, ArNetPacket * > 
myCameraUpdateCB
std::map< std::string, ArFunctor2<
ArServerClient *, ArNetPacket * > * > 
myCommandToCBMap
 Map of ArCameraCommand names to the callback that handles the packet.
std::map< std::string, int > myCommandToIntervalMap
 Map of ArCameraCommand names to the preferred default request interval.
std::map< std::string, std::string > myCommandToPacketNameMap
 Map of ArCameraCommand names to a unique network packet name.
ArPose myGoal
bool myGoalAchieved
bool myGoalAchievedLast
bool myGoalResetZoom
ArPose myLookAtPoint
ArMutex myModeMutex
bool myPointResetZoom
ArRobotmyRobot
 Associated robot (primarily used for locking).
ArServerBasemyServer
 Server from which requests are received.
ArFunctorC< ArServerHandlerCameramyUserTaskCB

Detailed Description

Accepts and processes camera pan/tilt/zoom requests from the client, and provides information about the camera (such as its current position).

The following requests are accepted. Arguments and return values are stored in the packet as signed 16-bit values. (They are converted to double-precision floating point values when received by dividing by 100; to store floating point values, multiply by 100 first: packet.byte2ToBuf((ArTypes::Byte2)(100.0 * doubleVal)); or see also getDoubleFromPacket() and addDoubleToPacket().)

Each request name is suffixed by the name of the camera to control.

In addition, some older camera commands are accepted for partial backwards compatability with old clients: cameraUpdate, cameraInfo, cameraAbs, camera, and cameraPct. (However, these commands cannot be used in a multi-camera configuration.)

These requests are in a user permission group called CameraControl.

Examples:

serverDemo.cpp.

Definition at line 75 of file ArServerHandlerCamera.h.


Member Enumeration Documentation

anonymous enum [protected]
 

Enumeration values:
DOUBLE_FACTOR  Multiplier for putting/getting "double" values to/from a packet.

Definition at line 268 of file ArServerHandlerCamera.h.

enum ArServerHandlerCamera::CameraMode [protected]
 

Enumeration values:
CAMERA_MODE_POSITION 
CAMERA_MODE_LOOK_AT_GOAL 
CAMERA_MODE_LOOK_AT_POINT 

Definition at line 379 of file ArServerHandlerCamera.h.


Constructor & Destructor Documentation

ArServerHandlerCamera::ArServerHandlerCamera const char *  cameraName,
ArServerBase server,
ArRobot robot,
ArPTZ camera,
ArCameraCollection collection
 

Parameters:
cameraName the unique char * name of the associated camera
server the ArServerBase * used to send/receive requests
robot the associated ArRobot *
camera the ArPTZ * that provides access to the actual camera
collection the ArCameraCollection * to which to add the camera command information; if NULL, then addToCameraCollection() must be called manually.

Definition at line 70 of file ArServerHandlerCamera.cpp.

ArServerHandlerCamera::ArServerHandlerCamera ArServerBase server,
ArRobot robot,
ArPTZ camera
 

This constructor is maintained for backwards compatibility.

It will not work in a multi-camera configuration.

Deprecated:
Parameters:
server the ArServerBase * used to send/receive requests
robot the associated ArRobot *
camera the ArPTZ * that provides access to the actual camera

Definition at line 47 of file ArServerHandlerCamera.cpp.

ArServerHandlerCamera::~ArServerHandlerCamera  )  [virtual]
 

Destructor.

Definition at line 109 of file ArServerHandlerCamera.cpp.

References myCommandToCBMap.


Member Function Documentation

void ArServerHandlerCamera::addDoubleToPacket double  val,
ArNetPacket packet
[inline, protected]
 

The "double" value is really a 2-byte integer multiplied by the DOUBLE_FACTOR.

Definition at line 276 of file ArServerHandlerCamera.h.

References DOUBLE_FACTOR.

Referenced by handleGetCameraData(), and handleGetCameraInfo().

void ArServerHandlerCamera::addToCameraCollection ArCameraCollection collection  )  [virtual]
 

Parameters:
collection the ArCameraCollection to which to add the camera commands

Implements ArCameraCollectionItem.

Definition at line 509 of file ArServerHandlerCamera.cpp.

void ArServerHandlerCamera::buildModePacket void   )  [protected]
 

Definition at line 1221 of file ArServerHandlerCamera.cpp.

References ArBasePacket::byte4ToBuf(), CAMERA_MODE_LOOK_AT_POINT, ArNetPacket::empty(), ArPose::getX(), ArPose::getY(), myCameraMode, myCameraModeNameMap, myCameraModePacket, myLookAtPoint, and ArBasePacket::strToBuf().

Referenced by cameraModeLookAtGoal(), cameraModeLookAtPoint(), and cameraModePosition().

void ArServerHandlerCamera::camera ArServerClient client,
ArNetPacket packet
 

Handles the camera network packet, with information stored as byte integers.

Definition at line 642 of file ArServerHandlerCamera.cpp.

References setCameraRel().

void ArServerHandlerCamera::cameraAbs ArServerClient client,
ArNetPacket packet
 

Handles the cameraAbs network packet, with information stored as byte integers.

Definition at line 657 of file ArServerHandlerCamera.cpp.

References setCameraAbs().

void ArServerHandlerCamera::cameraInfo ArServerClient client,
ArNetPacket packet
 

Handles the cameraInfo network packet, with information returned as byte2 integers.

Definition at line 708 of file ArServerHandlerCamera.cpp.

References ArBasePacket::byte2ToBuf(), ArBasePacket::byteToBuf(), ArPTZ::canZoom(), client, ArPTZ::getMaxNegPan(), ArPTZ::getMaxNegTilt(), ArPTZ::getMaxPosPan(), ArPTZ::getMaxPosTilt(), ArRobot::lock(), myCamera, myRobot, ArMath::roundInt(), ArClientBase::sendPacketUdp(), and ArRobot::unlock().

void ArServerHandlerCamera::cameraModeLookAtGoal void   ) 
 

Puts the camera into a mode where it will look at the goal.

Definition at line 1252 of file ArServerHandlerCamera.cpp.

References ArServerBase::broadcastPacketTcp(), buildModePacket(), CAMERA_MODE_LOOK_AT_GOAL, ArMutex::lock(), ArLog::log(), myCameraMode, myCameraModePacket, myCommandToPacketNameMap, myGoalAchieved, myGoalAchievedLast, myGoalResetZoom, myModeMutex, myServer, and ArMutex::unlock().

Referenced by handleSetCameraMode().

void ArServerHandlerCamera::cameraModeLookAtGoalClearGoal void   ) 
 

Clears the goal for the camera mode that points at the goal.

Definition at line 1302 of file ArServerHandlerCamera.cpp.

References ArMutex::lock(), myGoalAchieved, myModeMutex, and ArMutex::unlock().

void ArServerHandlerCamera::cameraModeLookAtGoalSetGoal ArPose  pose  ) 
 

Sets the goal for the camera mode that points at the goal.

Definition at line 1292 of file ArServerHandlerCamera.cpp.

References ArMutex::lock(), myGoal, myGoalAchieved, myGoalAchievedLast, myGoalResetZoom, myModeMutex, and ArMutex::unlock().

void ArServerHandlerCamera::cameraModeLookAtPoint ArPose  pose  ) 
 

Puts the camera into a mode where it will look at a point.

Definition at line 1271 of file ArServerHandlerCamera.cpp.

References ArServerBase::broadcastPacketTcp(), buildModePacket(), CAMERA_MODE_LOOK_AT_POINT, ArPose::findDistanceTo(), ArPose::getX(), ArPose::getY(), ArMutex::lock(), ArLog::log(), myCameraMode, myCameraModePacket, myCommandToPacketNameMap, myLookAtPoint, myModeMutex, myPointResetZoom, myServer, and ArMutex::unlock().

Referenced by handleSetCameraMode().

void ArServerHandlerCamera::cameraModePosition void   ) 
 

Puts the camera in position mode.

Definition at line 1235 of file ArServerHandlerCamera.cpp.

References ArServerBase::broadcastPacketTcp(), buildModePacket(), CAMERA_MODE_POSITION, ArMutex::lock(), ArLog::log(), myCameraMode, myCameraModePacket, myCommandToPacketNameMap, myModeMutex, myServer, and ArMutex::unlock().

Referenced by handleSetCameraMode(), resetCamera(), setCameraAbs(), setCameraPct(), and setCameraRel().

void ArServerHandlerCamera::cameraPct ArServerClient client,
ArNetPacket packet
 

Handles the cameraPct network packet, with information stored as byte integers.

Definition at line 670 of file ArServerHandlerCamera.cpp.

References ArPTZ::canGetFOV(), ArLog::log(), myCamera, and setCameraPct().

void ArServerHandlerCamera::cameraUpdate ArServerClient client,
ArNetPacket packet
 

Handles the cameraUpdate network packet, with information returned as byte2 integers.

Definition at line 688 of file ArServerHandlerCamera.cpp.

References ArBasePacket::byte2ToBuf(), client, ArPTZ::getMaxZoom(), ArPTZ::getMinZoom(), ArPTZ::getPan(), ArPTZ::getTilt(), ArPTZ::getZoom(), ArRobot::lock(), myCamera, myRobot, ArMath::roundInt(), ArClientBase::sendPacketUdp(), and ArRobot::unlock().

const char * ArServerHandlerCamera::getCameraName  )  [virtual]
 

Returns:
char * the unique name of the associated camera (if specified in the constructor)

Implements ArCameraCollectionItem.

Definition at line 150 of file ArServerHandlerCamera.cpp.

References myCameraName.

double ArServerHandlerCamera::getCurrentZoomRatio  )  [inline, protected]
 

Gets the current camera zoom as a ratio of its zoom range.

Definition at line 295 of file ArServerHandlerCamera.h.

References ArPTZ::getMaxZoom(), ArPTZ::getMinZoom(), ArPTZ::getZoom(), and myCamera.

Referenced by handleGetCameraData(), setCameraPct(), and setCameraRel().

double ArServerHandlerCamera::getDoubleFromPacket ArNetPacket packet  )  [inline, protected]
 

The "double" value is really a 2-byte integer multiplied by the DOUBLE_FACTOR.

Definition at line 288 of file ArServerHandlerCamera.h.

References DOUBLE_FACTOR.

Referenced by handleSetCameraAbs(), handleSetCameraPct(), and handleSetCameraRel().

double ArServerHandlerCamera::getZoomRange  )  [inline, protected]
 

Gets the range of the camera's zoom.

Definition at line 323 of file ArServerHandlerCamera.h.

References ArPTZ::getMaxZoom(), ArPTZ::getMinZoom(), and myCamera.

Referenced by setCameraAbs(), and setCameraRel().

double ArServerHandlerCamera::getZoomRatio double  absZoom  )  [inline, protected]
 

Converts the given absolute zoom value to a ratio of the camera's zoom range.

Definition at line 309 of file ArServerHandlerCamera.h.

References ArPTZ::getMaxZoom(), ArPTZ::getMinZoom(), and myCamera.

void ArServerHandlerCamera::handleCameraModeUpdated ArServerClient client,
ArNetPacket packet
 

Refer to handleSetCameraMode for a description of the supported modes and the various packet structures.

Parameters:
client the ArServerClient * that sent the request
packet the ArNetPacket * that contains the request

Definition at line 1143 of file ArServerHandlerCamera.cpp.

References client, ArMutex::lock(), myCameraModePacket, myModeMutex, ArClientBase::sendPacketTcp(), and ArMutex::unlock().

void ArServerHandlerCamera::handleGetCameraData ArServerClient client,
ArNetPacket packet
 

Parameters:
client the ArServerClient * that sent the request
packet the ArNetPacket * that contains the request

Definition at line 518 of file ArServerHandlerCamera.cpp.

References addDoubleToPacket(), client, getCurrentZoomRatio(), ArPTZ::getPan(), ArPTZ::getTilt(), ArRobot::lock(), myCamera, myRobot, ArClientBase::sendPacketUdp(), and ArRobot::unlock().

void ArServerHandlerCamera::handleGetCameraInfo ArServerClient client,
ArNetPacket packet
 

Parameters:
client the ArServerClient * that sent the request
packet the ArNetPacket * that contains the request

Definition at line 543 of file ArServerHandlerCamera.cpp.

References addDoubleToPacket(), ArBasePacket::byteToBuf(), ArPTZ::canZoom(), client, ArPTZ::getMaxNegPan(), ArPTZ::getMaxNegTilt(), ArPTZ::getMaxPosPan(), ArPTZ::getMaxPosTilt(), ArRobot::lock(), ArLog::log(), myCamera, myRobot, ArClientBase::sendPacketUdp(), and ArRobot::unlock().

void ArServerHandlerCamera::handleGetCameraModeList ArServerClient client,
ArNetPacket packet
 

Parameters:
client the ArServerClient * that sent the request
packet the ArNetPacket * that contains the request

Definition at line 1126 of file ArServerHandlerCamera.cpp.

References client, ArMutex::lock(), myCameraModeNameMap, myModeMutex, ArClientBase::sendPacketTcp(), ArBasePacket::strToBuf(), ArBasePacket::uByte2ToBuf(), and ArMutex::unlock().

void ArServerHandlerCamera::handleResetCamera ArServerClient client,
ArNetPacket packet
 

Parameters:
client the ArServerClient * that sent the request
packet the ArNetPacket * that contains the request

Definition at line 1309 of file ArServerHandlerCamera.cpp.

References resetCamera().

void ArServerHandlerCamera::handleSetCameraAbs ArServerClient client,
ArNetPacket packet
 

Parameters:
client the ArServerClient * that sent the request
packet the ArNetPacket * that contains the request

Definition at line 582 of file ArServerHandlerCamera.cpp.

References getDoubleFromPacket(), myCamera, myRobot, and setCameraAbs().

void ArServerHandlerCamera::handleSetCameraMode ArServerClient client,
ArNetPacket packet
 

The following modes are currently supported: Position: The user controls the camera position; no additional parameters in the packet LookAtGoal: The robot automatically points the camera in the direction of its destination goal; no additional parameters in the packet LookAtPoint: The robot "looks" at a specified point in the map; the packet contains: byte4, the x coordinate; byte4, the y coordinate.

Definition at line 1151 of file ArServerHandlerCamera.cpp.

References CAMERA_MODE_LOOK_AT_GOAL, CAMERA_MODE_LOOK_AT_POINT, CAMERA_MODE_POSITION, cameraModeLookAtGoal(), cameraModeLookAtPoint(), cameraModePosition(), ArLog::log(), myCameraModeNameMap, myCameraName, ArPose::setX(), and ArPose::setY().

void ArServerHandlerCamera::handleSetCameraPct ArServerClient client,
ArNetPacket packet
 

Parameters:
client the ArServerClient * that sent the request
packet the ArNetPacket * that contains the request

Definition at line 616 of file ArServerHandlerCamera.cpp.

References ArPTZ::canGetFOV(), getDoubleFromPacket(), ArLog::log(), myCamera, and setCameraPct().

void ArServerHandlerCamera::handleSetCameraRel ArServerClient client,
ArNetPacket packet
 

Parameters:
client the ArServerClient * that sent the request
packet the ArNetPacket * that contains the request

Definition at line 598 of file ArServerHandlerCamera.cpp.

References getDoubleFromPacket(), and setCameraRel().

void ArServerHandlerCamera::resetCamera bool  lockRobot = true  ) 
 

Resets the camera.

Definition at line 1315 of file ArServerHandlerCamera.cpp.

References cameraModePosition(), ArRobot::lock(), myCamera, myRobot, ArPTZ::reset(), and ArRobot::unlock().

Referenced by handleResetCamera().

void ArServerHandlerCamera::setCameraAbs double  pan,
double  tilt,
double  zoom,
bool  lockRobot = true
 

Sends the camera absolute commands to the camera (and puts it in position mode).

Parameters:
pan the degrees to pan to (absolute)
tilt the degrees to tilt to (absolute)
zoom the percent (number between 0 and 100) to pan to (absolute)
lockRobot whether to lock the robot or not

Definition at line 746 of file ArServerHandlerCamera.cpp.

References cameraModePosition(), ArPTZ::getMinZoom(), getZoomRange(), IFDEBUG, ArRobot::lock(), myCamera, myRobot, ArPTZ::panTilt(), ArRobot::unlock(), and ArPTZ::zoom().

Referenced by cameraAbs(), and handleSetCameraAbs().

void ArServerHandlerCamera::setCameraPct double  panPct,
double  tiltPct,
bool  lockRobot = true
 

Sends the camera percent commands to the camera (and puts it in position mode).

Parameters:
panPct the double percent offset from the image frame center by which to pan the camera; values range -100 to 100. 0 indicates no change.
tiltPct the double percent offset from the image frame center by which to tilt the camera; values range -100 to 100. 0 indicates no change.
lockRobot whether to lock the robot or not

Figure how much the x/y/z components of the left/right vector, this part is pretty straightforward since its just multiplying the left/right vector by the cos or sin to get the component in that direction (which is based on the pan)

------------------ y |\)lr | | \ | sin lr | \ | | \ | | \| x

That derives the sin lr for the length of the vector... for how much of that is in which direction

dx = sin lr * sin pan ------------------------- y |\)pan | | \ | | | dy = sin lr * cos pan | \ | | \ | | \ | | \| x

Where slr is the sin lr derived above and pan is the pan angle (since we're doing vectors the position we calculate these components from doesn't matter so we just move it back to 0 to make life easier)...

The - on the sin is needed, I think its because the camera pans positive to the right and negative to the left instead of positive to the right.

Figure how much the x/y/z components of the up/down vector,

So for x and y first we find how much is in the x/y plane (sin(ud) * sin(oldTilt)) and then we multiply that by the same sin or cos of the pan to see how much is in which coord...

For z we just multiply the up/down vector by the cos to find what the movement in z is.

Now add the original vector, the vector from left/right and the vector from up/down together.

Now find where we have to pan and tilt to...

| , | /|z | / | |/t |y -)--|------- / \)p| / / h\ | / x / \|/

Where x, y, and z are the values we found above and tilt and pan are the tilt (angle of the line off of the x/y plane) and pan values (angle of the line within the x/y plain) we need to point at that point, h is the hypotenuse of the line projected into the x/y plane.

tan pan = x / y ! pan = atan (x / y)

cos pan = y / hyp hyp = y / cos pan

sin pan = x / hyp hyp = x / sin pan

tan tilt = z / hyp

! tilt = atan (z / hyp) (substitute in one of the hyps)

Pan is easy since its just the atan of x and y.

This denom can be either y/cos(pan) or x / sin(pan) depending on which solution you use and we use them in a way that won't get us a divide by 0.

Definition at line 878 of file ArServerHandlerCamera.cpp.

References ArMath::atan2(), cameraModePosition(), ArMath::cos(), getCurrentZoomRatio(), ArPTZ::getFOVAtMaxZoom(), ArPTZ::getFOVAtMinZoom(), ArPTZ::getPan(), ArPTZ::getTilt(), IFDEBUG, ArRobot::lock(), myCamera, myRobot, ArPTZ::panTilt(), ArMath::sin(), ArMath::tan(), and ArRobot::unlock().

Referenced by cameraPct(), and handleSetCameraPct().

void ArServerHandlerCamera::setCameraRel double  pan,
double  tilt,
double  zoom,
bool  lockRobot = true
 

Sends the camera relative commands to the camera (and puts it in position mode).

Parameters:
pan the degrees to pan to (relative)
tilt the degrees to tilt to (relative)
zoom the percent (number between 0 and 100) to change pan by (relative)
lockRobot whether to lock the robot or not

Definition at line 782 of file ArServerHandlerCamera.cpp.

References cameraModePosition(), getCurrentZoomRatio(), ArPTZ::getMaxZoom(), ArPTZ::getMinZoom(), getZoomRange(), IFDEBUG, ArRobot::lock(), myCamera, myRobot, ArPTZ::panRel(), ArPTZ::panTiltRel(), ArPTZ::tiltRel(), ArRobot::unlock(), and ArPTZ::zoom().

Referenced by camera(), and handleSetCameraRel().

void ArServerHandlerCamera::userTask void   )  [protected]
 

Definition at line 1190 of file ArServerHandlerCamera.cpp.

References CAMERA_MODE_LOOK_AT_GOAL, CAMERA_MODE_LOOK_AT_POINT, ArRobot::findDeltaHeadingTo(), ArMutex::lock(), myCamera, myCameraMode, myGoal, myGoalAchieved, myGoalAchievedLast, myGoalResetZoom, myLookAtPoint, myModeMutex, myPointResetZoom, myRobot, ArPTZ::panTilt(), ArMutex::unlock(), and ArPTZ::zoom().


Member Data Documentation

ArPTZ* ArServerHandlerCamera::myCamera [protected]
 

Camera that is controlled.

Definition at line 364 of file ArServerHandlerCamera.h.

Referenced by cameraInfo(), cameraPct(), cameraUpdate(), getCurrentZoomRatio(), getZoomRange(), getZoomRatio(), handleGetCameraData(), handleGetCameraInfo(), handleSetCameraAbs(), handleSetCameraPct(), resetCamera(), setCameraAbs(), setCameraPct(), setCameraRel(), and userTask().

ArFunctor2C<ArServerHandlerCamera, ArServerClient *, ArNetPacket *> ArServerHandlerCamera::myCameraAbsCB [protected]
 

Deprecated:

Definition at line 416 of file ArServerHandlerCamera.h.

ArFunctor2C<ArServerHandlerCamera, ArServerClient *, ArNetPacket *> ArServerHandlerCamera::myCameraCB [protected]
 

Deprecated:

Definition at line 410 of file ArServerHandlerCamera.h.

ArCameraCollection* ArServerHandlerCamera::myCameraCollection [protected]
 

Pointer to the camera collection (if any).

Definition at line 369 of file ArServerHandlerCamera.h.

ArFunctor2C<ArServerHandlerCamera, ArServerClient *, ArNetPacket *> ArServerHandlerCamera::myCameraInfoCB [protected]
 

Deprecated:

Definition at line 428 of file ArServerHandlerCamera.h.

CameraMode ArServerHandlerCamera::myCameraMode [protected]
 

Definition at line 387 of file ArServerHandlerCamera.h.

Referenced by buildModePacket(), cameraModeLookAtGoal(), cameraModeLookAtPoint(), cameraModePosition(), and userTask().

std::map<CameraMode, std::string> ArServerHandlerCamera::myCameraModeNameMap [protected]
 

Definition at line 388 of file ArServerHandlerCamera.h.

Referenced by buildModePacket(), handleGetCameraModeList(), and handleSetCameraMode().

ArNetPacket ArServerHandlerCamera::myCameraModePacket [protected]
 

Definition at line 389 of file ArServerHandlerCamera.h.

Referenced by buildModePacket(), cameraModeLookAtGoal(), cameraModeLookAtPoint(), cameraModePosition(), and handleCameraModeUpdated().

std::string ArServerHandlerCamera::myCameraName [protected]
 

Unique name of the associated camera.

Definition at line 367 of file ArServerHandlerCamera.h.

Referenced by getCameraName(), and handleSetCameraMode().

ArFunctor2C<ArServerHandlerCamera, ArServerClient *, ArNetPacket *> ArServerHandlerCamera::myCameraUpdateCB [protected]
 

Deprecated:

Definition at line 422 of file ArServerHandlerCamera.h.

std::map<std::string, ArFunctor2<ArServerClient *, ArNetPacket *> *> ArServerHandlerCamera::myCommandToCBMap [protected]
 

Map of ArCameraCommand names to the callback that handles the packet.

Definition at line 377 of file ArServerHandlerCamera.h.

Referenced by ~ArServerHandlerCamera().

std::map<std::string, int> ArServerHandlerCamera::myCommandToIntervalMap [protected]
 

Map of ArCameraCommand names to the preferred default request interval.

Definition at line 374 of file ArServerHandlerCamera.h.

std::map<std::string, std::string> ArServerHandlerCamera::myCommandToPacketNameMap [protected]
 

Map of ArCameraCommand names to a unique network packet name.

Definition at line 372 of file ArServerHandlerCamera.h.

Referenced by cameraModeLookAtGoal(), cameraModeLookAtPoint(), and cameraModePosition().

ArPose ArServerHandlerCamera::myGoal [protected]
 

Definition at line 392 of file ArServerHandlerCamera.h.

Referenced by cameraModeLookAtGoalSetGoal(), and userTask().

bool ArServerHandlerCamera::myGoalAchieved [protected]
 

Definition at line 393 of file ArServerHandlerCamera.h.

Referenced by cameraModeLookAtGoal(), cameraModeLookAtGoalClearGoal(), cameraModeLookAtGoalSetGoal(), and userTask().

bool ArServerHandlerCamera::myGoalAchievedLast [protected]
 

Definition at line 394 of file ArServerHandlerCamera.h.

Referenced by cameraModeLookAtGoal(), cameraModeLookAtGoalSetGoal(), and userTask().

bool ArServerHandlerCamera::myGoalResetZoom [protected]
 

Definition at line 395 of file ArServerHandlerCamera.h.

Referenced by cameraModeLookAtGoal(), cameraModeLookAtGoalSetGoal(), and userTask().

ArPose ArServerHandlerCamera::myLookAtPoint [protected]
 

Definition at line 390 of file ArServerHandlerCamera.h.

Referenced by buildModePacket(), cameraModeLookAtPoint(), and userTask().

ArMutex ArServerHandlerCamera::myModeMutex [protected]
 

Definition at line 386 of file ArServerHandlerCamera.h.

Referenced by cameraModeLookAtGoal(), cameraModeLookAtGoalClearGoal(), cameraModeLookAtGoalSetGoal(), cameraModeLookAtPoint(), cameraModePosition(), handleCameraModeUpdated(), handleGetCameraModeList(), and userTask().

bool ArServerHandlerCamera::myPointResetZoom [protected]
 

Definition at line 391 of file ArServerHandlerCamera.h.

Referenced by cameraModeLookAtPoint(), and userTask().

ArRobot* ArServerHandlerCamera::myRobot [protected]
 

Associated robot (primarily used for locking).

Definition at line 360 of file ArServerHandlerCamera.h.

Referenced by cameraInfo(), cameraUpdate(), handleGetCameraData(), handleGetCameraInfo(), handleSetCameraAbs(), resetCamera(), setCameraAbs(), setCameraPct(), setCameraRel(), and userTask().

ArServerBase* ArServerHandlerCamera::myServer [protected]
 

Server from which requests are received.

Definition at line 362 of file ArServerHandlerCamera.h.

Referenced by cameraModeLookAtGoal(), cameraModeLookAtPoint(), and cameraModePosition().

ArFunctorC<ArServerHandlerCamera> ArServerHandlerCamera::myUserTaskCB [protected]
 

Definition at line 401 of file ArServerHandlerCamera.h.


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