Basic Image AlgorithmS Library
2.8.0
|
Basic controller interface for Directed Perception Pan Tilt Unit. More...
#include <PanTilt/DPPanTiltControl.hh>
Public Types | |
enum | DPPanTiltStepping { AUTO = 0, HALF, QUARTER, EIGHTH, FULL } |
Public Member Functions | |
void | AwaitCompletion () |
Await completion of currently executed command. More... | |
void | ClosePanTiltUnit () |
closes the comport stream connected to PTU More... | |
DPPanTiltControl () | |
Standard constructor. More... | |
void | GetAcceleration (long &panAcc, long &tiltAcc) |
void | GetCurrentPosition (long &lPanPos, long &lTiltPos) |
void | GetCurrentPositionDegrees (double &dPanDeg, double &dTiltDeg) |
void | GetCurrentPositionRadians (double &dPanRad, double &dTiltRad) |
double | GetPanResolution () |
Get the resolution of the pan axis. More... | |
void | GetSpeed (long &panSpeed, long &tiltSpeed) |
double | GetTiltResolution () |
Get the resolution of the tilt axis. More... | |
bool | InitPanTiltUnit (int nPort, bool bUSB=false) |
Open the given serial port and initialize the pan tilt unit. More... | |
bool | InitPanTiltUnit (const char *portName) |
Open the given port and initialize the pan tilt unit. More... | |
void | MoveDown (int nValue) |
Move camera nValue steps downwards. More... | |
void | MoveLeft (int nValue) |
Move camera nValue steps left. More... | |
void | MoveRight (int nValue) |
Move camera nValue steps right. More... | |
void | MoveUp (int nValue) |
Move camera nValue steps upwards. More... | |
void | QueryResolution (double &panResolution, double &tiltResolution, bool updateInternal=false) |
Get resolution of the motor. More... | |
int | ReadRawLine (std::string &cmd) |
Read a line from the serial (or USB) port. More... | |
bool | ResetPanTiltUnit () |
Reset the position of the pan tilt unit to 0. More... | |
void | SendRawCommand (std::string cmd) |
Send a command string terminated by a space or carriage return character to the serial (or USB) port. More... | |
char | SetAcceleration (int nPanAcc, int nTiltAcc) |
Set acceleration for movement. More... | |
int | SetMode (int nMode) |
Set the mode in which the camera is to operate. More... | |
int | SetMotorStepping (int panStepping, int tiltStepping) |
Set the stepping of the motor. More... | |
void | SetPosition (int nPanPos, int nTiltPos, bool bWaitComplete=true) |
Set the current position of the PTU in steps. More... | |
char | SetSpeed (int nPanSpeed, int nTiltSpeed) |
Set speed for movement. More... | |
void | StartCircularMovement () |
Start a thread moving the PTU in a circle. More... | |
void | StopPanTiltUnit () |
Stop the currently moving pan tilt unit. More... | |
void | UseDefaultOrientation (bool use) |
Set the orientation of the PTU (default or upside-down). More... | |
~DPPanTiltControl () | |
Standard destructor. More... | |
Protected Attributes | |
bool | bDefaultOrientation_ |
portstream_fd | COMstream_ |
short int | maxSpeed_ |
double | panResolution_ |
double | tiltResolution_ |
Basic controller interface for Directed Perception Pan Tilt Unit.
Definition at line 69 of file DPPanTiltControl.hh.
Enumerator | |
---|---|
AUTO | |
HALF | |
QUARTER | |
EIGHTH | |
FULL |
Definition at line 73 of file DPPanTiltControl.hh.
DPPanTiltControl::DPPanTiltControl | ( | ) |
Standard constructor.
Definition at line 12 of file DPPanTiltControl.cpp.
DPPanTiltControl::~DPPanTiltControl | ( | ) |
Standard destructor.
Definition at line 20 of file DPPanTiltControl.cpp.
void DPPanTiltControl::AwaitCompletion | ( | ) |
Await completion of currently executed command.
Definition at line 90 of file DPPanTiltControl.cpp.
void DPPanTiltControl::ClosePanTiltUnit | ( | ) |
closes the comport stream connected to PTU
Definition at line 156 of file DPPanTiltControl.cpp.
Referenced by BIAS::PanTiltAutoControl::~PanTiltAutoControl().
void DPPanTiltControl::GetAcceleration | ( | long & | panAcc, |
long & | tiltAcc | ||
) |
Definition at line 190 of file DPPanTiltControl.cpp.
void DPPanTiltControl::GetCurrentPosition | ( | long & | lPanPos, |
long & | lTiltPos | ||
) |
Definition at line 229 of file DPPanTiltControl.cpp.
Referenced by BIAS::PanTiltAutoControl::StartControl(), BIAS::PanTiltAutoControl::StartMoveTo(), and BIAS::DPPanTiltControlExtended::threadFuncCircle_().
void DPPanTiltControl::GetCurrentPositionDegrees | ( | double & | dPanDeg, |
double & | dTiltDeg | ||
) |
Definition at line 236 of file DPPanTiltControl.cpp.
void DPPanTiltControl::GetCurrentPositionRadians | ( | double & | dPanRad, |
double & | dTiltRad | ||
) |
Definition at line 243 of file DPPanTiltControl.cpp.
|
inline |
Get the resolution of the pan axis.
Definition at line 141 of file DPPanTiltControl.hh.
void DPPanTiltControl::GetSpeed | ( | long & | panSpeed, |
long & | tiltSpeed | ||
) |
Definition at line 176 of file DPPanTiltControl.cpp.
|
inline |
Get the resolution of the tilt axis.
Definition at line 145 of file DPPanTiltControl.hh.
bool DPPanTiltControl::InitPanTiltUnit | ( | int | nPort, |
bool | bUSB = false |
||
) |
Open the given serial port and initialize the pan tilt unit.
[in] | nPort | The number of the serial port (or USB port) |
[in] | bUSB | Use USB port instead of serial port |
Definition at line 95 of file DPPanTiltControl.cpp.
bool DPPanTiltControl::InitPanTiltUnit | ( | const char * | portName | ) |
Open the given port and initialize the pan tilt unit.
[in] | portName | The name of the serial port or USB port to open, e.g. /dev/ttyUSB0 |
Definition at line 114 of file DPPanTiltControl.cpp.
void DPPanTiltControl::MoveDown | ( | int | nValue | ) |
Move camera nValue steps downwards.
Definition at line 204 of file DPPanTiltControl.cpp.
Referenced by BIAS::DPPanTiltControlDialog::OnDown().
void DPPanTiltControl::MoveLeft | ( | int | nValue | ) |
Move camera nValue steps left.
Definition at line 212 of file DPPanTiltControl.cpp.
Referenced by BIAS::DPPanTiltControlDialog::OnLeft().
void DPPanTiltControl::MoveRight | ( | int | nValue | ) |
Move camera nValue steps right.
Definition at line 220 of file DPPanTiltControl.cpp.
Referenced by BIAS::DPPanTiltControlDialog::OnRight().
void DPPanTiltControl::MoveUp | ( | int | nValue | ) |
Move camera nValue steps upwards.
Definition at line 196 of file DPPanTiltControl.cpp.
Referenced by BIAS::DPPanTiltControlDialog::OnUp().
void DPPanTiltControl::QueryResolution | ( | double & | panResolution, |
double & | tiltResolution, | ||
bool | updateInternal = false |
||
) |
Get resolution of the motor.
[out] | panResolution | Return the pan resolution |
[out] | tiltResolution | Returns the tilt resolution |
Definition at line 430 of file DPPanTiltControl.cpp.
int DPPanTiltControl::ReadRawLine | ( | std::string & | cmd | ) |
Read a line from the serial (or USB) port.
Definition at line 269 of file DPPanTiltControl.cpp.
bool DPPanTiltControl::ResetPanTiltUnit | ( | ) |
Reset the position of the pan tilt unit to 0.
Definition at line 54 of file DPPanTiltControl.cpp.
Referenced by BIAS::DPPanTiltControlDialog::OnReset().
void DPPanTiltControl::SendRawCommand | ( | std::string | cmd | ) |
Send a command string terminated by a space or carriage return character to the serial (or USB) port.
Definition at line 264 of file DPPanTiltControl.cpp.
char DPPanTiltControl::SetAcceleration | ( | int | nPanAcc, |
int | nTiltAcc | ||
) |
Set acceleration for movement.
Definition at line 182 of file DPPanTiltControl.cpp.
int DPPanTiltControl::SetMode | ( | int | nMode | ) |
Set the mode in which the camera is to operate.
[in] | nMode | Defines the mode, 0 is speed control mode, 1 is absolute positioning mode |
Definition at line 24 of file DPPanTiltControl.cpp.
Referenced by BIAS::DPPanTiltControlDialog::OnQuit(), BIAS::PanTiltManualControl::StartControl(), BIAS::PanTiltAutoControl::StartControl(), BIAS::PanTiltAutoControl::StartMoveTo(), and BIAS::DPPanTiltControlExtended::threadFuncCircle_().
int DPPanTiltControl::SetMotorStepping | ( | int | panStepping, |
int | tiltStepping | ||
) |
Set the stepping of the motor.
Definition at line 279 of file DPPanTiltControl.cpp.
void DPPanTiltControl::SetPosition | ( | int | nPanPos, |
int | nTiltPos, | ||
bool | bWaitComplete = true |
||
) |
Set the current position of the PTU in steps.
Definition at line 250 of file DPPanTiltControl.cpp.
Referenced by BIAS::PanTiltManualControl::StartControl(), and BIAS::DPPanTiltControlExtended::threadFuncCircle_().
char DPPanTiltControl::SetSpeed | ( | int | nPanSpeed, |
int | nTiltSpeed | ||
) |
Set speed for movement.
Definition at line 168 of file DPPanTiltControl.cpp.
Referenced by BIAS::PanTiltManualControl::StartControl(), BIAS::PanTiltAutoControl::StartControl(), BIAS::PanTiltAutoControl::StartMoveTo(), BIAS::PanTiltAutoControl::StopControl(), and BIAS::DPPanTiltControlExtended::threadFuncCircle_().
void BIAS::DPPanTiltControl::StartCircularMovement | ( | ) |
Start a thread moving the PTU in a circle.
void DPPanTiltControl::StopPanTiltUnit | ( | ) |
Stop the currently moving pan tilt unit.
Definition at line 83 of file DPPanTiltControl.cpp.
|
inline |
Set the orientation of the PTU (default or upside-down).
[in] | use | Use true for default orientation and false for mounting upside down (e.g. when mounted under helicopter) |
Definition at line 187 of file DPPanTiltControl.hh.
|
protected |
Definition at line 194 of file DPPanTiltControl.hh.
|
protected |
Definition at line 191 of file DPPanTiltControl.hh.
|
protected |
Definition at line 192 of file DPPanTiltControl.hh.
|
protected |
Definition at line 193 of file DPPanTiltControl.hh.
|
protected |
Definition at line 193 of file DPPanTiltControl.hh.