Basic Image AlgorithmS Library
2.8.0
|
Extended controller interface for Directed Perception Pan Tilt Unit. More...
#include <PanTilt/DPPanTiltControlExtended.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... | |
void | CompensateHeliMovement (const BIAS::RMatrix &R) |
Compensates movement of coordinate system the PTU is mounted to. More... | |
DPPanTiltControlExtended () | |
Standard constructor. More... | |
void | FollowMidPos (const BIAS::Vector2< double > &newMean) |
Simple object tracking method, uses absolut positioning error and moves PTU and camera to position newMean. More... | |
void | GetAcceleration (long &panAcc, long &tiltAcc) |
void | GetCurrentPosition (long &lPanPos, long &lTiltPos) |
void | GetCurrentPositionDegrees (double &dPanDeg, double &dTiltDeg) |
void | GetCurrentPositionDegreesThreaded (double &dPanDeg, double &dTiltDeg) |
Get the position in degrees while moving in thread. More... | |
void | GetCurrentPositionRadians (double &dPanRad, double &dTiltRad) |
void | GetCurrentPositionRadiansThreaded (double &dPanRad, double &dTiltRad) |
Get the position in radians while moving in thread. More... | |
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 | PIDSpeedAdjustFollow (const BIAS::Vector2< double > &newMean) |
Perform PID controlling of the PTU. 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... | |
void | RecursivePIControl (const BIAS::Vector2< double > &newMean) |
Perform digital controlling of the PTU as described in Herbert Schlitt (pages 215 ff.). 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... | |
void | SetApertureAngle (double xAngle, double yAngle) |
Set the aperture angle of the camera mounted to the PTU. More... | |
void | SetKd (const BIAS::Vector< int > &kd) |
Set the derivative parameter of the Ziegler-Nichols tuning. More... | |
void | SetKi (const BIAS::Vector< int > &ki) |
Set the integral parameter of the Ziegler-Nichols tuning. More... | |
void | SetKp (const BIAS::Vector< int > &kp) |
Set the proportional parameter of the Ziegler-Nichols tuning. 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 | SetPictureSize (unsigned int xSize, unsigned int ySize) |
Set the size of the picture of the camera mounted to the PTU. More... | |
void | SetPosition (int nPanPos, int nTiltPos, bool bWaitComplete=true) |
Set the current position of the PTU in steps. More... | |
void | SetResetTime (float tn) |
void | SetSamplingTime (float t) |
char | SetSpeed (int nPanSpeed, int nTiltSpeed) |
Set speed for movement. More... | |
void | StartCircularMovement () |
Start a thread moving the PTU in a circle. More... | |
void | StartCircularMovementThread () |
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... | |
~DPPanTiltControlExtended () | |
Standard destructor. More... | |
Static Protected Member Functions | |
static void * | threadFuncCircle_ (void *ptr) |
Protected Attributes | |
bool | bDefaultOrientation_ |
bool | bInitComp_ |
portstream_fd | COMstream_ |
pthread_t | control_thread |
BIAS::RMatrix | deltaMatrix_ |
std::vector< int > | ErrorTMinus1_ |
int | followObjectMaxDiff_ |
int | followObjectMinDiff_ |
BIAS::RMatrix | handEyeMatrix_ |
double | KdX_ |
double | KdY_ |
double | KiX_ |
double | KiY_ |
double | KpX_ |
double | KpY_ |
short int | maxSpeed_ |
double | panResolution_ |
short int | panSpeedComp_ |
BIAS::RMatrix | ptuMatrix_ |
int | RPICounter_ |
BIAS::RMatrix | sensorMatrixMinus1_ |
float | T_ |
double | tiltResolution_ |
short int | tiltSpeedComp_ |
float | Tn_ |
double | xApertureAngle_ |
unsigned int | xPictureSize_ |
short int | xPTDeltaSpeed_ |
short int | xPTDeltaSpeedTMinus1_ |
short int | xPTSpeed_ |
double | yApertureAngle_ |
unsigned int | yPictureSize_ |
short int | yPTDeltaSpeed_ |
short int | yPTDeltaSpeedTMinus1_ |
short int | yPTSpeed_ |
int | ZiNiErrorTminus1X_ |
int | ZiNiErrorTminus1Y_ |
int | ZiNiErrorX_ |
int | ZiNiErrorY_ |
Static Protected Attributes | |
static pthread_mutex_t | condition_mutex = PTHREAD_MUTEX_INITIALIZER |
static long | panThreaded_ = 0 |
static long | tiltThreaded_ = 0 |
Extended controller interface for Directed Perception Pan Tilt Unit.
Definition at line 51 of file DPPanTiltControlExtended.hh.
|
inherited |
Enumerator | |
---|---|
AUTO | |
HALF | |
QUARTER | |
EIGHTH | |
FULL |
Definition at line 73 of file DPPanTiltControl.hh.
DPPanTiltControlExtended::DPPanTiltControlExtended | ( | ) |
Standard constructor.
Definition at line 17 of file DPPanTiltControlExtended.cpp.
DPPanTiltControlExtended::~DPPanTiltControlExtended | ( | ) |
Standard destructor.
Definition at line 51 of file DPPanTiltControlExtended.cpp.
|
inherited |
Await completion of currently executed command.
Definition at line 90 of file DPPanTiltControl.cpp.
|
inherited |
closes the comport stream connected to PTU
Definition at line 156 of file DPPanTiltControl.cpp.
Referenced by BIAS::PanTiltAutoControl::~PanTiltAutoControl().
void DPPanTiltControlExtended::CompensateHeliMovement | ( | const BIAS::RMatrix & | R | ) |
Compensates movement of coordinate system the PTU is mounted to.
Definition at line 80 of file DPPanTiltControlExtended.cpp.
References BIAS::RMatrixBase::GetRotationAnglesZYX(), and BIAS::Matrix3x3< T >::Transpose().
void DPPanTiltControlExtended::FollowMidPos | ( | const BIAS::Vector2< double > & | newMean | ) |
Simple object tracking method, uses absolut positioning error and moves PTU and camera to position newMean.
[in] | newMean | Defines the setpoint to adjust the PTU to. |
Definition at line 230 of file DPPanTiltControlExtended.cpp.
|
inherited |
Definition at line 190 of file DPPanTiltControl.cpp.
|
inherited |
Definition at line 229 of file DPPanTiltControl.cpp.
Referenced by BIAS::PanTiltAutoControl::StartControl(), BIAS::PanTiltAutoControl::StartMoveTo(), and threadFuncCircle_().
|
inherited |
Definition at line 236 of file DPPanTiltControl.cpp.
void DPPanTiltControlExtended::GetCurrentPositionDegreesThreaded | ( | double & | dPanDeg, |
double & | dTiltDeg | ||
) |
Get the position in degrees while moving in thread.
Definition at line 140 of file DPPanTiltControlExtended.cpp.
|
inherited |
Definition at line 243 of file DPPanTiltControl.cpp.
void DPPanTiltControlExtended::GetCurrentPositionRadiansThreaded | ( | double & | dPanRad, |
double & | dTiltRad | ||
) |
Get the position in radians while moving in thread.
Definition at line 149 of file DPPanTiltControlExtended.cpp.
|
inlineinherited |
Get the resolution of the pan axis.
Definition at line 141 of file DPPanTiltControl.hh.
|
inherited |
Definition at line 176 of file DPPanTiltControl.cpp.
|
inlineinherited |
Get the resolution of the tilt axis.
Definition at line 145 of file DPPanTiltControl.hh.
|
inherited |
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.
|
inherited |
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.
|
inherited |
Move camera nValue steps downwards.
Definition at line 204 of file DPPanTiltControl.cpp.
Referenced by BIAS::DPPanTiltControlDialog::OnDown().
|
inherited |
Move camera nValue steps left.
Definition at line 212 of file DPPanTiltControl.cpp.
Referenced by BIAS::DPPanTiltControlDialog::OnLeft().
|
inherited |
Move camera nValue steps right.
Definition at line 220 of file DPPanTiltControl.cpp.
Referenced by BIAS::DPPanTiltControlDialog::OnRight().
|
inherited |
Move camera nValue steps upwards.
Definition at line 196 of file DPPanTiltControl.cpp.
Referenced by BIAS::DPPanTiltControlDialog::OnUp().
void DPPanTiltControlExtended::PIDSpeedAdjustFollow | ( | const BIAS::Vector2< double > & | newMean | ) |
Perform PID controlling of the PTU.
Very simple algorithm without deadtime and frequency.
[in] | newMean | Defines the setpoint to adjust the PTU to. |
Definition at line 271 of file DPPanTiltControlExtended.cpp.
|
inherited |
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.
|
inherited |
Read a line from the serial (or USB) port.
Definition at line 269 of file DPPanTiltControl.cpp.
void DPPanTiltControlExtended::RecursivePIControl | ( | const BIAS::Vector2< double > & | newMean | ) |
Perform digital controlling of the PTU as described in Herbert Schlitt (pages 215 ff.).
Takes care of deadtime and frequency of the algorithm. Makes recursive calculation and calculates the difference in velocity of the PTU.
[in] | newMean | Defines the setpoint to adjust the PTU to. |
Definition at line 320 of file DPPanTiltControlExtended.cpp.
|
inherited |
Reset the position of the pan tilt unit to 0.
Definition at line 54 of file DPPanTiltControl.cpp.
Referenced by BIAS::DPPanTiltControlDialog::OnReset().
|
inherited |
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.
|
inherited |
Set acceleration for movement.
Definition at line 182 of file DPPanTiltControl.cpp.
|
inline |
Set the aperture angle of the camera mounted to the PTU.
This is needed to calculate the speeds to keep an object in the middle of the picture while steering the PTU.
Definition at line 112 of file DPPanTiltControlExtended.hh.
void DPPanTiltControlExtended::SetKd | ( | const BIAS::Vector< int > & | kd | ) |
Set the derivative parameter of the Ziegler-Nichols tuning.
Definition at line 71 of file DPPanTiltControlExtended.cpp.
void DPPanTiltControlExtended::SetKi | ( | const BIAS::Vector< int > & | ki | ) |
Set the integral parameter of the Ziegler-Nichols tuning.
Definition at line 63 of file DPPanTiltControlExtended.cpp.
void DPPanTiltControlExtended::SetKp | ( | const BIAS::Vector< int > & | kp | ) |
Set the proportional parameter of the Ziegler-Nichols tuning.
Definition at line 55 of file DPPanTiltControlExtended.cpp.
|
inherited |
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 threadFuncCircle_().
|
inherited |
Set the stepping of the motor.
Definition at line 279 of file DPPanTiltControl.cpp.
|
inline |
Set the size of the picture of the camera mounted to the PTU.
This is needed to calculate the speeds to keep an object in the middle of the picture while steering the PTU.
Definition at line 103 of file DPPanTiltControlExtended.hh.
|
inherited |
Set the current position of the PTU in steps.
Definition at line 250 of file DPPanTiltControl.cpp.
Referenced by BIAS::PanTiltManualControl::StartControl(), and threadFuncCircle_().
|
inline |
Definition at line 97 of file DPPanTiltControlExtended.hh.
|
inline |
Definition at line 95 of file DPPanTiltControlExtended.hh.
|
inherited |
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 threadFuncCircle_().
|
inherited |
Start a thread moving the PTU in a circle.
void DPPanTiltControlExtended::StartCircularMovementThread | ( | ) |
Start a thread moving the PTU in a circle.
Definition at line 134 of file DPPanTiltControlExtended.cpp.
|
inherited |
Stop the currently moving pan tilt unit.
Definition at line 83 of file DPPanTiltControl.cpp.
|
staticprotected |
Definition at line 157 of file DPPanTiltControlExtended.cpp.
References BIAS::DPPanTiltControl::GetCurrentPosition(), BIAS::DPPanTiltControl::SetMode(), BIAS::DPPanTiltControl::SetPosition(), and BIAS::DPPanTiltControl::SetSpeed().
|
inlineinherited |
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.
|
protectedinherited |
Definition at line 194 of file DPPanTiltControl.hh.
|
protected |
Definition at line 159 of file DPPanTiltControlExtended.hh.
|
protectedinherited |
Definition at line 191 of file DPPanTiltControl.hh.
|
staticprotected |
Definition at line 136 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 135 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 166 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 175 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 151 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 152 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 166 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 144 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 144 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 144 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 144 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 144 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 144 of file DPPanTiltControlExtended.hh.
|
protectedinherited |
Definition at line 192 of file DPPanTiltControl.hh.
|
protectedinherited |
Definition at line 193 of file DPPanTiltControl.hh.
|
protected |
Definition at line 162 of file DPPanTiltControlExtended.hh.
|
staticprotected |
Definition at line 137 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 166 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 176 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 166 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 169 of file DPPanTiltControlExtended.hh.
|
protectedinherited |
Definition at line 193 of file DPPanTiltControl.hh.
|
protected |
Definition at line 163 of file DPPanTiltControlExtended.hh.
|
staticprotected |
Definition at line 138 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 170 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 153 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 155 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 171 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 173 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 160 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 154 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 156 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 172 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 174 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 161 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 147 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 148 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 145 of file DPPanTiltControlExtended.hh.
|
protected |
Definition at line 146 of file DPPanTiltControlExtended.hh.