#include <PTUFree.h>
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 |
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.
io | Existing io_service object to be used for communication by PTUFree |
Definition at line 8 of file PTUFree.cpp.
awaitPositionCommandCompletion Method to wait for the completion of the last issued pan and tilt position command (waits until ptu stops).
Definition at line 859 of file PTUFree.cpp.
bool ptu_free::PTUFree::clearPreset | ( | ) |
clearPreset Method to delete all existing presets. WARNING: Does not work on older PTUs and is not tested.
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
request | Command to execute on device connected via serial port |
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)
response | full ptu response string |
Definition at line 99 of file PTUFree.cpp.
getCurrentPanPosition Method that queries the current pan position
Definition at line 252 of file PTUFree.cpp.
getCurrentPanSpeed Method that queries the current pan speed
Definition at line 265 of file PTUFree.cpp.
getCurrentTiltPosition Method that queries the current tilt position
Definition at line 488 of file PTUFree.cpp.
getCurrentTiltSpeed Method that queries the current tilt speed
Definition at line 501 of file PTUFree.cpp.
getCurrentUsedMaximumPanPositionLimit Method to get the currently used maximum pan position.
Definition at line 765 of file PTUFree.cpp.
getCurrentUsedMaximumTiltPositionLimit Method to get the currently used maximum tilt position.
Definition at line 789 of file PTUFree.cpp.
getCurrentUsedMinimumPanPositionLimit Method to get the currently used minimum pan position.
Definition at line 753 of file PTUFree.cpp.
getCurrentUsedMinimumTiltPositionLimit Method to get the currently used minimum tilt position.
Definition at line 777 of file PTUFree.cpp.
getDesiredPanPosition Method that queries the desired pan position
Definition at line 320 of file PTUFree.cpp.
getDesiredPanSpeed Method that queries the desired pan speed
Definition at line 333 of file PTUFree.cpp.
getDesiredTiltPosition Method that queries the desired tilt position
Definition at line 556 of file PTUFree.cpp.
getDesiredTiltSpeed Method that queries the 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.
Definition at line 744 of file PTUFree.cpp.
getFactoryMaximumTiltPositionLimit Method to get the factory defined maximum tilt position.
Definition at line 750 of file PTUFree.cpp.
getFactoryMinimumPanPositionLimit Method to get the factory defined minimum pan position.
Definition at line 741 of file PTUFree.cpp.
getFactoryMinimumTiltPositionLimit Method to get the factory defined minimum tilt position.
Definition at line 747 of file PTUFree.cpp.
getPanAcceleartion Method that queries the pan acceleration (no current or desired here)
Definition at line 346 of file PTUFree.cpp.
long ptu_free::PTUFree::getPanBaseSpeed | ( | ) |
getPanBaseSpeed Returns the current pan base speed
Definition at line 359 of file PTUFree.cpp.
getPanInMotionPowerMode Method to get the move power mode for pan axis.
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
Definition at line 294 of file PTUFree.cpp.
double ptu_free::PTUFree::getPanResolution | ( | ) |
getPanResolution Method that queries the pan resolution (seconds/arc per position). Divide by 3600 to get Degree.
Definition at line 307 of file PTUFree.cpp.
getPanStationaryPowerMode Method to get the stationary power mode for pan axis.
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
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.
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.
Definition at line 804 of file PTUFree.cpp.
getSpeedControlMode Method to get the currently used sped control mode of the ptu.
Definition at line 1020 of file PTUFree.cpp.
getTiltAcceleartion Method that queries the tilt acceleration (no current or desired here)
Definition at line 582 of file PTUFree.cpp.
long ptu_free::PTUFree::getTiltBaseSpeed | ( | ) |
getTiltBaseSpeed Returns the current tilt base speed
Definition at line 595 of file PTUFree.cpp.
getTiltInMotionPowerMode Method to get the move power mode for tilt axis.
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
Definition at line 530 of file PTUFree.cpp.
double ptu_free::PTUFree::getTiltResolution | ( | ) |
getTiltResolution Method that queries the tilt resolution (seconds/arc per position). Divide by 3600 to get Degree.
Definition at line 543 of file PTUFree.cpp.
getTiltStationaryPowerMode Method to get the stationary power mode for tilt axis.
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
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.
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.
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.
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.
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.
preset_index | Number to identify preset. Must be between 1 and 32 |
Definition at line 969 of file PTUFree.cpp.
bool ptu_free::PTUFree::halt | ( | long | axis | ) |
halt Method that halts movement on specified axis.
axis | Axis to halt, can be PAN or TILT |
Definition at line 872 of file PTUFree.cpp.
bool ptu_free::PTUFree::isOpen | ( | ) |
isOpen Method to determine if used port is open or closed.
Definition at line 2401 of file PTUFree.cpp.
std::string ptu_free::PTUFree::readPTUResponse | ( | ) |
readPTUResponse Method that reads from the PTU until delimitor ('
') appears. Then the read data is returned.
Definition at line 79 of file PTUFree.cpp.
bool ptu_free::PTUFree::reset | ( | ) |
reset Method to reset the ptu (pan and/or tilt axis depending on reset mode)
Definition at line 1038 of file PTUFree.cpp.
bool ptu_free::PTUFree::restoreDefault | ( | ) |
restoreDefault Method to restore default settings. WARNING: Not tested.
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.
Definition at line 1107 of file PTUFree.cpp.
bool ptu_free::PTUFree::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.
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
baud | Baud rate for serial port |
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)
acceleration | value in position/second^2 for pan acceleration |
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
lower_speed_limit | value for pan lower speed limit in position/second. MUST BE 0 or >= 57 (second value depending on used ptu) |
Definition at line 224 of file PTUFree.cpp.
bool ptu_free::PTUFree::setDesiredPanPositionAbsolute | ( | short int | position | ) |
setDesiredPanPositionAbsolute Method that sets absolute pan position
position | absolute pan position ptu shall move to |
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)
position_offset | Offset of current position to be added for new pan position |
Definition at line 152 of file PTUFree.cpp.
bool ptu_free::PTUFree::setDesiredPanSpeedAbsolute | ( | short int | speed | ) |
setDesiredPanSpeedAbsolute Method that sets absolute pan speed (position/second)
speed | absolute value in position/second for pan speed |
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)
speed_offset | offset in position/second from CURRENT speed to set new desired speed |
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.
pan | Absolute position for pan |
tilt | Absolute position for tilt |
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
upper_speed_limit | value for pan upper speed limit in position/second |
Definition at line 208 of file PTUFree.cpp.
bool ptu_free::PTUFree::setDesiredTiltAccelerationAbsolute | ( | short int | acceleration | ) |
setDesiredTiltAccelerationAbsolute Method that sets the absolute tilt acceleration (position/second^2)
acceleration | value in position/second^2 for tilt acceleration |
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
lower_speed_limit | value for tilt lower speed limit in position/second. MUST BE 0 or >= 57 (second value depending on used ptu) |
Definition at line 460 of file PTUFree.cpp.
bool ptu_free::PTUFree::setDesiredTiltPositionAbsolute | ( | short int | position | ) |
setDesiredTiltPositionAbsolute Method that sets absolute tilt position
position | absolute tilt position ptu shall move to |
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)
position_offset | Offset of current position to be added for new tilt position |
Definition at line 388 of file PTUFree.cpp.
bool ptu_free::PTUFree::setDesiredTiltSpeedAbsolute | ( | short int | speed | ) |
setDesiredTiltSpeedAbsolute Method that sets absolute tilt speed (position/second)
speed | absolute value in position/second for tilt speed |
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)
speed_offset | offset in position/second from CURRENT speed to set new desired speed |
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
upper_speed_limit | value for tilt upper speed limit in position/second |
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.
position | Value for the maximum pan position allowed |
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.
position | Value for the maximum tilt position allowed |
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.
position | Value for the minimum pan position allowed |
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.
position | Value for the minimum tilt position allowed |
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.
port | identifier of serial port that will be used |
baud | baud rate for serial port |
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)
base_speed | value for pan base speed in position/second |
Definition at line 237 of file PTUFree.cpp.
bool ptu_free::PTUFree::setPanInMotionPowerMode | ( | long | mode | ) |
setPanInMotionPowerMode Method to set the move power mode for pan axis.
mode | Move power mode for pan axis, can be REGULAR_MOVE_POWER_MODE, LOW_MOVE_POWER_MODE or HIGH_MOVE_POWER_MODE |
Definition at line 1213 of file PTUFree.cpp.
bool ptu_free::PTUFree::setPanStationaryPowerMode | ( | long | mode | ) |
setPanStationaryPowerMode Method to set the stationary power mode for pan axis.
mode | Stationary power mode for pan axis, can be REGULAR_HOLD_POWER_MODE, LOW_HOLD_POWER_MODE or OFF_HOLD_POWER_MODE |
Definition at line 1120 of file PTUFree.cpp.
bool ptu_free::PTUFree::setPositionExecutionMode | ( | long | mode | ) |
setPositionExecutionMode Method to set the position execution mode.
mode | Position execution mode. Can be IMMEDIATE_POSITION_EXECUTION_MODE or SLAVED_POSITION_EXECUTION_MODE. |
Definition at line 825 of file PTUFree.cpp.
bool ptu_free::PTUFree::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.
enable | Type 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 |
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.
preset_index | Number to identify preset. Must be between 1 and 32 |
pan | Absolute position for pan for preset |
tilt | Absolute position for tilt for preset |
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.
preset_index | Number to identify preset. Must be between 1 and 32 |
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.
mode | Ptu reset mode. Possibles Values are NO_RESET_MODE, PAN_ONLY_RESET_MODE, TILT_ONLY_RESET_MODE or BOTH_RESET_MODE |
Definition at line 1052 of file PTUFree.cpp.
bool ptu_free::PTUFree::setSpeedControlMode | ( | long | mode | ) |
setSpeedControlMode Method to set the sped control mode of the ptu.
mode | Speed control mode to set, possible values are INDEPENDENT_SPEED_MODE or PURE_VELOCITY_CONTROL_MODE |
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)
base_speed | value for tilt base speed in position/second |
Definition at line 473 of file PTUFree.cpp.
bool ptu_free::PTUFree::setTiltInMotionPowerMode | ( | long | mode | ) |
setTiltInMotionPowerMode Method to set the move power mode for tilt axis.
mode | Move power mode for tilt axis, can be REGULAR_MOVE_POWER_MODE, LOW_MOVE_POWER_MODE or HIGH_MOVE_POWER_MODE |
Definition at line 1238 of file PTUFree.cpp.
bool ptu_free::PTUFree::setTiltStationaryPowerMode | ( | long | mode | ) |
setTiltStationaryPowerMode Method to set the stationary power mode for tilt axis.
mode | Stationary power mode for tilt axis, can be REGULAR_HOLD_POWER_MODE, LOW_HOLD_POWER_MODE or OFF_HOLD_POWER_MODE |
Definition at line 1146 of file PTUFree.cpp.
void ptu_free::PTUFree::test | ( | ) |
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.
long ptu_free::PTUFree::factory_pan_max [private] |
long ptu_free::PTUFree::factory_pan_min [private] |
long ptu_free::PTUFree::factory_tilt_max [private] |
long ptu_free::PTUFree::factory_tilt_min [private] |
long ptu_free::PTUFree::position_execution_mode [private] |
boost::asio::io_service ptu_free::PTUFree::ptu_io_service [private] |
boost::asio::serial_port ptu_free::PTUFree::ptu_port [private] |
bool ptu_free::PTUFree::timeout_occured [private] |
boost::asio::io_service ptu_free::PTUFree::timer_io_service [private] |