Public Member Functions | Private Member Functions | Private Attributes
ptu_free::PTUFree Class Reference

#include <PTUFree.h>

List of all members.

Public Member Functions

bool awaitPositionCommandCompletion ()
 awaitPositionCommandCompletion Method to wait for the completion of the last issued pan and tilt position command (waits until ptu stops).
bool clearPreset ()
 clearPreset Method to delete all existing presets. WARNING: Does not work on older PTUs and is not tested.
void closeSerialConnection ()
 closeSerialConnection Closes currently used serial port
std::string communicate (std::string request)
 communicate Method to send a command 'request' to the serial port (and the device) and recieve the answer
std::vector< std::string > evaluateResponse (std::string response)
 evaluateResponse Method that preprocesses the answer of the PTU. Splits the PTU to a maximum of 3 parts. At position 0 is '*' or '!' (successfull or failed command), at position 1 is the full return message without the qualifier at start (might be "", for example if a set command only was performed) and at 2 (optional) there is the number only if the response contained one (e.g. for casts)
long getCurrentPanPosition ()
 getCurrentPanPosition Method that queries the current pan position
long getCurrentPanSpeed ()
 getCurrentPanSpeed Method that queries the current pan speed
long getCurrentTiltPosition ()
 getCurrentTiltPosition Method that queries the current tilt position
long getCurrentTiltSpeed ()
 getCurrentTiltSpeed Method that queries the current tilt speed
long getCurrentUsedMaximumPanPositionLimit ()
 getCurrentUsedMaximumPanPositionLimit Method to get the currently used maximum pan position.
long getCurrentUsedMaximumTiltPositionLimit ()
 getCurrentUsedMaximumTiltPositionLimit Method to get the currently used maximum tilt position.
long getCurrentUsedMinimumPanPositionLimit ()
 getCurrentUsedMinimumPanPositionLimit Method to get the currently used minimum pan position.
long getCurrentUsedMinimumTiltPositionLimit ()
 getCurrentUsedMinimumTiltPositionLimit Method to get the currently used minimum tilt position.
long getDesiredPanPosition ()
 getDesiredPanPosition Method that queries the desired pan position
long getDesiredPanSpeed ()
 getDesiredPanSpeed Method that queries the desired pan speed
long getDesiredTiltPosition ()
 getDesiredTiltPosition Method that queries the desired tilt position
long getDesiredTiltSpeed ()
 getDesiredTiltSpeed Method that queries the desired tilt speed
long getFactoryMaximumPanPositionLimit ()
 getFactoryMaximumPanPositionLimit Method to get the factory defined maximum pan position.
long getFactoryMaximumTiltPositionLimit ()
 getFactoryMaximumTiltPositionLimit Method to get the factory defined maximum tilt position.
long getFactoryMinimumPanPositionLimit ()
 getFactoryMinimumPanPositionLimit Method to get the factory defined minimum pan position.
long getFactoryMinimumTiltPositionLimit ()
 getFactoryMinimumTiltPositionLimit Method to get the factory defined minimum tilt position.
long getPanAcceleartion ()
 getPanAcceleartion Method that queries the pan acceleration (no current or desired here)
long getPanBaseSpeed ()
 getPanBaseSpeed Returns the current pan base speed
long getPanInMotionPowerMode ()
 getPanInMotionPowerMode Method to get the move power mode for pan axis.
long getPanLowerSpeedLimit ()
 getPanLowerSpeedLimit Method that queries the pan lower speed limit. WARNING: This Method consumes either extreme amounts of time to execute or does not work properly with all PTU
double getPanResolution ()
 getPanResolution Method that queries the pan resolution (seconds/arc per position). Divide by 3600 to get Degree.
long getPanStationaryPowerMode ()
 getPanStationaryPowerMode Method to get the stationary power mode for pan axis.
long getPanUpperSpeedLimit ()
 getPanUpperSpeedLimit Method that queries the pan upper speed limit WARNING: This Method consumes either extreme amounts of time to execute or does not work properly with all PTU
long getPositionExecutionMode ()
 getPositionExecutionMode Method to get the currently used position execution mode. Can return IMMEDIATE_POSITION_EXECUTION_MODE or SLAVED_POSITION_EXECUTION_MODE.
long getPositionLimitEnforcementMode ()
 getPositionLimitEnforcementMode Method to get the currently used position limit enforcement mode. Can return FACTORY_LIMITS_ENABLED, USER_DEFINED_LIMITS_ENABLED or FACTORY_LIMITS_ENABLED.
long getSpeedControlMode ()
 getSpeedControlMode Method to get the currently used sped control mode of the ptu.
long getTiltAcceleartion ()
 getTiltAcceleartion Method that queries the tilt acceleration (no current or desired here)
long getTiltBaseSpeed ()
 getTiltBaseSpeed Returns the current tilt base speed
long getTiltInMotionPowerMode ()
 getTiltInMotionPowerMode Method to get the move power mode for tilt axis.
long getTiltLowerSpeedLimit ()
 getTiltLowerSpeedLimit Method that queries the tilt lower speed limit. WARNING: This Method consumes either extreme amounts of time to execute or does not work properly with all PTU
double getTiltResolution ()
 getTiltResolution Method that queries the tilt resolution (seconds/arc per position). Divide by 3600 to get Degree.
long getTiltStationaryPowerMode ()
 getTiltStationaryPowerMode Method to get the stationary power mode for tilt axis.
long getTiltUpperSpeedLimit ()
 getTiltUpperSpeedLimit Method that queries the tilt upper speed limit WARNING: This Method consumes either extreme amounts of time to execute or does not work properly with all PTU
long getUserMaximumPanPositionLimit ()
 getUserMaximumPanPositionLimit Method to get the user defined maximum pan position. WARNING: Does not work on older PTUs and is not tested.
long getUserMaximumTiltPositionLimit ()
 getUserMaximumTiltPositionLimit Method to get the user defined maximum tilt position. WARNING: Does not work on older PTUs and is not tested.
long getUserMinimumPanPositionLimit ()
 getUserMinimumPanPositionLimit Method to get the user defined minimum pan position. WARNING: Does not work on older PTUs and is not tested.
long getUserMinimumTiltPositionLimit ()
 getUserMinimumTiltPositionLimit Method to get the user defined minimum tilt position. WARNING: Does not work on older PTUs and is not tested.
bool gotoPreset (int preset_index)
 gotoPreset Method that moves the ptu to a existing preset of pan and tilt corrdiantes. WARNING: Does not work on older PTUs and is not tested.
bool halt (long axis)
 halt Method that halts movement on specified axis.
bool isOpen ()
 isOpen Method to determine if used port is open or closed.
 PTUFree ()
 PTUFree Constructor for PTUFree object. Not connected to any port.
 PTUFree (boost::asio::io_service &io)
 PTUFree Constructor for PTUFree object with existing io_service.
std::string readPTUResponse ()
 readPTUResponse Method that reads from the PTU until delimitor ('
') appears. Then the read data is returned.
bool reset ()
 reset Method to reset the ptu (pan and/or tilt axis depending on reset mode)
bool restoreDefault ()
 restoreDefault Method to restore default settings. WARNING: Not tested.
bool restoreFactoryDefault ()
 restoreFactoryDefault Method to set default settings to factory defaults. Saved to EEPROM, do not use too often. WARNING: Not tested.
bool saveDefault ()
 saveDefault Method to save the current axis settings as default at power up. Note: This class sets the ptu by invoking setNewSerialConnection to some standard values. To get the values saved by this method invoke restore_defaults after setting the ptu connection. Saved to EEPROM, do not use too often. WARNING: Not tested.
bool setBaudRate (int baud)
 setBaudRate Sets the baud rate for the serial port that is used. Only use of serial connection is established
bool setDesiredPanAccelerationAbsolute (short int acceleration)
 setDesiredPanAccelerationAbsolute Method that sets the absolute pan acceleration (position/second^2)
bool setDesiredPanLowerSpeedLimit (short int lower_speed_limit)
 setDesiredPanLowerSpeedLimit Method that sets the lower speed limit for pan (position/second). WARNING: Takes extremly long or does not work on every ptu
bool setDesiredPanPositionAbsolute (short int position)
 setDesiredPanPositionAbsolute Method that sets absolute pan position
bool setDesiredPanPositionRelative (short int position_offset)
 setDesiredPanPositionRelative Method that sets current pan position by offset (current pos + offset = new position)
bool setDesiredPanSpeedAbsolute (short int speed)
 setDesiredPanSpeedAbsolute Method that sets absolute pan speed (position/second)
bool setDesiredPanSpeedRelative (short int speed_offset)
 setDesiredPanSpeedRelative Method that sets the desired pan speed relative to the CURRENT (not the desired!) speed with an offset (position/second)
bool setDesiredPanTiltPositionAbsoluteSlaved (short int pan, short int tilt)
 setDesiredPanTiltPositionAbsoluteSlaved Method that allows a movement of pan and tilt axis to specified absolute position where both start at the same time. This method waits until movement is completed.
bool setDesiredPanUpperSpeedLimit (short int upper_speed_limit)
 setDesiredPanUpperSpeedLimit Method that sets the upper speed limit for pan (position/second). WARNING: Takes extremly long or does not work on every ptu
bool setDesiredTiltAccelerationAbsolute (short int acceleration)
 setDesiredTiltAccelerationAbsolute Method that sets the absolute tilt acceleration (position/second^2)
bool setDesiredTiltLowerSpeedLimit (short int lower_speed_limit)
 setDesiredTiltLowerSpeedLimit Method that sets the lower speed limit for tilt (position/second). WARNING: Takes extremly long or does not work on every ptu
bool setDesiredTiltPositionAbsolute (short int position)
 setDesiredTiltPositionAbsolute Method that sets absolute tilt position
bool setDesiredTiltPositionRelative (short int position_offset)
 setDesiredTiltPositionRelative Method that sets current tilt position by offset (current pos + offset = new position)
bool setDesiredTiltSpeedAbsolute (short int speed)
 setDesiredTiltSpeedAbsolute Method that sets absolute tilt speed (position/second)
bool setDesiredTiltSpeedRelative (short int speed_offset)
 setDesiredTiltSpeedRelative Method that sets the desired tilt speed relative to the CURRENT (not the desired!) speed with an offset (position/second)
bool setDesiredTiltUpperSpeedLimit (short int upper_speed_limit)
 setDesiredTiltUpperSpeedLimit Method that sets the upper speed limit for tilt (position/second). WARNING: Takes extremly long or does not work on every ptu
bool setMaximumPanPositionLimit (short int position)
 setMaximumPanPositionLimit Method that is used to set a user defined maximum pan position limit. WARNING: Does not work on older PTUs and is not tested.
bool setMaximumTiltPositionLimit (short int position)
 setMaximumTiltPositionLimit Method that is used to set a user defined maximum tilt position limit. WARNING: Does not work on older PTUs and is not tested.
bool setMinimumPanPositionLimit (short int position)
 setMinimumPanPositionLimit Method that is used to set a user defined minimum pan position limit. WARNING: Does not work on older PTUs and is not tested.
bool setMinimumTiltPositionLimit (short int position)
 setMinimumTiltPositionLimit Method that is used to set a user defined minimum tilt position limit. WARNING: Does not work on older PTUs and is not tested.
bool setNewSerialConnection (std::string port, int baud)
 setNewSerialConnection Establishes a new connection via serial port specified by 'port' to a target device using baud rate 'baud'. The ptu is set up with IMMEDIATE_POSITION_EXECUTION_MODE and FACTORY_LIMITS_ENABLED.
bool setPanBaseSpeed (short int base_speed)
 setPanBaseSpeed Method that sets the base speed for pan (position/second)
bool setPanInMotionPowerMode (long mode)
 setPanInMotionPowerMode Method to set the move power mode for pan axis.
bool setPanStationaryPowerMode (long mode)
 setPanStationaryPowerMode Method to set the stationary power mode for pan axis.
bool setPositionExecutionMode (long mode)
 setPositionExecutionMode Method to set the position execution mode.
bool setPositionLimitEnforcementMode (long enable)
 setPositionLimitEnforcementMode Method to set the position limit enforcement mode. Warning: USER_DEFINED_LIMITS_ENABLED does not work on older PTUs and setting of this value is not tested.
bool setPreset (int preset_index, short int pan, short int tilt)
 setPreset Method that allows to associate a pan and tilt position with a preset index. Moves to the pan and tilt position and saves the position as a preset. WARNING: Does not work on older PTUs and is not tested.
bool setPreset (int preset_index)
 setPreset Method that allows to associate a pan and tilt position with a preset index. Saves the current pan and tilt position as a preset. WARNING: Does not work on older PTUs and is not tested.
bool setResetMode (long mode)
 setResetMode Method to set the reset mode of the ptu. Saved to EEPROM, do not use too often. WARNING: Not tested.
bool setSpeedControlMode (long mode)
 setSpeedControlMode Method to set the sped control mode of the ptu.
bool setTiltBaseSpeed (short int base_speed)
 setTiltBaseSpeed Method that sets the base speed for tilt (position/second)
bool setTiltInMotionPowerMode (long mode)
 setTiltInMotionPowerMode Method to set the move power mode for tilt axis.
bool setTiltStationaryPowerMode (long mode)
 setTiltStationaryPowerMode Method to set the stationary power mode for tilt axis.
void test ()
 test Method to test the methods of this program, for DEBUG/DEVELOPMENT purpose, changes PTU settings for test purpose (restart before normal use)

Private Member Functions

std::string getErrorString (boost::system::error_code error)

Private Attributes

long factory_pan_max
long factory_pan_min
long factory_tilt_max
long factory_tilt_min
long position_execution_mode
boost::asio::io_service ptu_io_service
boost::asio::serial_port ptu_port
bool timeout_occured
boost::asio::io_service timer_io_service

Detailed Description

A class for accessing flir ptu via serial port

Definition at line 46 of file PTUFree.h.


Constructor & Destructor Documentation

PTUFree Constructor for PTUFree object. Not connected to any port.

Definition at line 5 of file PTUFree.cpp.

ptu_free::PTUFree::PTUFree ( boost::asio::io_service &  io)

PTUFree Constructor for PTUFree object with existing io_service.

Parameters:
ioExisting io_service object to be used for communication by PTUFree

Definition at line 8 of file PTUFree.cpp.


Member Function Documentation

awaitPositionCommandCompletion Method to wait for the completion of the last issued pan and tilt position command (waits until ptu stops).

Returns:
True if successfull

Definition at line 859 of file PTUFree.cpp.

clearPreset Method to delete all existing presets. WARNING: Does not work on older PTUs and is not tested.

Returns:
True if successfull

Definition at line 983 of file PTUFree.cpp.

closeSerialConnection Closes currently used serial port

Definition at line 67 of file PTUFree.cpp.

std::string ptu_free::PTUFree::communicate ( std::string  request)

communicate Method to send a command 'request' to the serial port (and the device) and recieve the answer

Parameters:
requestCommand to execute on device connected via serial port
Returns:
Execution result message

Definition at line 71 of file PTUFree.cpp.

std::vector< std::string > ptu_free::PTUFree::evaluateResponse ( std::string  response)

evaluateResponse Method that preprocesses the answer of the PTU. Splits the PTU to a maximum of 3 parts. At position 0 is '*' or '!' (successfull or failed command), at position 1 is the full return message without the qualifier at start (might be "", for example if a set command only was performed) and at 2 (optional) there is the number only if the response contained one (e.g. for casts)

Parameters:
responsefull ptu response string
Returns:
string "split" into 3 parts. [0] is prefix for success('*') or failure ('!'), [1] is the full message without prefix, [2] (optional) is number only if one is contained (e.g. for cast to int/long/...)

Definition at line 99 of file PTUFree.cpp.

getCurrentPanPosition Method that queries the current pan position

Returns:
pan position

Definition at line 252 of file PTUFree.cpp.

getCurrentPanSpeed Method that queries the current pan speed

Returns:
pan speed

Definition at line 265 of file PTUFree.cpp.

getCurrentTiltPosition Method that queries the current tilt position

Returns:
tilt position

Definition at line 488 of file PTUFree.cpp.

getCurrentTiltSpeed Method that queries the current tilt speed

Returns:
tilt speed

Definition at line 501 of file PTUFree.cpp.

getCurrentUsedMaximumPanPositionLimit Method to get the currently used maximum pan position.

Returns:
Maximum pan position being currently used

Definition at line 765 of file PTUFree.cpp.

getCurrentUsedMaximumTiltPositionLimit Method to get the currently used maximum tilt position.

Returns:
Maximum tilt position being currently used

Definition at line 789 of file PTUFree.cpp.

getCurrentUsedMinimumPanPositionLimit Method to get the currently used minimum pan position.

Returns:
Minimum pan position being currently used

Definition at line 753 of file PTUFree.cpp.

getCurrentUsedMinimumTiltPositionLimit Method to get the currently used minimum tilt position.

Returns:
Minimum tilt position being currently used

Definition at line 777 of file PTUFree.cpp.

getDesiredPanPosition Method that queries the desired pan position

Returns:
desired pan position

Definition at line 320 of file PTUFree.cpp.

getDesiredPanSpeed Method that queries the desired pan speed

Returns:
desired pan speed

Definition at line 333 of file PTUFree.cpp.

getDesiredTiltPosition Method that queries the desired tilt position

Returns:
desired tilt position

Definition at line 556 of file PTUFree.cpp.

getDesiredTiltSpeed Method that queries the desired tilt speed

Returns:
desired tilt speed

Definition at line 569 of file PTUFree.cpp.

std::string ptu_free::PTUFree::getErrorString ( boost::system::error_code  error) [private]

Definition at line 1305 of file PTUFree.cpp.

getFactoryMaximumPanPositionLimit Method to get the factory defined maximum pan position.

Returns:
Maximum pan position defined by factory default

Definition at line 744 of file PTUFree.cpp.

getFactoryMaximumTiltPositionLimit Method to get the factory defined maximum tilt position.

Returns:
Maximum tilt position defined by factory default

Definition at line 750 of file PTUFree.cpp.

getFactoryMinimumPanPositionLimit Method to get the factory defined minimum pan position.

Returns:
Minimum pan position defined by factory default

Definition at line 741 of file PTUFree.cpp.

getFactoryMinimumTiltPositionLimit Method to get the factory defined minimum tilt position.

Returns:
Minimum tilt position defined by factory default

Definition at line 747 of file PTUFree.cpp.

getPanAcceleartion Method that queries the pan acceleration (no current or desired here)

Returns:
pan acceleration

Definition at line 346 of file PTUFree.cpp.

getPanBaseSpeed Returns the current pan base speed

Returns:
pan base speed

Definition at line 359 of file PTUFree.cpp.

getPanInMotionPowerMode Method to get the move power mode for pan axis.

Returns:
Move power mode for pan axis, can be REGULAR_MOVE_POWER_MODE, LOW_MOVE_POWER_MODE or HIGH_MOVE_POWER_MODE

Definition at line 1264 of file PTUFree.cpp.

getPanLowerSpeedLimit Method that queries the pan lower speed limit. WARNING: This Method consumes either extreme amounts of time to execute or does not work properly with all PTU

Returns:
pan lower speed limit in position/second

Definition at line 294 of file PTUFree.cpp.

getPanResolution Method that queries the pan resolution (seconds/arc per position). Divide by 3600 to get Degree.

Returns:
seconds/arc per position of step motor on pan axis

Definition at line 307 of file PTUFree.cpp.

getPanStationaryPowerMode Method to get the stationary power mode for pan axis.

Returns:
Stationary power mode for pan axis, can be REGULAR_HOLD_POWER_MODE, LOW_HOLD_POWER_MODE or OFF_HOLD_POWER_MODE

Definition at line 1172 of file PTUFree.cpp.

getPanUpperSpeedLimit Method that queries the pan upper speed limit WARNING: This Method consumes either extreme amounts of time to execute or does not work properly with all PTU

Returns:
pan upper speed limit in position/second

Definition at line 281 of file PTUFree.cpp.

getPositionExecutionMode Method to get the currently used position execution mode. Can return IMMEDIATE_POSITION_EXECUTION_MODE or SLAVED_POSITION_EXECUTION_MODE.

Returns:
current position execution mode, can be IMMEDIATE_POSITION_EXECUTION_MODE or SLAVED_POSITION_EXECUTION_MODE

Definition at line 854 of file PTUFree.cpp.

getPositionLimitEnforcementMode Method to get the currently used position limit enforcement mode. Can return FACTORY_LIMITS_ENABLED, USER_DEFINED_LIMITS_ENABLED or FACTORY_LIMITS_ENABLED.

Returns:
Currently used position limit enforcement mode

Definition at line 804 of file PTUFree.cpp.

getSpeedControlMode Method to get the currently used sped control mode of the ptu.

Returns:
Used speed control mode. Can be INDEPENDENT_SPEED_MODE or PURE_VELOCITY_CONTROL_MODE.

Definition at line 1020 of file PTUFree.cpp.

getTiltAcceleartion Method that queries the tilt acceleration (no current or desired here)

Returns:
tilt acceleration

Definition at line 582 of file PTUFree.cpp.

getTiltBaseSpeed Returns the current tilt base speed

Returns:
tilt base speed

Definition at line 595 of file PTUFree.cpp.

getTiltInMotionPowerMode Method to get the move power mode for tilt axis.

Returns:
Move power mode for tilt axis, can be REGULAR_MOVE_POWER_MODE, LOW_MOVE_POWER_MODE or HIGH_MOVE_POWER_MODE

Definition at line 1284 of file PTUFree.cpp.

getTiltLowerSpeedLimit Method that queries the tilt lower speed limit. WARNING: This Method consumes either extreme amounts of time to execute or does not work properly with all PTU

Returns:
tilt lower speed limit in position/second

Definition at line 530 of file PTUFree.cpp.

getTiltResolution Method that queries the tilt resolution (seconds/arc per position). Divide by 3600 to get Degree.

Returns:
seconds/arc per position of step motor on tilt axis

Definition at line 543 of file PTUFree.cpp.

getTiltStationaryPowerMode Method to get the stationary power mode for tilt axis.

Returns:
Stationary power mode for tilt axis, can be REGULAR_HOLD_POWER_MODE, LOW_HOLD_POWER_MODE or OFF_HOLD_POWER_MODE

Definition at line 1192 of file PTUFree.cpp.

getTiltUpperSpeedLimit Method that queries the tilt upper speed limit WARNING: This Method consumes either extreme amounts of time to execute or does not work properly with all PTU

Returns:
tilt upper speed limit in position/second

Definition at line 517 of file PTUFree.cpp.

getUserMaximumPanPositionLimit Method to get the user defined maximum pan position. WARNING: Does not work on older PTUs and is not tested.

Returns:
Maximum pan position defined by user

Definition at line 700 of file PTUFree.cpp.

getUserMaximumTiltPositionLimit Method to get the user defined maximum tilt position. WARNING: Does not work on older PTUs and is not tested.

Returns:
Maximum tilt position defined by user

Definition at line 728 of file PTUFree.cpp.

getUserMinimumPanPositionLimit Method to get the user defined minimum pan position. WARNING: Does not work on older PTUs and is not tested.

Returns:
Minimum pan position defined by user

Definition at line 686 of file PTUFree.cpp.

getUserMinimumTiltPositionLimit Method to get the user defined minimum tilt position. WARNING: Does not work on older PTUs and is not tested.

Returns:
Minimum tilt position defined by user

Definition at line 714 of file PTUFree.cpp.

bool ptu_free::PTUFree::gotoPreset ( int  preset_index)

gotoPreset Method that moves the ptu to a existing preset of pan and tilt corrdiantes. WARNING: Does not work on older PTUs and is not tested.

Parameters:
preset_indexNumber to identify preset. Must be between 1 and 32
Returns:
True if successfull

Definition at line 969 of file PTUFree.cpp.

bool ptu_free::PTUFree::halt ( long  axis)

halt Method that halts movement on specified axis.

Parameters:
axisAxis to halt, can be PAN or TILT
Returns:
True if successfull

Definition at line 872 of file PTUFree.cpp.

isOpen Method to determine if used port is open or closed.

Returns:
True if open

Definition at line 2401 of file PTUFree.cpp.

readPTUResponse Method that reads from the PTU until delimitor ('
') appears. Then the read data is returned.

Returns:
Data from serial port until next delimitor ('
').

Definition at line 79 of file PTUFree.cpp.

reset Method to reset the ptu (pan and/or tilt axis depending on reset mode)

Returns:
True if successfull

Definition at line 1038 of file PTUFree.cpp.

restoreDefault Method to restore default settings. WARNING: Not tested.

Returns:
True if successfull

Definition at line 1094 of file PTUFree.cpp.

restoreFactoryDefault Method to set default settings to factory defaults. Saved to EEPROM, do not use too often. WARNING: Not tested.

Returns:
True if successfull

Definition at line 1107 of file PTUFree.cpp.

saveDefault Method to save the current axis settings as default at power up. Note: This class sets the ptu by invoking setNewSerialConnection to some standard values. To get the values saved by this method invoke restore_defaults after setting the ptu connection. Saved to EEPROM, do not use too often. WARNING: Not tested.

Returns:
True if successfull

Definition at line 1081 of file PTUFree.cpp.

bool ptu_free::PTUFree::setBaudRate ( int  baud)

setBaudRate Sets the baud rate for the serial port that is used. Only use of serial connection is established

Parameters:
baudBaud rate for serial port
Returns:
True if setting was successfull

Definition at line 12 of file PTUFree.cpp.

bool ptu_free::PTUFree::setDesiredPanAccelerationAbsolute ( short int  acceleration)

setDesiredPanAccelerationAbsolute Method that sets the absolute pan acceleration (position/second^2)

Parameters:
accelerationvalue in position/second^2 for pan acceleration
Returns:
True if successfull

Definition at line 193 of file PTUFree.cpp.

bool ptu_free::PTUFree::setDesiredPanLowerSpeedLimit ( short int  lower_speed_limit)

setDesiredPanLowerSpeedLimit Method that sets the lower speed limit for pan (position/second). WARNING: Takes extremly long or does not work on every ptu

Parameters:
lower_speed_limitvalue for pan lower speed limit in position/second. MUST BE 0 or >= 57 (second value depending on used ptu)
Returns:
True if successfull

Definition at line 224 of file PTUFree.cpp.

setDesiredPanPositionAbsolute Method that sets absolute pan position

Parameters:
positionabsolute pan position ptu shall move to
Returns:
True if successfull

Definition at line 139 of file PTUFree.cpp.

bool ptu_free::PTUFree::setDesiredPanPositionRelative ( short int  position_offset)

setDesiredPanPositionRelative Method that sets current pan position by offset (current pos + offset = new position)

Parameters:
position_offsetOffset of current position to be added for new pan position
Returns:
True if successfull

Definition at line 152 of file PTUFree.cpp.

setDesiredPanSpeedAbsolute Method that sets absolute pan speed (position/second)

Parameters:
speedabsolute value in position/second for pan speed
Returns:
True if successfull

Definition at line 165 of file PTUFree.cpp.

bool ptu_free::PTUFree::setDesiredPanSpeedRelative ( short int  speed_offset)

setDesiredPanSpeedRelative Method that sets the desired pan speed relative to the CURRENT (not the desired!) speed with an offset (position/second)

Parameters:
speed_offsetoffset in position/second from CURRENT speed to set new desired speed
Returns:
True if successfull

Definition at line 180 of file PTUFree.cpp.

bool ptu_free::PTUFree::setDesiredPanTiltPositionAbsoluteSlaved ( short int  pan,
short int  tilt 
)

setDesiredPanTiltPositionAbsoluteSlaved Method that allows a movement of pan and tilt axis to specified absolute position where both start at the same time. This method waits until movement is completed.

Parameters:
panAbsolute position for pan
tiltAbsolute position for tilt
Returns:
True if successfull

Definition at line 900 of file PTUFree.cpp.

bool ptu_free::PTUFree::setDesiredPanUpperSpeedLimit ( short int  upper_speed_limit)

setDesiredPanUpperSpeedLimit Method that sets the upper speed limit for pan (position/second). WARNING: Takes extremly long or does not work on every ptu

Parameters:
upper_speed_limitvalue for pan upper speed limit in position/second
Returns:
True if successfull

Definition at line 208 of file PTUFree.cpp.

setDesiredTiltAccelerationAbsolute Method that sets the absolute tilt acceleration (position/second^2)

Parameters:
accelerationvalue in position/second^2 for tilt acceleration
Returns:
True if successfull

Definition at line 429 of file PTUFree.cpp.

bool ptu_free::PTUFree::setDesiredTiltLowerSpeedLimit ( short int  lower_speed_limit)

setDesiredTiltLowerSpeedLimit Method that sets the lower speed limit for tilt (position/second). WARNING: Takes extremly long or does not work on every ptu

Parameters:
lower_speed_limitvalue for tilt lower speed limit in position/second. MUST BE 0 or >= 57 (second value depending on used ptu)
Returns:
True if successfull

Definition at line 460 of file PTUFree.cpp.

setDesiredTiltPositionAbsolute Method that sets absolute tilt position

Parameters:
positionabsolute tilt position ptu shall move to
Returns:
True if successfull

Definition at line 375 of file PTUFree.cpp.

bool ptu_free::PTUFree::setDesiredTiltPositionRelative ( short int  position_offset)

setDesiredTiltPositionRelative Method that sets current tilt position by offset (current pos + offset = new position)

Parameters:
position_offsetOffset of current position to be added for new tilt position
Returns:
True if successfull

Definition at line 388 of file PTUFree.cpp.

setDesiredTiltSpeedAbsolute Method that sets absolute tilt speed (position/second)

Parameters:
speedabsolute value in position/second for tilt speed
Returns:
True if successfull

Definition at line 401 of file PTUFree.cpp.

bool ptu_free::PTUFree::setDesiredTiltSpeedRelative ( short int  speed_offset)

setDesiredTiltSpeedRelative Method that sets the desired tilt speed relative to the CURRENT (not the desired!) speed with an offset (position/second)

Parameters:
speed_offsetoffset in position/second from CURRENT speed to set new desired speed
Returns:
True if successfull

Definition at line 416 of file PTUFree.cpp.

bool ptu_free::PTUFree::setDesiredTiltUpperSpeedLimit ( short int  upper_speed_limit)

setDesiredTiltUpperSpeedLimit Method that sets the upper speed limit for tilt (position/second). WARNING: Takes extremly long or does not work on every ptu

Parameters:
upper_speed_limitvalue for tilt upper speed limit in position/second
Returns:
True if successfull

Definition at line 444 of file PTUFree.cpp.

bool ptu_free::PTUFree::setMaximumPanPositionLimit ( short int  position)

setMaximumPanPositionLimit Method that is used to set a user defined maximum pan position limit. WARNING: Does not work on older PTUs and is not tested.

Parameters:
positionValue for the maximum pan position allowed
Returns:
True if successfull

Definition at line 648 of file PTUFree.cpp.

bool ptu_free::PTUFree::setMaximumTiltPositionLimit ( short int  position)

setMaximumTiltPositionLimit Method that is used to set a user defined maximum tilt position limit. WARNING: Does not work on older PTUs and is not tested.

Parameters:
positionValue for the maximum tilt position allowed
Returns:
True if successfull

Definition at line 672 of file PTUFree.cpp.

bool ptu_free::PTUFree::setMinimumPanPositionLimit ( short int  position)

setMinimumPanPositionLimit Method that is used to set a user defined minimum pan position limit. WARNING: Does not work on older PTUs and is not tested.

Parameters:
positionValue for the minimum pan position allowed
Returns:
True if successfull

Definition at line 636 of file PTUFree.cpp.

bool ptu_free::PTUFree::setMinimumTiltPositionLimit ( short int  position)

setMinimumTiltPositionLimit Method that is used to set a user defined minimum tilt position limit. WARNING: Does not work on older PTUs and is not tested.

Parameters:
positionValue for the minimum tilt position allowed
Returns:
True if successfull

Definition at line 660 of file PTUFree.cpp.

bool ptu_free::PTUFree::setNewSerialConnection ( std::string  port,
int  baud 
)

setNewSerialConnection Establishes a new connection via serial port specified by 'port' to a target device using baud rate 'baud'. The ptu is set up with IMMEDIATE_POSITION_EXECUTION_MODE and FACTORY_LIMITS_ENABLED.

Parameters:
portidentifier of serial port that will be used
baudbaud rate for serial port
Returns:
True if establishing a connection was successfull

Definition at line 27 of file PTUFree.cpp.

bool ptu_free::PTUFree::setPanBaseSpeed ( short int  base_speed)

setPanBaseSpeed Method that sets the base speed for pan (position/second)

Parameters:
base_speedvalue for pan base speed in position/second
Returns:
True if successfull

Definition at line 237 of file PTUFree.cpp.

setPanInMotionPowerMode Method to set the move power mode for pan axis.

Parameters:
modeMove power mode for pan axis, can be REGULAR_MOVE_POWER_MODE, LOW_MOVE_POWER_MODE or HIGH_MOVE_POWER_MODE
Returns:
True if successfull

Definition at line 1213 of file PTUFree.cpp.

setPanStationaryPowerMode Method to set the stationary power mode for pan axis.

Parameters:
modeStationary power mode for pan axis, can be REGULAR_HOLD_POWER_MODE, LOW_HOLD_POWER_MODE or OFF_HOLD_POWER_MODE
Returns:
True if successfull

Definition at line 1120 of file PTUFree.cpp.

setPositionExecutionMode Method to set the position execution mode.

Parameters:
modePosition execution mode. Can be IMMEDIATE_POSITION_EXECUTION_MODE or SLAVED_POSITION_EXECUTION_MODE.
Returns:
True if successfull

Definition at line 825 of file PTUFree.cpp.

setPositionLimitEnforcementMode Method to set the position limit enforcement mode. Warning: USER_DEFINED_LIMITS_ENABLED does not work on older PTUs and setting of this value is not tested.

Parameters:
enableType of position limit enforcement to enable. Possible values are FACTORY_LIMITS_ENABLED, USER_DEFINED_LIMITS_ENABLED (warning: does not work on older PTU's) and LIMITS_DISABLED
Returns:
True if successfull

Definition at line 610 of file PTUFree.cpp.

bool ptu_free::PTUFree::setPreset ( int  preset_index,
short int  pan,
short int  tilt 
)

setPreset Method that allows to associate a pan and tilt position with a preset index. Moves to the pan and tilt position and saves the position as a preset. WARNING: Does not work on older PTUs and is not tested.

Parameters:
preset_indexNumber to identify preset. Must be between 1 and 32
panAbsolute position for pan for preset
tiltAbsolute position for tilt for preset
Returns:
True if successfull

Definition at line 936 of file PTUFree.cpp.

bool ptu_free::PTUFree::setPreset ( int  preset_index)

setPreset Method that allows to associate a pan and tilt position with a preset index. Saves the current pan and tilt position as a preset. WARNING: Does not work on older PTUs and is not tested.

Parameters:
preset_indexNumber to identify preset. Must be between 1 and 32
Returns:
True if successfull

Definition at line 952 of file PTUFree.cpp.

bool ptu_free::PTUFree::setResetMode ( long  mode)

setResetMode Method to set the reset mode of the ptu. Saved to EEPROM, do not use too often. WARNING: Not tested.

Parameters:
modePtu reset mode. Possibles Values are NO_RESET_MODE, PAN_ONLY_RESET_MODE, TILT_ONLY_RESET_MODE or BOTH_RESET_MODE
Returns:
True if successfull

Definition at line 1052 of file PTUFree.cpp.

setSpeedControlMode Method to set the sped control mode of the ptu.

Parameters:
modeSpeed control mode to set, possible values are INDEPENDENT_SPEED_MODE or PURE_VELOCITY_CONTROL_MODE
Returns:
True if successfull

Definition at line 996 of file PTUFree.cpp.

bool ptu_free::PTUFree::setTiltBaseSpeed ( short int  base_speed)

setTiltBaseSpeed Method that sets the base speed for tilt (position/second)

Parameters:
base_speedvalue for tilt base speed in position/second
Returns:
True if successfull

Definition at line 473 of file PTUFree.cpp.

setTiltInMotionPowerMode Method to set the move power mode for tilt axis.

Parameters:
modeMove power mode for tilt axis, can be REGULAR_MOVE_POWER_MODE, LOW_MOVE_POWER_MODE or HIGH_MOVE_POWER_MODE
Returns:
True if successfull

Definition at line 1238 of file PTUFree.cpp.

setTiltStationaryPowerMode Method to set the stationary power mode for tilt axis.

Parameters:
modeStationary power mode for tilt axis, can be REGULAR_HOLD_POWER_MODE, LOW_HOLD_POWER_MODE or OFF_HOLD_POWER_MODE
Returns:
True if successfull

Definition at line 1146 of file PTUFree.cpp.

test Method to test the methods of this program, for DEBUG/DEVELOPMENT purpose, changes PTU settings for test purpose (restart before normal use)

Definition at line 1633 of file PTUFree.cpp.


Member Data Documentation

Definition at line 585 of file PTUFree.h.

Definition at line 584 of file PTUFree.h.

Definition at line 587 of file PTUFree.h.

Definition at line 586 of file PTUFree.h.

Definition at line 588 of file PTUFree.h.

boost::asio::io_service ptu_free::PTUFree::ptu_io_service [private]

Definition at line 580 of file PTUFree.h.

boost::asio::serial_port ptu_free::PTUFree::ptu_port [private]

Definition at line 582 of file PTUFree.h.

Definition at line 583 of file PTUFree.h.

boost::asio::io_service ptu_free::PTUFree::timer_io_service [private]

Definition at line 581 of file PTUFree.h.


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


asr_flir_ptu_driver
Author(s): Valerij Wittenbeck, Joachim Gehrung, Pascal Mei├čner, Patrick Schlosser
autogenerated on Thu Jun 6 2019 21:16:45