#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. | |
~SonyEviD100PVisca () | |
Destructor. | |
void | get_pan_tilt_rad (float &pan, float &tilt) |
Get pan/tilt in radians. | |
void | set_pan_tilt_rad (float pan, float tilt) |
Set pan/tilt in radians. | |
void | set_speed_radsec (float pan_speed, float tilt_speed) |
Set speed given in rad/sec. | |
void | get_speed_radsec (float &pan_speed, float &tilt_speed) |
Get current speed in rad/sec. | |
void | get_speed_limits (float &pan_min, float &pan_max, float &tilt_min, float &tilt_max) |
Get speed limits. | |
Static Public Attributes | |
static const int | MAX_PAN = 1440 |
Maximum pan. | |
static const int | MIN_PAN = -1439 |
Minimum pan. | |
static const int | MAX_TILT = 360 |
Max Tilt. | |
static const int | MIN_TILT = - 359 |
Min tilt . | |
static const float | MAX_PAN_DEG = 100.f |
Max pan in degrees. | |
static const float | MIN_PAN_DEG = -100.f |
Min pan in degrees. | |
static const float | MAX_TILT_DEG = 25.f |
Max tilt in degrees. | |
static const float | MIN_TILT_DEG = - 25.f |
Min tilt in degrees. | |
static const float | MAX_PAN_RAD = deg2rad(MAX_PAN_DEG) |
Max pan in rad. | |
static const float | MIN_PAN_RAD = deg2rad(MIN_PAN_DEG) |
Min pan in rad. | |
static const float | MAX_TILT_RAD = deg2rad(MAX_TILT_DEG) |
Max tilt in rad. | |
static const float | MIN_TILT_RAD = deg2rad(MIN_TILT_DEG) |
Min tilt in rad. | |
static const float | PAN_STEPS_PER_DEG = MAX_PAN / MAX_PAN_DEG |
Pan steps per degree. | |
static const float | TILT_STEPS_PER_DEG = MAX_TILT / MAX_TILT_DEG |
Tilt steps per degree. | |
static const float | PAN_STEPS_PER_RAD = MAX_PAN / MAX_PAN_RAD |
Pan steps per rad. | |
static const float | TILT_STEPS_PER_RAD = MAX_TILT / MAX_TILT_RAD |
Tilt steps per rad. | |
static const unsigned int | EFFECT_PASTEL = 1 |
Pastel effect. | |
static const unsigned int | EFFECT_NEGATIVE = 2 |
Negative effect. | |
static const unsigned int | EFFECT_SEPIA = 3 |
Sepia effect. | |
static const unsigned int | EFFECT_BW = 4 |
B/W effect. | |
static const unsigned int | EFFECT_SOLARIZE = 5 |
Solarize effect. | |
static const unsigned int | EFFECT_MOSAIC = 6 |
Mosaic effect. | |
static const unsigned int | EFFECT_SLIM = 7 |
Slim effect. | |
static const unsigned int | EFFECT_STRETCH = 8 |
Stretch effect. | |
static const float | SPEED_TABLE_PAN [SONY_EVID100P_NUM_PAN_SPEEDS] |
Speed table for supported pan speed values in radians. | |
static const float | SPEED_TABLE_TILT [SONY_EVID100P_NUM_TILT_SPEEDS] |
Speed table for supported tilt speed values in radians. |
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 | ( | ) |
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.
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.
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.
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.
const unsigned int SonyEviD100PVisca::EFFECT_BW = 4 [static] |
const unsigned int SonyEviD100PVisca::EFFECT_MOSAIC = 6 [static] |
const unsigned int SonyEviD100PVisca::EFFECT_NEGATIVE = 2 [static] |
const unsigned int SonyEviD100PVisca::EFFECT_PASTEL = 1 [static] |
const unsigned int SonyEviD100PVisca::EFFECT_SEPIA = 3 [static] |
const unsigned int SonyEviD100PVisca::EFFECT_SLIM = 7 [static] |
const unsigned int SonyEviD100PVisca::EFFECT_SOLARIZE = 5 [static] |
const unsigned int SonyEviD100PVisca::EFFECT_STRETCH = 8 [static] |
const int SonyEviD100PVisca::MAX_PAN = 1440 [static] |
const float SonyEviD100PVisca::MAX_PAN_DEG = 100.f [static] |
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().
const int SonyEviD100PVisca::MAX_TILT = 360 [static] |
const float SonyEviD100PVisca::MAX_TILT_DEG = 25.f [static] |
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().
const int SonyEviD100PVisca::MIN_PAN = -1439 [static] |
const float SonyEviD100PVisca::MIN_PAN_DEG = -100.f [static] |
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().
const int SonyEviD100PVisca::MIN_TILT = - 359 [static] |
const float SonyEviD100PVisca::MIN_TILT_DEG = - 25.f [static] |
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().
const float SonyEviD100PVisca::PAN_STEPS_PER_DEG = MAX_PAN / MAX_PAN_DEG [static] |
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().
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}
Has been created empirically.
Definition at line 78 of file evid100p.h.
Referenced by get_speed_limits(), get_speed_radsec(), and set_speed_radsec().
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}
Has been created empirically.
Definition at line 79 of file evid100p.h.
Referenced by get_speed_limits(), get_speed_radsec(), and set_speed_radsec().
const float SonyEviD100PVisca::TILT_STEPS_PER_DEG = MAX_TILT / MAX_TILT_DEG [static] |
const float SonyEviD100PVisca::TILT_STEPS_PER_RAD = MAX_TILT / MAX_TILT_RAD [static] |