Visual Servoing Platform
version 3.3.0 under development (2020-02-17)
|
#include <visp3/sensor/vpForceTorqueIitSensor.h>
Public Member Functions | |
vpForceTorqueIitSensor () | |
~vpForceTorqueIitSensor () | |
void | bias () |
bool | connected (int timeout_ms=0) const |
vpColVector | getForceTorque () |
void | startStreaming () |
void | stopStreaming () |
Protected Member Functions | |
void | acquisitionLoop () |
void | close () |
void | join () |
Protected Attributes | |
ftSensorLib | m_ftLib |
int | m_numSensorsInLib |
vpColVector | m_ft |
ftSensorsConnected | m_ftSensorsData {} |
std::atomic< bool > | m_acquisitionEnabled |
std::atomic< bool > | m_dataValid |
bool | m_connected |
std::thread | m_acquisitionThread |
std::chrono::time_point< std::chrono::system_clock > | m_timeCur |
std::chrono::time_point< std::chrono::system_clock > | m_timePrev |
std::mutex | m_mutex |
int | m_warmupMilliseconds |
This class is a wrapper over six axis load measurement (forces and torques) from IIT (ISTITUTO ITALIANO DI TECNOLOGIA) sell by Alberobotics.
The following example shows how to use this class to stream force-torque data at 1kHz and print a measurement each second.
Once build, in the same folder as the binary you should find a configuration file named configurationSettings.ini
.
$VISP_WS/modules/sensor/test/force-torque/configurationSettings.ini
with default settings. LOCAL_IFACE_IP = 192.168.100.100 ; Host Computer's local interface IP LOCAL_IFACE = enp0s31f6 ; Host Computer's local interface name (it is required only in Linux)
192.168.1.1
. Browsing to this address with Firefox allows to modify it's default IP address. If the new sensor IP address is for example 192.168.100.10
, you need to modify the following line: USE_DEFAULT_SETTINGS = false ; If "true", the library will use the ; DEFAULT_SETTINGS. Note that the sensor ; needs to be in the "DEF" IP position. ; If "false", the library will use the ; USER_SETTINGS to initialize the communication ; with the sensor. [USER_SETTINGS] ; USER SETTINGS FOR USE IN SINGLE_SENSOR_MODE when USE_DEFAULT_SETTINGS=false USER_IP = 192.168.100.10 ; User Sensor IP
When running a binary that uses vpForceTorqueIitSensor class,
LD_LIBRARY_PATH
environment variable. This could be achieved running: $VISP_WS/3rdparty/FT_SDK_01_4
contains IIT SDK. Definition at line 142 of file vpForceTorqueIitSensor.h.
vpForceTorqueIitSensor::vpForceTorqueIitSensor | ( | ) |
Default constructor.
Establish communication with sensor(-s) and start data acquisition thread.
Definition at line 54 of file vpForceTorqueIitSensor.cpp.
References m_connected, m_ftLib, and m_numSensorsInLib.
vpForceTorqueIitSensor::~vpForceTorqueIitSensor | ( | ) |
Destructor that stops streaming
Definition at line 93 of file vpForceTorqueIitSensor.cpp.
References close().
|
protected |
Acquisition loop. Warm up the sensor
Definition at line 108 of file vpForceTorqueIitSensor.cpp.
References m_acquisitionEnabled, m_dataValid, m_ft, m_ftLib, m_ftSensorsData, m_mutex, m_timeCur, m_timePrev, and m_warmupMilliseconds.
Referenced by startStreaming().
void vpForceTorqueIitSensor::bias | ( | ) |
Bias all sensors by TCP.
Definition at line 159 of file vpForceTorqueIitSensor.cpp.
References m_ftLib.
|
protected |
Stops data streaming.
Definition at line 83 of file vpForceTorqueIitSensor.cpp.
References m_acquisitionEnabled, m_dataValid, and m_ftLib.
Referenced by ~vpForceTorqueIitSensor().
bool vpForceTorqueIitSensor::connected | ( | int | timeout_ms = 0 | ) | const |
Return true if communication established with at least one sensor.
timeout_ms | : Timeout in milliseconds. |
If you get the following error:
it means probably that you didn't set the right parameters in the configuration file configurationSettings.ini
. See class description to get some hints.
Definition at line 172 of file vpForceTorqueIitSensor.cpp.
References vpChrono::getDurationMs(), m_connected, vpTime::sleepMs(), and vpChrono::start().
vpColVector vpForceTorqueIitSensor::getForceTorque | ( | ) |
Get force-torque data in SI units.
Definition at line 186 of file vpForceTorqueIitSensor.cpp.
|
protected |
Join acquisition thread.
Definition at line 98 of file vpForceTorqueIitSensor.cpp.
References m_acquisitionThread.
void vpForceTorqueIitSensor::startStreaming | ( | ) |
Start acquisition thread and wait until data are available.
Definition at line 195 of file vpForceTorqueIitSensor.cpp.
References acquisitionLoop(), m_acquisitionEnabled, m_acquisitionThread, m_dataValid, and vpTime::wait().
void vpForceTorqueIitSensor::stopStreaming | ( | ) |
Stop acquisition thread.
Definition at line 208 of file vpForceTorqueIitSensor.cpp.
References m_acquisitionEnabled, and m_acquisitionThread.
|
protected |
Definition at line 168 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), close(), startStreaming(), and stopStreaming().
|
protected |
Definition at line 172 of file vpForceTorqueIitSensor.h.
Referenced by join(), startStreaming(), and stopStreaming().
|
protected |
Definition at line 170 of file vpForceTorqueIitSensor.h.
Referenced by connected(), and vpForceTorqueIitSensor().
|
protected |
Definition at line 169 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), close(), and startStreaming().
|
protected |
Definition at line 164 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), and getForceTorque().
|
protected |
Definition at line 161 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), bias(), close(), and vpForceTorqueIitSensor().
|
protected |
Definition at line 166 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop().
|
protected |
Definition at line 175 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), and getForceTorque().
|
protected |
Definition at line 162 of file vpForceTorqueIitSensor.h.
Referenced by vpForceTorqueIitSensor().
|
protected |
Definition at line 173 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop().
|
protected |
Definition at line 173 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop().
|
protected |
Definition at line 176 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop().