Fawkes API
Fawkes Development Version
|
Sony EviD100P Visca controller. More...
#include "evid100p.h"
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... | |
![]() | |
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 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... | |
Sony EviD100P Visca controller.
This sub-class using the Visca protocol contains some constants specific for the Sony EviD100P camera.
Definition at line 32 of file evid100p.h.
SonyEviD100PVisca::SonyEviD100PVisca | ( | const char * | device_file, |
unsigned int | def_timeout_ms = 30 , |
||
bool | blocking = true |
||
) |
Constructor.
device_file | serial device file (e.g. /dev/ttyUSB0) |
def_timeout_ms | default read timeout, used if no specific timeout is passed |
blocking | true 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 | ( | ) |
Destructor.
Definition at line 126 of file evid100p.cpp.
void SonyEviD100PVisca::get_pan_tilt_rad | ( | float & | pan, |
float & | tilt | ||
) |
Get pan/tilt in radians.
pan | upon return contains the current pan value |
tilt | upone 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().
void SonyEviD100PVisca::get_speed_limits | ( | float & | pan_min, |
float & | pan_max, | ||
float & | tilt_min, | ||
float & | tilt_max | ||
) |
Get speed limits.
pan_min | minimum pan speed possible |
pan_max | maximum pan speed possible |
tilt_min | minimum tilt speed possible |
tilt_max | maximum tilt speed possible |
Definition at line 243 of file evid100p.cpp.
References SPEED_TABLE_PAN, and SPEED_TABLE_TILT.
Referenced by PanTiltSonyEviD100PThread::init().
void SonyEviD100PVisca::get_speed_radsec | ( | float & | pan_speed, |
float & | tilt_speed | ||
) |
Get current speed in rad/sec.
pan_speed | upon return contains pan speed in rad/sec |
tilt_speed | upon 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.
void SonyEviD100PVisca::set_pan_tilt_rad | ( | float | pan, |
float | tilt | ||
) |
Set pan/tilt in radians.
pan | pan value in radians |
tilt | tilt 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().
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.
pan_speed | desired pan speed in rad/sec |
tilt_speed | desired tilt speed in rad/sec |
OutOfBoundsException | thrown 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().
|
static |
B/W effect.
Definition at line 72 of file evid100p.h.
|
static |
Mosaic effect.
Definition at line 74 of file evid100p.h.
|
static |
Negative effect.
Definition at line 70 of file evid100p.h.
|
static |
Pastel effect.
Definition at line 69 of file evid100p.h.
|
static |
Sepia effect.
Definition at line 71 of file evid100p.h.
|
static |
Slim effect.
Definition at line 75 of file evid100p.h.
|
static |
Solarize effect.
Definition at line 73 of file evid100p.h.
|
static |
Stretch effect.
Definition at line 76 of file evid100p.h.
|
static |
Maximum pan.
Definition at line 48 of file evid100p.h.
|
static |
Max pan in degrees.
Definition at line 53 of file evid100p.h.
|
static |
Max pan in rad.
Definition at line 58 of file evid100p.h.
Referenced by PanTiltSonyEviD100PThread::init(), and set_pan_tilt_rad().
|
static |
Max Tilt.
Definition at line 50 of file evid100p.h.
|
static |
Max tilt in degrees.
Definition at line 55 of file evid100p.h.
|
static |
Max tilt in rad.
Definition at line 60 of file evid100p.h.
Referenced by PanTiltSonyEviD100PThread::init(), and set_pan_tilt_rad().
|
static |
Minimum pan.
Definition at line 49 of file evid100p.h.
|
static |
Min pan in degrees.
Definition at line 54 of file evid100p.h.
|
static |
Min pan in rad.
Definition at line 59 of file evid100p.h.
Referenced by PanTiltSonyEviD100PThread::init(), and set_pan_tilt_rad().
|
static |
Min tilt .
Definition at line 51 of file evid100p.h.
|
static |
Min tilt in degrees.
Definition at line 56 of file evid100p.h.
|
static |
Min tilt in rad.
Definition at line 61 of file evid100p.h.
Referenced by PanTiltSonyEviD100PThread::init(), and set_pan_tilt_rad().
|
static |
Pan steps per degree.
Definition at line 63 of file evid100p.h.
|
static |
Pan steps per rad.
Definition at line 66 of file evid100p.h.
Referenced by get_pan_tilt_rad(), and set_pan_tilt_rad().
|
static |
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().
|
static |
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().
|
static |
Tilt steps per degree.
Definition at line 64 of file evid100p.h.
|
static |