Aria  2.8.0
ArRVisionPTZ Class Reference

Control the RVision camera pan tilt zoom unit. More...

#include <ArRVisionPTZ.h>

Inherits ArPTZ.

Public Types

enum  {
  MAX_PAN = 180, MIN_PAN = -180, MIN_TILT = -30, MAX_TILT = 60,
  MIN_ZOOM = 0, MAX_ZOOM = 32767, TILT_OFFSET_IN_DEGREES = 38, PAN_OFFSET_IN_DEGREES = 190
}
 

Public Member Functions

 ArRVisionPTZ (ArRobot *robot)
 
virtual bool canGetFOV (void)
 
virtual bool canGetRealPanTilt (void) const
 
virtual bool canGetRealZoom (void) const
 
virtual bool canZoom (void) const
 
virtual double getFOVAtMaxZoom (void)
 Gets the field of view at maximum zoom.
 
virtual double getFOVAtMinZoom (void)
 Gets the field of view at minimum zoom.
 
virtual const char * getTypeName ()
 
virtual int getZoom (void) const
 
virtual bool init (void)
 
virtual ArBasePacketreadPacket (void)
 
void setPort (const char *port)
 Set serial port. More...
 
virtual bool zoom (int zoomValue)
 
virtual bool zoomRel (int zoomValue)
 
- Public Member Functions inherited from ArPTZ
 ArPTZ (ArRobot *robot)
 
virtual bool canPanTiltSlew ()
 Can pan and tilt speed (slew rates) be set to move device?
 
virtual bool canSetFocus (void) const
 If the driver can set the focus on the camera, or not.
 
virtual bool canSetGain (void) const
 If the driver can set gain on the camera, or not.
 
virtual void connectHandler (void)
 Internal, attached to robot, inits the camera when robot connects.
 
virtual int getAuxPort (void)
 Gets the port the device is set to communicate on.
 
virtual ArDeviceConnectiongetDeviceConnection (void)
 Gets the device connection used by this PTZ camera.
 
virtual double getFocus (double focus) const
 Get the focus the camera is set to. 0 if not supported.
 
virtual double getGain (double gain) const
 Get the gain the camera is set to. 0 if not supported.
 
bool getInverted ()
 Get whether the camera is inverted (upside down). If true, pan and tilt axes will be reversed.
 
virtual double getMaxNegPan (void) const
 Gets the lowest negative degree the camera can pan to (inverted if camera is inverted)
 
virtual double getMaxNegTilt (void) const
 Gets the lowest negative degree the camera can tilt to (inverted if camera is inverted)
 
double getMaxPan () const
 Gets the highest positive degree the camera can pan to (inverted if camera is inverted) More...
 
virtual double getMaxPosPan (void) const
 Gets the highest positive degree the camera can pan to (inverted if camera is inverted)
 
virtual double getMaxPosTilt (void) const
 Gets the highest positive degree the camera can tilt to (inverted if camera is inverted)
 
double getMaxTilt () const
 Gets the highest positive degree the camera can tilt to (inverted if camera is inverted) More...
 
virtual int getMaxZoom (void) const
 Gets the maximum value for the zoom on this camera.
 
double getMinPan () const
 Gets the lowest negative degree the camera can pan to (inverted if camera is inverted) More...
 
double getMinTilt () const
 Gets the lowest negative degree the camera can tilt to (inverted if camera is inverted) More...
 
virtual int getMinZoom (void) const
 Gets the lowest value for the zoom on this camera.
 
virtual double getPan (void) const
 The angle the camera is panned to (or last commanded value sent, if unable to obtain real pan position) More...
 
ArRobotgetRobot ()
 Return ArRobot object this PTZ is associated with. May be NULL.
 
virtual double getTilt (void) const
 The angle the camera is tilted to (or last commanded value sent, if unable to obtain real pan position) More...
 
virtual bool haltPanTilt ()
 Halt any pan/tilt movement, if device supports it.
 
virtual bool haltZoom ()
 Halt any zoom movement, if device supports that.
 
virtual bool packetHandler (ArBasePacket *packet)
 Handles a packet that was read from the device. More...
 
virtual bool pan (double degrees)
 Pans to the given degrees. 0 is straight ahead, - is to the left, + to the right.
 
virtual bool panRel (double degrees)
 Pans relative to current position by given degrees.
 
virtual bool panSlew (double s)
 Set pan slew rate (speed) (degrees/sec) if device supports it (see canPanTiltSlew())
 
virtual bool panTilt (double degreesPan, double degreesTilt)
 Pans and tilts to the given degrees.
 
virtual bool panTiltRel (double degreesPan, double degreesTilt)
 Pans and tilts relatives to the current position by the given degrees.
 
virtual void reset (void)
 Resets the camera. More...
 
virtual bool robotPacketHandler (ArRobotPacket *packet)
 Handles a packet that was read by the robot. More...
 
virtual bool sendPacket (ArBasePacket *packet)
 Sends a given packet to the camera (via robot or serial port, depending) More...
 
virtual void sensorInterpHandler (void)
 Internal, for attaching to the robots sensor interp to read serial port.
 
virtual bool setAuxPort (int auxPort)
 Sets the aux port on the robot to be used to communicate with this device. More...
 
virtual bool setDeviceConnection (ArDeviceConnection *connection, bool driveFromRobotLoop=true)
 Sets the device connection to be used by this PTZ camera, if set this camera will send commands via this connection, otherwise its via robot aux. More...
 
virtual bool setFocus (double focus) const
 Set focus on camera, range of 1-100. More...
 
virtual bool setGain (double gain) const
 Set gain on camera, range of 1-100. More...
 
void setInverted (bool inv)
 Set whether the camera is inverted (upside down). If true, pan and tilt axes will be reversed.
 
virtual bool tilt (double degrees)
 Tilts to the given degrees. 0 is middle, - is downward, + is upwards.
 
virtual bool tiltRel (double degrees)
 Tilts relative to the current position by given degrees.
 
virtual bool tiltSlew (double s)
 Set tilt slew rate (speed) (degrees/sec) if device supports it (see canPanTiltSlew())
 
virtual ~ArPTZ ()
 Destructor.
 

Static Public Member Functions

static void registerPTZType ()
 called automatically by Aria::init() More...
 

Protected Member Functions

virtual double getPan_i (void) const
 
virtual double getTilt_i (void) const
 
void initializePackets (void)
 
virtual bool pan_i (double degrees)
 
virtual bool panRel_i (double degrees)
 
virtual bool panTilt_i (double degreesPan, double degreesTilt)
 
virtual bool panTiltRel_i (double degreesPan, double degreesTilt)
 
virtual bool tilt_i (double degrees)
 
virtual bool tiltRel_i (double degrees)
 
- Protected Member Functions inherited from ArPTZ
void setLimits (double maxPosPan, double maxNegPan, double maxPosTilt, double maxNegTilt, int maxZoom=0, int minZoom=0)
 Subclasses call this to set extents (limits) returned by getMaxPosPan(), getMaxNegPan(), getMaxPosTilt(), getMaxNegTilt(), getMaxZoom(), and getMinZoom(). More...
 
virtual double getMaxPosPan_i (void) const
 Versions of the pan and tilt limit accessors where inversion is not applied, for use by subclasses to check when given pan/tilt commands. More...
 
double getMaxPan_i () const
 
virtual double getMaxPosTilt_i (void) const
 
double getMinPan_i () const
 
virtual double getMaxNegPan_i (void) const
 
double getMaxTilt_i () const
 
virtual double getMaxNegTilt_i (void) const
 
double getMinTilt_i () const
 

Static Protected Member Functions

static ArPTZcreate (size_t index, ArPTZParams params, ArArgumentParser *parser, ArRobot *robot)
 

Protected Attributes

double myDegToPan
 
double myDegToTilt
 
ArRVisionPacket myInquiryPacket
 
ArRVisionPacket myPacket
 
double myPan
 
double myPanOffsetInDegrees
 
ArRVisionPacket myPanTiltPacket
 
const char * mySerialPort
 
double myTilt
 
double myTiltOffsetInDegrees
 
int myZoom
 
ArRVisionPacket myZoomPacket
 
- Protected Attributes inherited from ArPTZ
int myAuxPort
 
ArCommands::Commands myAuxRxCmd
 
ArCommands::Commands myAuxTxCmd
 
ArDeviceConnectionmyConn
 
ArFunctorC< ArPTZmyConnectCB
 
bool myInverted
 
double myMaxNegPan
 
double myMaxNegTilt
 
double myMaxPosPan
 
double myMaxPosTilt
 
int myMaxZoom
 
int myMinZoom
 
ArRobotmyRobot
 
ArRetFunctor1C< bool, ArPTZ, ArRobotPacket * > myRobotPacketHandlerCB
 
ArFunctorC< ArPTZmySensorInterpCB
 

Static Protected Attributes

static ArPTZConnector::GlobalPTZCreateFunc ourCreateFunc
 

Detailed Description

Control the RVision camera pan tilt zoom unit.

In addition to creating an ArRvisionPTZ instance, you will also need to create an ArSerialConnection object and open the serial port connection (the RVision is normally on COM3 on Seekur and Seekur Jr. robots) and use the setDeviceConnection() method to associate the serial connection with the ArRVisionPTZ object.

Since
2.7.0

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_PAN 

maximum degrees the unit can pan (clockwise from top)

MIN_PAN 

minimum degrees the unit can pan (counterclockwise from top)

MIN_TILT 

minimum degrees the unit can tilt

MAX_TILT 

maximum degrees the unit can tilt

MIN_ZOOM 

minimum value for zoom

MAX_ZOOM 

maximum value for zoom

TILT_OFFSET_IN_DEGREES 

offset value to convert internal camera coords to world

PAN_OFFSET_IN_DEGREES 

offset value to convert internal camera coords to world

Member Function Documentation

◆ create()

ArPTZ * ArRVisionPTZ::create ( size_t  index,
ArPTZParams  params,
ArArgumentParser parser,
ArRobot robot 
)
staticprotected
Since
2.7.6

◆ registerPTZType()

void ArRVisionPTZ::registerPTZType ( )
static

called automatically by Aria::init()

Since
2.7.6

◆ setPort()

void ArRVisionPTZ::setPort ( const char *  port)
inline

Set serial port.

Since
2.7.6

Member Data Documentation

◆ ourCreateFunc

ArPTZConnector::GlobalPTZCreateFunc ArRVisionPTZ::ourCreateFunc
staticprotected
Since
2.7.6

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