Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
flir_ptu_driver::PTU Class Reference

#include <driver.h>

Public Member Functions

bool disableLimits ()
 
float getMax (char type)
 
float getMaxSpeed (char type)
 
float getMin (char type)
 
float getMinSpeed (char type)
 
char getMode ()
 
float getPosition (char type)
 
float getResolution (char type)
 
float getSpeed (char type)
 
bool home ()
 
bool initialize ()
 
bool initialized ()
 
 PTU (serial::Serial *ser)
 
bool setMode (char type)
 
bool setPosition (char type, float pos, bool Block=false)
 
bool setSpeed (char type, float speed)
 

Protected Member Functions

std::string sendCommand (std::string command)
 

Protected Attributes

bool initialized_
 
float pr
 pan resolution (rads/count) More...
 
serial::Serialser_
 
float tr
 tilt resolution (rads/count) More...
 

Private Member Functions

int getLimit (char type, char limType)
 
float getRes (char type)
 

Private Attributes

bool Lim
 Position Limits enabled. More...
 
int PMax
 Max Pan in Counts. More...
 
int PMin
 Min Pan in Counts. More...
 
int PSMax
 Max Pan Speed in Counts/second. More...
 
int PSMin
 Min Pan Speed in Counts/second. More...
 
int TMax
 Max Tilt in Counts. More...
 
int TMin
 Min Tilt in Counts. More...
 
int TSMax
 Max Tilt Speed in Counts/second. More...
 
int TSMin
 Min Tilt Speed in Counts/second. More...
 

Detailed Description

Definition at line 61 of file driver.h.

Constructor & Destructor Documentation

flir_ptu_driver::PTU::PTU ( serial::Serial ser)
inlineexplicit

Constructor - opens port

Parameters
serserial::Serial instance ready to communciate with device.

Definition at line 67 of file driver.h.

Member Function Documentation

bool flir_ptu_driver::PTU::disableLimits ( )
Returns
true if PTU software motion limits are disabled.

Definition at line 70 of file driver.cpp.

int flir_ptu_driver::PTU::getLimit ( char  type,
char  limType 
)
private

get limiting position/speed in counts or counts/second

Parameters
type'p' or 't' (pan or tilt)
limType{'n', 'x', 'l', 'u'} (min position, max position, min speed, max speed)
Returns
limiting position/speed

Definition at line 166 of file driver.cpp.

float flir_ptu_driver::PTU::getMax ( char  type)
inline
Parameters
type'p' or 't'
Returns
Maximum position in radians

Definition at line 114 of file driver.h.

float flir_ptu_driver::PTU::getMaxSpeed ( char  type)
inline
Parameters
type'p' or 't'
Returns
Maximum speed in radians/second

Definition at line 131 of file driver.h.

float flir_ptu_driver::PTU::getMin ( char  type)
inline
Parameters
type'p' or 't'
Returns
Minimum position in radians

Definition at line 106 of file driver.h.

float flir_ptu_driver::PTU::getMinSpeed ( char  type)
inline
Parameters
type'p' or 't'
Returns
Minimum speed in radians/second

Definition at line 123 of file driver.h.

char flir_ptu_driver::PTU::getMode ( )

get the control mode, position or velocity

Returns
'v' for velocity, 'i' for position

Definition at line 302 of file driver.cpp.

float flir_ptu_driver::PTU::getPosition ( char  type)
Parameters
type'p' or 't'
Returns
position in radians

Definition at line 183 of file driver.cpp.

float flir_ptu_driver::PTU::getRes ( char  type)
private

get radian/count resolution

Parameters
type'p' or 't'
Returns
pan resolution if type=='p', tilt resolution if type=='t'

Definition at line 148 of file driver.cpp.

float flir_ptu_driver::PTU::getResolution ( char  type)
inline
Parameters
type'p' or 't'
Returns
resolution in radians/count

Definition at line 97 of file driver.h.

float flir_ptu_driver::PTU::getSpeed ( char  type)
Parameters
type'p' or 't'
Returns
speed in radians/second

Definition at line 239 of file driver.cpp.

bool flir_ptu_driver::PTU::home ( )

Definition at line 120 of file driver.cpp.

bool flir_ptu_driver::PTU::initialize ( )
Returns
true if initialization succeeds.

Definition at line 78 of file driver.cpp.

bool flir_ptu_driver::PTU::initialized ( )
Returns
true if the serial port is open and PTU initialized.

Definition at line 65 of file driver.cpp.

std::string flir_ptu_driver::PTU::sendCommand ( std::string  command)
protected

Sends a string to the PTU

Parameters
commandstring to be sent
Returns
response string from unit.

Definition at line 111 of file driver.cpp.

bool flir_ptu_driver::PTU::setMode ( char  type)

set the control mode, position or velocity

Parameters
type'v' for velocity, 'i' for position
Returns
True if successfully sent command

Definition at line 286 of file driver.cpp.

bool flir_ptu_driver::PTU::setPosition ( char  type,
float  pos,
bool  Block = false 
)

Moves the PTU to the desired position. If Block is true, the call blocks until the desired position is reached

Parameters
type'p' or 't'
posdesired position in radians
Blockblock until ready
Returns
True if successfully sent command

Definition at line 200 of file driver.cpp.

bool flir_ptu_driver::PTU::setSpeed ( char  type,
float  speed 
)

sets the desired speed in radians/second

Parameters
type'p' or 't'
speeddesired speed in radians/second
Returns
True if successfully sent command

Definition at line 257 of file driver.cpp.

Member Data Documentation

bool flir_ptu_driver::PTU::initialized_
protected

Definition at line 206 of file driver.h.

bool flir_ptu_driver::PTU::Lim
private

Position Limits enabled.

Definition at line 189 of file driver.h.

int flir_ptu_driver::PTU::PMax
private

Max Pan in Counts.

Definition at line 188 of file driver.h.

int flir_ptu_driver::PTU::PMin
private

Min Pan in Counts.

Definition at line 187 of file driver.h.

float flir_ptu_driver::PTU::pr
protected

pan resolution (rads/count)

Definition at line 209 of file driver.h.

int flir_ptu_driver::PTU::PSMax
private

Max Pan Speed in Counts/second.

Definition at line 195 of file driver.h.

int flir_ptu_driver::PTU::PSMin
private

Min Pan Speed in Counts/second.

Definition at line 194 of file driver.h.

serial::Serial* flir_ptu_driver::PTU::ser_
protected

Definition at line 205 of file driver.h.

int flir_ptu_driver::PTU::TMax
private

Max Tilt in Counts.

Definition at line 186 of file driver.h.

int flir_ptu_driver::PTU::TMin
private

Min Tilt in Counts.

Definition at line 185 of file driver.h.

float flir_ptu_driver::PTU::tr
protected

tilt resolution (rads/count)

Definition at line 208 of file driver.h.

int flir_ptu_driver::PTU::TSMax
private

Max Tilt Speed in Counts/second.

Definition at line 193 of file driver.h.

int flir_ptu_driver::PTU::TSMin
private

Min Tilt Speed in Counts/second.

Definition at line 192 of file driver.h.


The documentation for this class was generated from the following files:


flir_ptu_driver
Author(s): Erik Karulf , David V. Lu , Nick Hawes
autogenerated on Sun Mar 28 2021 02:27:16