Visual Servoing Platform
version 3.4.0
|
#include <vpForceTorqueIitSensor.h>
Public Member Functions | |
vpForceTorqueIitSensor () | |
~vpForceTorqueIitSensor () | |
void | bias () |
bool | connected (int timeout_ms=0) const |
vpColVector | getForceTorque (bool filtered=false) |
void | startStreaming () |
void | stopStreaming () |
Protected Member Functions | |
void | acquisitionLoop () |
void | close () |
void | join () |
Protected Attributes | |
ftSensorLib | m_ftLib |
int | m_numSensorsInLib |
vpColVector | m_ft |
vpColVector | m_ft_filt |
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.To configure the sensor, you may access the sensor through the web interface using uour favorite browser.
Definition at line 146 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_ft_filt, 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 | ( | bool | filtered = false | ) |
Get force-torque data in SI units.
[in] | filtered | : When true return filtered force-torque measurements, when false return raw data. If no filter is configured while getting filtered measurements, the SDK will retun the raw data. To configure the filter, you must access the sensor through the web interface. The default ip address is 192.168.1.1 if in default mode. Once in the web interface select NETWORK SETTINGS and you can configure the Data Filtering Settings:
|
As shown in the next image, our sensor has IP 192.168.100.10
. Filtering is configured as Low-Pass, with a 3 order filter and a 10 Hz cutt-off frequency.
Definition at line 205 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 220 of file vpForceTorqueIitSensor.cpp.
References acquisitionLoop(), m_acquisitionEnabled, m_acquisitionThread, m_dataValid, and vpTime::wait().
void vpForceTorqueIitSensor::stopStreaming | ( | ) |
Stop acquisition thread.
Definition at line 233 of file vpForceTorqueIitSensor.cpp.
References m_acquisitionEnabled, and m_acquisitionThread.
|
protected |
Definition at line 173 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), close(), startStreaming(), and stopStreaming().
|
protected |
Definition at line 177 of file vpForceTorqueIitSensor.h.
Referenced by join(), startStreaming(), and stopStreaming().
|
protected |
Definition at line 175 of file vpForceTorqueIitSensor.h.
Referenced by connected(), and vpForceTorqueIitSensor().
|
protected |
Definition at line 174 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), close(), and startStreaming().
|
protected |
Definition at line 168 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), and getForceTorque().
|
protected |
Definition at line 169 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), and getForceTorque().
|
protected |
Definition at line 165 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), bias(), close(), and vpForceTorqueIitSensor().
|
protected |
Definition at line 171 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop().
|
protected |
Definition at line 180 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), and getForceTorque().
|
protected |
Definition at line 166 of file vpForceTorqueIitSensor.h.
Referenced by vpForceTorqueIitSensor().
|
protected |
Definition at line 178 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop().
|
protected |
Definition at line 178 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop().
|
protected |
Definition at line 181 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop().