|
libnifalcon
1.0.1
|
#include <FalconDeviceThread.h>
Inheritance diagram for libnifalcon::FalconDeviceThread:
Collaboration diagram for libnifalcon::FalconDeviceThread:Public Member Functions | |
| FalconDeviceThread () | |
| virtual | ~FalconDeviceThread () |
| void | startThread () |
| virtual void | runThreadLoop () |
| void | stopThread () |
| bool | isThreadRunning () |
| void | getPosition (std::array< double, 3 > &pos) |
Public Member Functions inherited from libnifalcon::FalconDevice | |
| FalconDevice () | |
| ~FalconDevice () | |
| bool | isFirmwareLoaded () |
| bool | setFirmwareFile (const std::string &filename) |
| bool | loadFirmware (unsigned int retries, bool skip_checksum=false) |
| bool | loadFirmware (bool skip_checksum) |
| bool | getDeviceCount (unsigned int &count) |
| bool | open (unsigned int index) |
| void | close () |
| bool | runIOLoop (unsigned int exe_flags=(FALCON_LOOP_FIRMWARE|FALCON_LOOP_KINEMATIC|FALCON_LOOP_GRIP)) |
| template<class T > | |
| void | setFalconComm () |
| template<class T > | |
| void | setFalconFirmware () |
| template<class T > | |
| void | setFalconGrip () |
| template<class T > | |
| void | setFalconKinematic () |
| std::array< double, 3 > | getPosition () |
| void | setForce (std::array< double, 3 > force) |
| std::shared_ptr< FalconComm > | getFalconComm () |
| std::shared_ptr< FalconFirmware > | getFalconFirmware () |
| std::shared_ptr< FalconGrip > | getFalconGrip () |
| std::shared_ptr< FalconKinematic > | getFalconKinematic () |
| bool | isOpen () |
| unsigned int | getErrorCount () |
Public Member Functions inherited from libnifalcon::FalconCore | |
| FalconCore () | |
| virtual | ~FalconCore () |
| int | getErrorCode () |
Protected Member Functions | |
| void | runDeviceComm () |
Protected Attributes | |
| std::unique_ptr< std::thread > | m_ioThread |
| std::array< double, 3 > | m_localPosition |
| bool | m_runThreadLoop |
Protected Attributes inherited from libnifalcon::FalconDevice | |
| unsigned int | m_errorCount |
| std::shared_ptr< FalconComm > | m_falconComm |
| std::shared_ptr< FalconKinematic > | m_falconKinematic |
| std::shared_ptr< FalconFirmware > | m_falconFirmware |
| std::shared_ptr< FalconGrip > | m_falconGrip |
| std::array< double, 3 > | m_position |
| std::array< double, 3 > | m_forceVec |
Protected Attributes inherited from libnifalcon::FalconCore | |
| int | m_errorCode |
Additional Inherited Members | |
Public Types inherited from libnifalcon::FalconDevice | |
| enum | { FALCON_DEVICE_NO_COMM_SET = 1000, FALCON_DEVICE_NO_FIRMWARE_SET, FALCON_DEVICE_NO_KINEMATIC_SET, FALCON_DEVICE_NO_GRIP_SET, FALCON_DEVICE_NO_FIRMWARE_LOADED, FALCON_DEVICE_FIRMWARE_NOT_VALID, FALCON_DEVICE_FIRMWARE_CHECKSUM_MISMATCH } |
| enum | { FALCON_LOOP_FIRMWARE = 0x1, FALCON_LOOP_KINEMATIC = 0x2, FALCON_LOOP_GRIP = 0x4 } |
The FalconDeviceThread class is a sample device that uses the std::thread class to run the communications loop to the falcon.
The FalconDeviceThread class is only available if the std::thread library is available on the system.
| libnifalcon::FalconDeviceThread::FalconDeviceThread | ( | ) |
Constructor
|
virtual |
Destructor
| void libnifalcon::FalconDeviceThread::getPosition | ( | std::array< double, 3 > & | pos | ) |
Thread safe position return
|
inline |
Thread run status
|
protected |
Wrapper function for dealing with device communication
|
virtual |
Runs IO loop. Overridden to implement application specific functionality
| void libnifalcon::FalconDeviceThread::startThread | ( | ) |
Starts a thread that runs FalconDevice::runIOLoop constantly
| void libnifalcon::FalconDeviceThread::stopThread | ( | ) |
Stops thread if running
|
protected |
Internal thread object
|
protected |
Internal position storage
|
protected |
Internal thread execution state. Thread loop exits if this is false.
1.8.10