Fawkes API  Fawkes Development Version
SonyEviD100PVisca Class Reference

Sony EviD100P Visca controller. More...

#include "evid100p.h"

Inheritance diagram for SonyEviD100PVisca:

Public Member Functions

 SonyEviD100PVisca (const char *device_file, unsigned int def_timeout_ms=30, bool blocking=true)
 Constructor. More...
 
 ~SonyEviD100PVisca ()
 Destructor. More...
 
void get_pan_tilt_rad (float &pan, float &tilt)
 Get pan/tilt in radians. More...
 
void set_pan_tilt_rad (float pan, float tilt)
 Set pan/tilt in radians. More...
 
void set_speed_radsec (float pan_speed, float tilt_speed)
 Set speed given in rad/sec. More...
 
void get_speed_radsec (float &pan_speed, float &tilt_speed)
 Get current speed in rad/sec. More...
 
void get_speed_limits (float &pan_min, float &pan_max, float &tilt_min, float &tilt_max)
 Get speed limits. More...
 
- Public Member Functions inherited from Visca
 Visca (const char *device_file, unsigned int def_timeout_ms=10, bool blocking=true)
 Constructor. More...
 
virtual ~Visca ()
 Destructor. More...
 
void open ()
 Open serial port. More...
 
void close ()
 Close port. More...
 
void set_address ()
 Set addresses of cameras. More...
 
void clear ()
 Clear command buffers. More...
 
void set_power (bool powered)
 Set power state. More...
 
bool is_powered ()
 Check if camera is powered. More...
 
void send ()
 Send outbound queue. More...
 
void recv (unsigned int timeout_ms=0xFFFFFFFF)
 Receive data. More...
 
void recv_ack (unsigned int *socket=NULL)
 Receive ACK packet. More...
 
void send_with_reply ()
 Send and wait for reply, blocking. More...
 
void send_nonblocking (unsigned int *socket=NULL)
 Send non-blocking. More...
 
void cancel_command (unsigned int socket)
 Cancel a running command. More...
 
bool data_available ()
 Check data availability. More...
 
void process ()
 Process incoming data. More...
 
void reset_pan_tilt ()
 Reset pan/tilt. More...
 
void start_get_pan_tilt ()
 Query for pan/tilt but do not wait until finished This will send an inquire to the camera that asks for pan/tilt values but it does not wait for the data! A later call to getPanTilt will then block and wait until the results arrive. More...
 
void set_pan_tilt (int pan, int tilt)
 Set pan tilt. More...
 
void get_pan_tilt (int &pan, int &tilt)
 Get pan and tilt values. More...
 
void set_pan_tilt_limit (int pan_left, int pan_right, int tilt_up, int tilt_down)
 Set pan tilt limit. More...
 
void reset_pan_tilt_limit ()
 Reset pan/tilt limit. More...
 
void set_pan_tilt_speed (unsigned char pan_speed, unsigned char tilt_speed)
 Set pan/tilt speed. More...
 
void get_pan_tilt_speed (unsigned char &pan_speed, unsigned char &tilt_speed)
 Get pan/tilt speed. More...
 
bool is_nonblocking_finished (unsigned int item) const
 Check if a non-blocking operation has been finished. More...
 
void reset_zoom ()
 Reset zoom. More...
 
void set_zoom (unsigned int zoom)
 Set zoom. More...
 
void get_zoom (unsigned int &zoom)
 Get zoom. More...
 
void set_zoom_speed_tele (unsigned int speed)
 Set zoom speed in tele. More...
 
void set_zoom_speed_wide (unsigned int speed)
 Set zoom speed in wide angle. More...
 
void set_zoom_digital_enabled (bool enabled)
 Enable or disable digital zoome. More...
 
void reset_effect ()
 Reset effects. More...
 
void apply_effect (unsigned char effect)
 Apply effect. More...
 
void apply_effect_pastel ()
 Apply pastel effect. More...
 
void apply_effect_neg_art ()
 Apply negative art effect. More...
 
void apply_effect_sepia ()
 Apply sepia effect. More...
 
void apply_effect_bnw ()
 Apply B/W effect. More...
 
void apply_effect_solarize ()
 Apply solarize effect. More...
 
void apply_effect_mosaic ()
 Apply mosaic effect. More...
 
void apply_effect_slim ()
 Apply slim effect. More...
 
void apply_effect_stretch ()
 Apply stretch effect. More...
 
unsigned int get_white_balance_mode ()
 Get white balance mode. More...
 
bool get_mirror ()
 Get mirror sate. More...
 
void set_mirror (bool mirror)
 Sett mirror sate. More...
 

Static Public Attributes

static const int MAX_PAN = 1440
 Maximum pan. More...
 
static const int MIN_PAN = -1439
 Minimum pan. More...
 
static const int MAX_TILT = 360
 Max Tilt. More...
 
static const int MIN_TILT = - 359
 Min tilt . More...
 
static const float MAX_PAN_DEG = 100.f
 Max pan in degrees. More...
 
static const float MIN_PAN_DEG = -100.f
 Min pan in degrees. More...
 
static const float MAX_TILT_DEG = 25.f
 Max tilt in degrees. More...
 
static const float MIN_TILT_DEG = - 25.f
 Min tilt in degrees. More...
 
static const float MAX_PAN_RAD = deg2rad(MAX_PAN_DEG)
 Max pan in rad. More...
 
static const float MIN_PAN_RAD = deg2rad(MIN_PAN_DEG)
 Min pan in rad. More...
 
static const float MAX_TILT_RAD = deg2rad(MAX_TILT_DEG)
 Max tilt in rad. More...
 
static const float MIN_TILT_RAD = deg2rad(MIN_TILT_DEG)
 Min tilt in rad. More...
 
static const float PAN_STEPS_PER_DEG = MAX_PAN / MAX_PAN_DEG
 Pan steps per degree. More...
 
static const float TILT_STEPS_PER_DEG = MAX_TILT / MAX_TILT_DEG
 Tilt steps per degree. More...
 
static const float PAN_STEPS_PER_RAD = MAX_PAN / MAX_PAN_RAD
 Pan steps per rad. More...
 
static const float TILT_STEPS_PER_RAD = MAX_TILT / MAX_TILT_RAD
 Tilt steps per rad. More...
 
static const unsigned int EFFECT_PASTEL = 1
 Pastel effect. More...
 
static const unsigned int EFFECT_NEGATIVE = 2
 Negative effect. More...
 
static const unsigned int EFFECT_SEPIA = 3
 Sepia effect. More...
 
static const unsigned int EFFECT_BW = 4
 B/W effect. More...
 
static const unsigned int EFFECT_SOLARIZE = 5
 Solarize effect. More...
 
static const unsigned int EFFECT_MOSAIC = 6
 Mosaic effect. More...
 
static const unsigned int EFFECT_SLIM = 7
 Slim effect. More...
 
static const unsigned int EFFECT_STRETCH = 8
 Stretch effect. More...
 
static const float SPEED_TABLE_PAN [SONY_EVID100P_NUM_PAN_SPEEDS]
 Speed table for supported pan speed values in radians. More...
 
static const float SPEED_TABLE_TILT [SONY_EVID100P_NUM_TILT_SPEEDS]
 Speed table for supported tilt speed values in radians. More...
 
- Static Public Attributes inherited from Visca
static const unsigned int VISCA_WHITEBLANCE_AUTO = VISCA_WB_AUTO
 Automatic white balance. More...
 
static const unsigned int VISCA_WHITEBALANCE_INDOOR = VISCA_WB_INDOOR
 Indoor white balance preset. More...
 
static const unsigned int VISCA_WHITEBALANCE_OUTDOOR = VISCA_WB_OUTDOOR
 Outdoor white balance preset. More...
 
static const unsigned int VISCA_WHITEBALANCE_ONE_PUSH = VISCA_WB_ONE_PUSH
 One push white balance preset. More...
 
static const unsigned int VISCA_WHITEBALANCE_ATW = VISCA_WB_ATW
 ATW white balance preset. More...
 
static const unsigned int VISCA_WHITEBALANCE_MANUAL = VISCA_WB_MANUAL
 Manual white balance. More...
 
static const unsigned int NONBLOCKING_PANTILT = 0
 Non-blocking pan/tilt item. More...
 
static const unsigned int NONBLOCKING_ZOOM = 1
 Non-blocking zoom item. More...
 
static const unsigned int NONBLOCKING_NUM = 2
 Number of non-blocking items. More...
 
static const unsigned int MAX_PAN_SPEED = 0x18
 Number of non-blocking items. More...
 
static const unsigned int MAX_TILT_SPEED = 0x14
 Number of non-blocking items. More...
 
static const unsigned int VISCA_ZOOM_VALUE_WIDE = 0x0000
 Zoom value: wide. More...
 
static const unsigned int VISCA_ZOOM_VALUE_1X = 0x0E6D
 Zoom value: 1x. More...
 
static const unsigned int VISCA_ZOOM_VALUE_2X = 0x188E
 Zoom value: 2x. More...
 
static const unsigned int VISCA_ZOOM_VALUE_3X = 0x2507
 Zoom value: 3x. More...
 
static const unsigned int VISCA_ZOOM_VALUE_4X = 0x2B82
 Zoom value: 4x. More...
 
static const unsigned int VISCA_ZOOM_VALUE_5X = 0x3130
 Zoom value: 5x. More...
 
static const unsigned int VISCA_ZOOM_VALUE_6X = 0x352E
 Zoom value: 6x. More...
 
static const unsigned int VISCA_ZOOM_VALUE_7X = 0x385D
 Zoom value: 7x. More...
 
static const unsigned int VISCA_ZOOM_VALUE_8X = 0x3B48
 Zoom value: 8x. More...
 
static const unsigned int VISCA_ZOOM_VALUE_9X = 0x3E01
 Zoom value: 9x. More...
 
static const unsigned int VISCA_ZOOM_VALUE_10X = 0x4000
 Zoom value: 10x. More...
 
static const unsigned int VISCA_ZOOM_VALUE_DIG_20X = 0x5000
 Zoom value: 20x. More...
 
static const unsigned int VISCA_ZOOM_VALUE_DIG_30X = 0x6000
 Zoom value: 30x. More...
 
static const unsigned int VISCA_ZOOM_VALUE_DIG_40X = 0x7000
 Zoom value: 40x. More...
 

Detailed Description

Sony EviD100P Visca controller.

This sub-class using the Visca protocol contains some constants specific for the Sony EviD100P camera.

Author
Tim Niemueller

Definition at line 32 of file evid100p.h.

Constructor & Destructor Documentation

◆ SonyEviD100PVisca()

SonyEviD100PVisca::SonyEviD100PVisca ( const char *  device_file,
unsigned int  def_timeout_ms = 30,
bool  blocking = true 
)

Constructor.

Parameters
device_fileserial device file (e.g. /dev/ttyUSB0)
def_timeout_msdefault read timeout, used if no specific timeout is passed
blockingtrue to make gathering pan/tilt information wait for the reponse, false to be able to split the operation

Definition at line 117 of file evid100p.cpp.

◆ ~SonyEviD100PVisca()

SonyEviD100PVisca::~SonyEviD100PVisca ( )

Destructor.

Definition at line 126 of file evid100p.cpp.

Member Function Documentation

◆ get_pan_tilt_rad()

void SonyEviD100PVisca::get_pan_tilt_rad ( float &  pan,
float &  tilt 
)

Get pan/tilt in radians.

Parameters
panupon return contains the current pan value
tiltupone return contains the current tilt value

Definition at line 159 of file evid100p.cpp.

References Visca::get_pan_tilt(), and PAN_STEPS_PER_RAD.

Referenced by PanTiltSonyEviD100PThread::bb_interface_message_received().

◆ get_speed_limits()

void SonyEviD100PVisca::get_speed_limits ( float &  pan_min,
float &  pan_max,
float &  tilt_min,
float &  tilt_max 
)

Get speed limits.

Parameters
pan_minminimum pan speed possible
pan_maxmaximum pan speed possible
tilt_minminimum tilt speed possible
tilt_maxmaximum tilt speed possible

Definition at line 243 of file evid100p.cpp.

References SPEED_TABLE_PAN, and SPEED_TABLE_TILT.

Referenced by PanTiltSonyEviD100PThread::init().

◆ get_speed_radsec()

void SonyEviD100PVisca::get_speed_radsec ( float &  pan_speed,
float &  tilt_speed 
)

Get current speed in rad/sec.

Parameters
pan_speedupon return contains pan speed in rad/sec
tilt_speedupon return contains tilt speed in rad/sec

Definition at line 227 of file evid100p.cpp.

References Visca::get_pan_tilt_speed(), SPEED_TABLE_PAN, and SPEED_TABLE_TILT.

◆ set_pan_tilt_rad()

void SonyEviD100PVisca::set_pan_tilt_rad ( float  pan,
float  tilt 
)

Set pan/tilt in radians.

Parameters
panpan value in radians
tilttilt value in radians

Definition at line 136 of file evid100p.cpp.

References MAX_PAN_RAD, MAX_TILT_RAD, MIN_PAN_RAD, MIN_TILT_RAD, PAN_STEPS_PER_RAD, Visca::set_pan_tilt(), and TILT_STEPS_PER_RAD.

Referenced by PanTiltSonyEviD100PThread::bb_interface_message_received().

◆ set_speed_radsec()

void SonyEviD100PVisca::set_speed_radsec ( float  pan_speed,
float  tilt_speed 
)

Set speed given in rad/sec.

Note that not the exact speed is taken, but rather the closes equivalent in motor ticks is taken.

Parameters
pan_speeddesired pan speed in rad/sec
tilt_speeddesired tilt speed in rad/sec
Exceptions
OutOfBoundsExceptionthrown if desired speed is out of range

Definition at line 177 of file evid100p.cpp.

References Visca::set_pan_tilt_speed(), SPEED_TABLE_PAN, and SPEED_TABLE_TILT.

Referenced by PanTiltSonyEviD100PThread::bb_interface_message_received().

Member Data Documentation

◆ EFFECT_BW

const unsigned int SonyEviD100PVisca::EFFECT_BW = 4
static

B/W effect.

Definition at line 72 of file evid100p.h.

◆ EFFECT_MOSAIC

const unsigned int SonyEviD100PVisca::EFFECT_MOSAIC = 6
static

Mosaic effect.

Definition at line 74 of file evid100p.h.

◆ EFFECT_NEGATIVE

const unsigned int SonyEviD100PVisca::EFFECT_NEGATIVE = 2
static

Negative effect.

Definition at line 70 of file evid100p.h.

◆ EFFECT_PASTEL

const unsigned int SonyEviD100PVisca::EFFECT_PASTEL = 1
static

Pastel effect.

Definition at line 69 of file evid100p.h.

◆ EFFECT_SEPIA

const unsigned int SonyEviD100PVisca::EFFECT_SEPIA = 3
static

Sepia effect.

Definition at line 71 of file evid100p.h.

◆ EFFECT_SLIM

const unsigned int SonyEviD100PVisca::EFFECT_SLIM = 7
static

Slim effect.

Definition at line 75 of file evid100p.h.

◆ EFFECT_SOLARIZE

const unsigned int SonyEviD100PVisca::EFFECT_SOLARIZE = 5
static

Solarize effect.

Definition at line 73 of file evid100p.h.

◆ EFFECT_STRETCH

const unsigned int SonyEviD100PVisca::EFFECT_STRETCH = 8
static

Stretch effect.

Definition at line 76 of file evid100p.h.

◆ MAX_PAN

const int SonyEviD100PVisca::MAX_PAN = 1440
static

Maximum pan.

Definition at line 48 of file evid100p.h.

◆ MAX_PAN_DEG

const float SonyEviD100PVisca::MAX_PAN_DEG = 100.f
static

Max pan in degrees.

Definition at line 53 of file evid100p.h.

◆ MAX_PAN_RAD

const float SonyEviD100PVisca::MAX_PAN_RAD = deg2rad(MAX_PAN_DEG)
static

Max pan in rad.

Definition at line 58 of file evid100p.h.

Referenced by PanTiltSonyEviD100PThread::init(), and set_pan_tilt_rad().

◆ MAX_TILT

const int SonyEviD100PVisca::MAX_TILT = 360
static

Max Tilt.

Definition at line 50 of file evid100p.h.

◆ MAX_TILT_DEG

const float SonyEviD100PVisca::MAX_TILT_DEG = 25.f
static

Max tilt in degrees.

Definition at line 55 of file evid100p.h.

◆ MAX_TILT_RAD

const float SonyEviD100PVisca::MAX_TILT_RAD = deg2rad(MAX_TILT_DEG)
static

Max tilt in rad.

Definition at line 60 of file evid100p.h.

Referenced by PanTiltSonyEviD100PThread::init(), and set_pan_tilt_rad().

◆ MIN_PAN

const int SonyEviD100PVisca::MIN_PAN = -1439
static

Minimum pan.

Definition at line 49 of file evid100p.h.

◆ MIN_PAN_DEG

const float SonyEviD100PVisca::MIN_PAN_DEG = -100.f
static

Min pan in degrees.

Definition at line 54 of file evid100p.h.

◆ MIN_PAN_RAD

const float SonyEviD100PVisca::MIN_PAN_RAD = deg2rad(MIN_PAN_DEG)
static

Min pan in rad.

Definition at line 59 of file evid100p.h.

Referenced by PanTiltSonyEviD100PThread::init(), and set_pan_tilt_rad().

◆ MIN_TILT

const int SonyEviD100PVisca::MIN_TILT = - 359
static

Min tilt .

Definition at line 51 of file evid100p.h.

◆ MIN_TILT_DEG

const float SonyEviD100PVisca::MIN_TILT_DEG = - 25.f
static

Min tilt in degrees.

Definition at line 56 of file evid100p.h.

◆ MIN_TILT_RAD

const float SonyEviD100PVisca::MIN_TILT_RAD = deg2rad(MIN_TILT_DEG)
static

Min tilt in rad.

Definition at line 61 of file evid100p.h.

Referenced by PanTiltSonyEviD100PThread::init(), and set_pan_tilt_rad().

◆ PAN_STEPS_PER_DEG

const float SonyEviD100PVisca::PAN_STEPS_PER_DEG = MAX_PAN / MAX_PAN_DEG
static

Pan steps per degree.

Definition at line 63 of file evid100p.h.

◆ PAN_STEPS_PER_RAD

const float SonyEviD100PVisca::PAN_STEPS_PER_RAD = MAX_PAN / MAX_PAN_RAD
static

Pan steps per rad.

Definition at line 66 of file evid100p.h.

Referenced by get_pan_tilt_rad(), and set_pan_tilt_rad().

◆ SPEED_TABLE_PAN

const float SonyEviD100PVisca::SPEED_TABLE_PAN
static
Initial value:
=
{0.03548, 0.04138, 0.05319, 0.06497, 0.08262, 0.10608, 0.12951, 0.15865,
0.19933, 0.24535, 0.30159, 0.35137, 0.43540, 0.53611, 0.67246, 0.81519,
0.99870, 1.20673, 1.45304, 1.70703, 1.99278, 2.25729, 2.44293, 2.71852}

Speed table for supported pan speed values in radians.

Has been created empirically.

Definition at line 78 of file evid100p.h.

Referenced by get_speed_limits(), get_speed_radsec(), and set_speed_radsec().

◆ SPEED_TABLE_TILT

const float SonyEviD100PVisca::SPEED_TABLE_TILT
static
Initial value:
=
{0.03541, 0.04127, 0.05298, 0.06449, 0.08195, 0.10480, 0.12741, 0.15535,
0.19356, 0.23685, 0.28438, 0.33367, 0.41066, 0.49517, 0.59622, 0.71474,
0.83085, 0.97431, 1.08745, 1.20977}

Speed table for supported tilt speed values in radians.

Has been created empirically.

Definition at line 79 of file evid100p.h.

Referenced by get_speed_limits(), get_speed_radsec(), and set_speed_radsec().

◆ TILT_STEPS_PER_DEG

const float SonyEviD100PVisca::TILT_STEPS_PER_DEG = MAX_TILT / MAX_TILT_DEG
static

Tilt steps per degree.

Definition at line 64 of file evid100p.h.

◆ TILT_STEPS_PER_RAD

const float SonyEviD100PVisca::TILT_STEPS_PER_RAD = MAX_TILT / MAX_TILT_RAD
static

Tilt steps per rad.

Definition at line 67 of file evid100p.h.

Referenced by set_pan_tilt_rad().


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