ViSP
2.8.0
|
#include <vpServolens.h>
Public Types | |
enum | vpServoType { ZOOM = 1, FOCUS = 2, IRIS = 3 } |
enum | vpLimitsType { ZOOM_MAX = 10000, ZOOM_MIN = 1000, FOCUS_MAX = 1500, FOCUS_MIN = 100, IRIS_MAX = 1000, IRIS_MIN = 160 } |
enum | vpControllerType { AUTO = 1, CONTROLLED = 2, RELEASED = 3 } |
Public Member Functions | |
vpServolens () | |
vpServolens (const char *port) | |
~vpServolens () | |
void | open (const char *port="/dev/ttyS0") |
void | close () |
void | reset () |
void | setController (vpControllerType controller) |
void | setAutoIris (bool enable) |
void | setPosition (vpServoType servo, unsigned int position) |
bool | getPosition (vpServoType servo, unsigned int &position) |
vpCameraParameters | getCameraParameters (vpImage< unsigned char > &I) |
void | enablePrompt (bool active) |
Interface for the Servolens lens attached to the camera fixed on the Afma4 robot.
The code below shows how to manipulate this class to get and modify the position of the focal lens.
Definition at line 95 of file vpServolens.h.
Enumerator | |
---|---|
AUTO | |
CONTROLLED | |
RELEASED |
Definition at line 111 of file vpServolens.h.
Enumerator | |
---|---|
ZOOM_MAX | |
ZOOM_MIN | |
FOCUS_MAX | |
FOCUS_MIN | |
IRIS_MAX | |
IRIS_MIN |
Definition at line 103 of file vpServolens.h.
Enumerator | |
---|---|
ZOOM | |
FOCUS | |
IRIS |
Definition at line 98 of file vpServolens.h.
vpServolens::vpServolens | ( | ) |
vpServolens::vpServolens | ( | const char * | port | ) |
Open and initialize the Servolens serial link at 9600 bauds, 7 data bits, even parity, 1 stop bit. The cariage return mode is not active, that means that each character is directly read without waitong for a cariage return.
Definition at line 87 of file vpServolens.cpp.
References open().
vpServolens::~vpServolens | ( | ) |
Destructor.
Close the Servolens serial link.
Definition at line 101 of file vpServolens.cpp.
References close().
void vpServolens::close | ( | ) |
Close the Servolens serial link.
Definition at line 197 of file vpServolens.cpp.
Referenced by open(), and ~vpServolens().
void vpServolens::enablePrompt | ( | bool | active | ) |
Enable or disable the emission of the Servolens prompt "SERVOLENS>".
active | : true to activate the emission of the prompy. false to disable this functionality. |
vpRobotException::communicationError | : If cannot dial with Servolens. |
Definition at line 334 of file vpServolens.cpp.
References vpRobotException::communicationError, and vpERROR_TRACE.
vpCameraParameters vpServolens::getCameraParameters | ( | vpImage< unsigned char > & | I | ) |
These parameters are computed from the Dragonfly2 DR2-COL camera sensor pixel size (7.4 um) and from the servolens zoom position.
I | : An image coming from the Dragonfly2 camera attached to the servolens. |
Definition at line 652 of file vpServolens.cpp.
References vpRobotException::communicationError, vpImage< Type >::getHeight(), getPosition(), vpImage< Type >::getWidth(), vpCameraParameters::initPersProjWithoutDistortion(), vpERROR_TRACE, and ZOOM.
bool vpServolens::getPosition | ( | vpServoType | servo, |
unsigned int & | position | ||
) |
Get the Servolens current servo position.
servo | : Servolens servo motor to actuate. |
position | : Measured position of the servo. |
vpRobotException::communicationError | : If cannot dial with Servolens. |
Definition at line 514 of file vpServolens.cpp.
References vpRobotException::communicationError, FOCUS, IRIS, vpERROR_TRACE, and ZOOM.
Referenced by getCameraParameters(), and open().
void vpServolens::open | ( | const char * | port = "/dev/ttyS0" | ) |
Open and initialize the Servolens serial link at 9600 bauds, 7 data bits, even parity, 1 stop bit. The cariage return mode is not active, that means that each character is directly read without waitong for a cariage return.
port | : Serial device like /dev/ttyS0 or /dev/ttya. |
vpRobotException::communicationError | : If cannot open Servolens serial port or intialize the serial link. |
Definition at line 121 of file vpServolens.cpp.
References close(), vpRobotException::communicationError, getPosition(), vpERROR_TRACE, and ZOOM.
Referenced by vpServolens().
void vpServolens::reset | ( | ) |
Reset the Servolens.
vpRobotException::communicationError | : If cannot dial with Servolens. |
Definition at line 213 of file vpServolens.cpp.
References vpRobotException::communicationError, vpERROR_TRACE, and vpTime::wait().
void vpServolens::setAutoIris | ( | bool | enable | ) |
Activates the auto iris mode of the Servolens.
enable | : true to activate the auto iris. |
Definition at line 402 of file vpServolens.cpp.
References vpRobotException::communicationError, and vpERROR_TRACE.
void vpServolens::setController | ( | vpControllerType | controller | ) |
Set the controller type.
controller | : Controller type. |
vpRobotException::communicationError | : If cannot dial with Servolens. |
Definition at line 361 of file vpServolens.cpp.
References AUTO, vpRobotException::communicationError, CONTROLLED, RELEASED, and vpERROR_TRACE.
void vpServolens::setPosition | ( | vpServoType | servo, |
unsigned int | position | ||
) |
Set the Servolens servo to the desired position.
servo | : Servolens servo motor to actuate. |
position | : Desired position of the servo. |
vpRobotException::communicationError | : If cannot dial with Servolens. |
Definition at line 430 of file vpServolens.cpp.
References vpRobotException::communicationError, FOCUS, FOCUS_MAX, IRIS, IRIS_MAX, vpERROR_TRACE, ZOOM, and ZOOM_MIN.