Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Attributes | Static Protected Attributes | List of all members
P2OSPtz Class Reference

#include <p2os_ptz.hpp>

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

Member Enumeration Documentation

Enumerator
CAMERA_VCC4 
CAMERA_C50I 

Definition at line 98 of file p2os_ptz.hpp.

Enumerator
DELIM 
DEVICEID 
PANSLEW 
TILTSLEW 
STOP 
INIT 
SLEWREQ 
ANGLEREQ 
PANTILT 
SETRANGE 
PANTILTREQ 
INFRARED 
PRODUCTNAME 
LEDCONTROL 
CONTROL 
POWER 
AUTOFOCUS 
ZOOMSTOP 
GAIN 
FOCUS 
ZOOM 
ZOOMREQ 
IRCUTFILTER 
DIGITALZOOM 
FOOTER 
RESPONSE 
HEADER 

Definition at line 59 of file p2os_ptz.hpp.

Enumerator
COMM_UNKNOWN 
COMM_BIDIRECTIONAL 
COMM_UNIDIRECTIONAL 

Definition at line 91 of file p2os_ptz.hpp.

enum P2OSPtz::Error
protected
Enumerator
CAM_ERROR_NONE 
CAM_ERROR_BUSY 
CAM_ERROR_PARAM 
CAM_ERROR_MODE 
CAM_ERROR_UNKNOWN 

Definition at line 121 of file p2os_ptz.hpp.

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 106 of file p2os_ptz.hpp.

enum P2OSPtz::Power
protected
Enumerator
POWER_OFF 
POWER_ON 

Definition at line 131 of file p2os_ptz.hpp.

Constructor & Destructor Documentation

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

Definition at line 40 of file p2os_ptz.cpp.

Member Function Documentation

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

Definition at line 149 of file p2os_ptz.cpp.

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

Definition at line 770 of file p2os_ptz.cpp.

int P2OSPtz::getAbsZoom ( int *  zoom)

Definition at line 631 of file p2os_ptz.cpp.

p2os_msgs::PTZState P2OSPtz::getCurrentState ( )
inline

Definition at line 168 of file p2os_ptz.hpp.

int P2OSPtz::getMaxZoom ( int *  max_zoom)

Definition at line 579 of file p2os_ptz.cpp.

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

Definition at line 457 of file p2os_ptz.cpp.

bool P2OSPtz::isOn ( ) const
inline

Definition at line 167 of file p2os_ptz.hpp.

int P2OSPtz::receiveCommandAnswer ( int  asize)

Definition at line 274 of file p2os_ptz.cpp.

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

Definition at line 372 of file p2os_ptz.cpp.

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

Definition at line 839 of file p2os_ptz.cpp.

int P2OSPtz::sendAbsZoom ( int  zoom)

Definition at line 682 of file p2os_ptz.cpp.

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

Definition at line 202 of file p2os_ptz.cpp.

int P2OSPtz::sendInit ( )

Definition at line 556 of file p2os_ptz.cpp.

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

Definition at line 237 of file p2os_ptz.cpp.

int P2OSPtz::setControlMode ( )

Definition at line 533 of file p2os_ptz.cpp.

int P2OSPtz::setDefaultTiltRange ( )

Definition at line 729 of file p2os_ptz.cpp.

int P2OSPtz::setPower ( Power  on)

Definition at line 506 of file p2os_ptz.cpp.

int P2OSPtz::setup ( )

Definition at line 55 of file p2os_ptz.cpp.

void P2OSPtz::shutdown ( )

Definition at line 138 of file p2os_ptz.cpp.

Member Data Documentation

bool P2OSPtz::bidirectional_com_
protected

Definition at line 183 of file p2os_ptz.hpp.

circbuf P2OSPtz::cb_

Definition at line 176 of file p2os_ptz.hpp.

const int P2OSPtz::COMMAND_RESPONSE_BYTES = 6
staticprotected

Definition at line 189 of file p2os_ptz.hpp.

p2os_msgs::PTZState P2OSPtz::current_state_
protected

Definition at line 184 of file p2os_ptz.hpp.

int P2OSPtz::error_code_
protected

Definition at line 182 of file p2os_ptz.hpp.

bool P2OSPtz::is_on_
protected

Definition at line 181 of file p2os_ptz.hpp.

const int P2OSPtz::MAX_COMMAND_LENGTH = 19
staticprotected

Definition at line 187 of file p2os_ptz.hpp.

const int P2OSPtz::MAX_REQUEST_LENGTH = 17
staticprotected

Definition at line 188 of file p2os_ptz.hpp.

int P2OSPtz::max_zoom_
protected

Definition at line 179 of file p2os_ptz.hpp.

P2OSNode* P2OSPtz::p2os_
protected

Definition at line 173 of file p2os_ptz.hpp.

const int P2OSPtz::PACKET_TIMEOUT = 300
staticprotected

Definition at line 190 of file p2os_ptz.hpp.

int P2OSPtz::pan_
protected

Definition at line 180 of file p2os_ptz.hpp.

const int P2OSPtz::PAN_THRESH = 1
staticprotected

Definition at line 192 of file p2os_ptz.hpp.

const int P2OSPtz::SLEEP_TIME_USEC = 300000
staticprotected

Definition at line 191 of file p2os_ptz.hpp.

int P2OSPtz::tilt_
protected

Definition at line 180 of file p2os_ptz.hpp.

const int P2OSPtz::TILT_THRESH = 1
staticprotected

Definition at line 193 of file p2os_ptz.hpp.

int P2OSPtz::zoom_
protected

Definition at line 180 of file p2os_ptz.hpp.

const int P2OSPtz::ZOOM_THRESH = 1
staticprotected

Definition at line 194 of file p2os_ptz.hpp.


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


p2os_driver
Author(s): Hunter L. Allen , David Feil-Seifer , Aris Synodinos , Brian Gerkey, Kasper Stoy, Richard Vaughan, Andrew Howard, Tucker Hermans, ActivMedia Robotics LLC, MobileRobots Inc.
autogenerated on Sat Jun 20 2020 03:29:42