![]() |
Visual Servoing Platform version 3.7.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.
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)
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,
To configure the sensor, you may access the sensor through the web interface using your favorite browser.
Definition at line 152 of file vpForceTorqueIitSensor.h.
| BEGIN_VISP_NAMESPACE vpForceTorqueIitSensor::vpForceTorqueIitSensor | ( | ) |
Default constructor.
Establish communication with sensor(-s) and start data acquisition thread.
Definition at line 52 of file vpForceTorqueIitSensor.cpp.
References m_acquisitionEnabled, m_acquisitionThread, m_connected, m_dataValid, m_ft, m_ft_filt, m_ftLib, m_ftSensorsData, m_mutex, m_numSensorsInLib, m_timeCur, m_timePrev, and m_warmupMilliseconds.
| vpForceTorqueIitSensor::~vpForceTorqueIitSensor | ( | ) |
Destructor that stops streaming
Definition at line 92 of file vpForceTorqueIitSensor.cpp.
References close().
|
protected |
Acquisition loop. Warm up the sensor
Definition at line 107 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 82 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 return 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 97 of file vpForceTorqueIitSensor.cpp.
References m_acquisitionThread.
| void vpForceTorqueIitSensor::startStreaming | ( | ) |
Start acquisition thread and wait until data are available.
Definition at line 219 of file vpForceTorqueIitSensor.cpp.
References acquisitionLoop(), m_acquisitionEnabled, m_acquisitionThread, m_dataValid, and vpTime::wait().
| void vpForceTorqueIitSensor::stopStreaming | ( | ) |
Stop acquisition thread.
Definition at line 232 of file vpForceTorqueIitSensor.cpp.
References m_acquisitionEnabled, and m_acquisitionThread.
|
protected |
Definition at line 179 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), close(), startStreaming(), stopStreaming(), and vpForceTorqueIitSensor().
|
protected |
Definition at line 183 of file vpForceTorqueIitSensor.h.
Referenced by join(), startStreaming(), stopStreaming(), and vpForceTorqueIitSensor().
|
protected |
Definition at line 181 of file vpForceTorqueIitSensor.h.
Referenced by connected(), and vpForceTorqueIitSensor().
|
protected |
Definition at line 180 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), close(), startStreaming(), and vpForceTorqueIitSensor().
|
protected |
Definition at line 174 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), getForceTorque(), and vpForceTorqueIitSensor().
|
protected |
Definition at line 175 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), getForceTorque(), and vpForceTorqueIitSensor().
|
protected |
Definition at line 171 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), bias(), close(), and vpForceTorqueIitSensor().
|
protected |
Definition at line 177 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), and vpForceTorqueIitSensor().
|
protected |
Definition at line 186 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), getForceTorque(), and vpForceTorqueIitSensor().
|
protected |
Definition at line 172 of file vpForceTorqueIitSensor.h.
Referenced by vpForceTorqueIitSensor().
|
protected |
Definition at line 184 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), and vpForceTorqueIitSensor().
|
protected |
Definition at line 184 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), and vpForceTorqueIitSensor().
|
protected |
Definition at line 187 of file vpForceTorqueIitSensor.h.
Referenced by acquisitionLoop(), and vpForceTorqueIitSensor().