Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Attributes | Static Protected Attributes
P2OSPtz Class Reference

#include <p2os_ptz.h>

List of all members.

Public Types

enum  CameraType { CAMERA_VCC4, CAMERA_C50I }
enum  Command {
  DELIM = 0x00, DEVICEID = 0x30, PANSLEW = 0x50, TILTSLEW = 0x51,
  STOP = 0x53, INIT = 0x58, SLEWREQ = 0x59, ANGLEREQ = 0x5c,
  PANTILT = 0x62, SETRANGE = 0x64, PANTILTREQ = 0x63, INFRARED = 0x76,
  PRODUCTNAME = 0x87, LEDCONTROL = 0x8E, CONTROL = 0x90, POWER = 0xA0,
  AUTOFOCUS = 0xA1, ZOOMSTOP = 0xA2, GAIN = 0xA5, FOCUS = 0xB0,
  ZOOM = 0xB3, ZOOMREQ = 0xB4, IRCUTFILTER = 0xB5, DIGITALZOOM = 0xB7,
  FOOTER = 0xEF, RESPONSE = 0xFE, HEADER = 0xFF
}
enum  CommState { COMM_UNKNOWN, COMM_BIDIRECTIONAL, COMM_UNIDIRECTIONAL }

Public Member Functions

void callback (const p2os_msgs::PTZStateConstPtr &msg)
int getAbsPanTilt (int *pan, int *tilt)
int getAbsZoom (int *zoom)
p2os_msgs::PTZState getCurrentState ()
int getMaxZoom (int *max_zoom)
void getPtzPacket (int s1, int s2=0)
bool isOn () const
 P2OSPtz (P2OSNode *p2os, bool bidirectional_com=false)
int receiveCommandAnswer (int asize)
int receiveRequestAnswer (unsigned char *data, int s1, int s2)
int sendAbsPanTilt (int pan, int tilt)
int sendAbsZoom (int zoom)
int sendCommand (unsigned char *str, int len)
int sendInit ()
int sendRequest (unsigned char *str, int len, unsigned char *reply)
int setControlMode ()
int setDefaultTiltRange ()
int setPower (Power on)
int setup ()
void shutdown ()

Public Attributes

circbuf cb_

Protected Types

enum  Error {
  CAM_ERROR_NONE = 0x30, CAM_ERROR_BUSY = 0x31, CAM_ERROR_PARAM = 0x35, CAM_ERROR_MODE = 0x39,
  CAM_ERROR_UNKNOWN = 0xFF
}
enum  Param {
  MAX_PAN = 98, MIN_PAN = -98, MAX_TILT = 88, MIN_TILT = -30,
  MAX_PAN_SLEW = 90, MIN_PAN_SLEW = 1, MAX_TILT_SLEW = 69, MIN_TILT_SLEW = 1,
  MAX_ZOOM_OPTIC = 1960, MIN_ZOOM = 0
}
enum  Power { POWER_OFF = 0, POWER_ON = 1 }

Protected Attributes

bool bidirectional_com_
p2os_msgs::PTZState current_state_
int error_code_
bool is_on_
int max_zoom_
P2OSNodep2os_
int pan_
int tilt_
int zoom_

Static Protected Attributes

static const int COMMAND_RESPONSE_BYTES = 6
static const int MAX_COMMAND_LENGTH = 19
static const int MAX_REQUEST_LENGTH = 17
static const int PACKET_TIMEOUT = 300
static const int PAN_THRESH = 1
static const int SLEEP_TIME_USEC = 300000
static const int TILT_THRESH = 1
static const int ZOOM_THRESH = 1

Detailed Description

Definition at line 56 of file p2os_ptz.h.


Member Enumeration Documentation

Enumerator:
CAMERA_VCC4 
CAMERA_C50I 

Definition at line 96 of file p2os_ptz.h.

Enumerator:
DELIM 

Delimeter character.

DEVICEID 

Default device ID.

PANSLEW 

Sets the pan slew.

TILTSLEW 

Sets the tilt slew.

STOP 

Stops current pan/tilt motion.

INIT 

Initializes the camera.

SLEWREQ 

Request pan/tilt min/max slew.

ANGLEREQ 

Request pan/tilt min/max angle.

PANTILT 

Pan/tilt command.

SETRANGE 

Pan/tilt min/max range assignment.

PANTILTREQ 

Request pan/tilt position.

INFRARED 

Controls operation of IR lighting.

PRODUCTNAME 

Requests the product name.

LEDCONTROL 

Controls LED status.

CONTROL 

Puts camera in Control mode.

POWER 

Turns on/off power.

AUTOFOCUS 

Controls auto-focusing functions.

ZOOMSTOP 

Stops zoom motion.

GAIN 

Sets gain adjustment on camera.

FOCUS 

Manual focus adjustment.

ZOOM 

Zooms camera lens.

ZOOMREQ 

Requests max zoom position.

IRCUTFILTER 

Controls the IR cut filter.

DIGITALZOOM 

Controls the digital zoom amount.

FOOTER 

Packet Footer.

RESPONSE 

Packet header for response.

HEADER 

Packet Header.

Definition at line 59 of file p2os_ptz.h.

Enumerator:
COMM_UNKNOWN 
COMM_BIDIRECTIONAL 
COMM_UNIDIRECTIONAL 

Definition at line 90 of file p2os_ptz.h.

enum P2OSPtz::Error [protected]
Enumerator:
CAM_ERROR_NONE 

No error.

CAM_ERROR_BUSY 

Camera busy, will not execute the command.

CAM_ERROR_PARAM 

Illegal parameters to function call.

CAM_ERROR_MODE 

Not in host control mode.

CAM_ERROR_UNKNOWN 

Unknown error condition. Should never happen.

Definition at line 117 of file p2os_ptz.h.

enum P2OSPtz::Param [protected]
Enumerator:
MAX_PAN 
MIN_PAN 
MAX_TILT 
MIN_TILT 
MAX_PAN_SLEW 
MIN_PAN_SLEW 
MAX_TILT_SLEW 
MIN_TILT_SLEW 
MAX_ZOOM_OPTIC 
MIN_ZOOM 

Definition at line 103 of file p2os_ptz.h.

enum P2OSPtz::Power [protected]
Enumerator:
POWER_OFF 
POWER_ON 

Definition at line 126 of file p2os_ptz.h.


Constructor & Destructor Documentation

P2OSPtz::P2OSPtz ( P2OSNode p2os,
bool  bidirectional_com = false 
)

Definition at line 41 of file p2os_ptz.cpp.


Member Function Documentation

void P2OSPtz::callback ( const p2os_msgs::PTZStateConstPtr &  msg)

Definition at line 162 of file p2os_ptz.cpp.

int P2OSPtz::getAbsPanTilt ( int *  pan,
int *  tilt 
)

Definition at line 838 of file p2os_ptz.cpp.

int P2OSPtz::getAbsZoom ( int *  zoom)

Definition at line 694 of file p2os_ptz.cpp.

p2os_msgs::PTZState P2OSPtz::getCurrentState ( ) [inline]

Definition at line 162 of file p2os_ptz.h.

int P2OSPtz::getMaxZoom ( int *  max_zoom)

Definition at line 641 of file p2os_ptz.cpp.

void P2OSPtz::getPtzPacket ( int  s1,
int  s2 = 0 
)

Definition at line 509 of file p2os_ptz.cpp.

bool P2OSPtz::isOn ( ) const [inline]

Definition at line 161 of file p2os_ptz.h.

int P2OSPtz::receiveCommandAnswer ( int  asize)

Definition at line 299 of file p2os_ptz.cpp.

int P2OSPtz::receiveRequestAnswer ( unsigned char *  data,
int  s1,
int  s2 
)

Definition at line 412 of file p2os_ptz.cpp.

int P2OSPtz::sendAbsPanTilt ( int  pan,
int  tilt 
)

Definition at line 909 of file p2os_ptz.cpp.

int P2OSPtz::sendAbsZoom ( int  zoom)

Definition at line 745 of file p2os_ptz.cpp.

int P2OSPtz::sendCommand ( unsigned char *  str,
int  len 
)

Definition at line 226 of file p2os_ptz.cpp.

Definition at line 616 of file p2os_ptz.cpp.

int P2OSPtz::sendRequest ( unsigned char *  str,
int  len,
unsigned char *  reply 
)

Definition at line 262 of file p2os_ptz.cpp.

Definition at line 591 of file p2os_ptz.cpp.

Definition at line 794 of file p2os_ptz.cpp.

int P2OSPtz::setPower ( Power  on)

Definition at line 563 of file p2os_ptz.cpp.

int P2OSPtz::setup ( )

Definition at line 56 of file p2os_ptz.cpp.

Definition at line 151 of file p2os_ptz.cpp.


Member Data Documentation

bool P2OSPtz::bidirectional_com_ [protected]

Definition at line 174 of file p2os_ptz.h.

Definition at line 168 of file p2os_ptz.h.

const int P2OSPtz::COMMAND_RESPONSE_BYTES = 6 [static, protected]

Definition at line 180 of file p2os_ptz.h.

p2os_msgs::PTZState P2OSPtz::current_state_ [protected]

Definition at line 175 of file p2os_ptz.h.

int P2OSPtz::error_code_ [protected]

Definition at line 173 of file p2os_ptz.h.

bool P2OSPtz::is_on_ [protected]

Definition at line 172 of file p2os_ptz.h.

const int P2OSPtz::MAX_COMMAND_LENGTH = 19 [static, protected]

Definition at line 178 of file p2os_ptz.h.

const int P2OSPtz::MAX_REQUEST_LENGTH = 17 [static, protected]

Definition at line 179 of file p2os_ptz.h.

int P2OSPtz::max_zoom_ [protected]

Definition at line 170 of file p2os_ptz.h.

P2OSNode* P2OSPtz::p2os_ [protected]

Definition at line 166 of file p2os_ptz.h.

const int P2OSPtz::PACKET_TIMEOUT = 300 [static, protected]

Definition at line 181 of file p2os_ptz.h.

int P2OSPtz::pan_ [protected]

Definition at line 171 of file p2os_ptz.h.

const int P2OSPtz::PAN_THRESH = 1 [static, protected]

Definition at line 183 of file p2os_ptz.h.

const int P2OSPtz::SLEEP_TIME_USEC = 300000 [static, protected]

Definition at line 182 of file p2os_ptz.h.

int P2OSPtz::tilt_ [protected]

Definition at line 171 of file p2os_ptz.h.

const int P2OSPtz::TILT_THRESH = 1 [static, protected]

Definition at line 184 of file p2os_ptz.h.

int P2OSPtz::zoom_ [protected]

Definition at line 171 of file p2os_ptz.h.

const int P2OSPtz::ZOOM_THRESH = 1 [static, protected]

Definition at line 185 of file p2os_ptz.h.


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


p2os_driver
Author(s): Hunter Allen , David Feil-Seifer , Aris Synodinos , Brian Gerkey, Kasper Stoy, Richard Vaughan, Andrew Howard, Tucker Hermans, ActivMedia Robotics LLC, MobileRobots Inc.
autogenerated on Mon Oct 6 2014 03:12:45