![]() |
Visual Servoing Platform
version 3.3.0
|
#include <vpForceTorqueAtiNetFTSensor.h>
Public Member Functions | |
vpForceTorqueAtiNetFTSensor () | |
vpForceTorqueAtiNetFTSensor (const std::string &hostname, int port) | |
virtual | ~vpForceTorqueAtiNetFTSensor () |
void | bias (unsigned int n_counts=50) |
unsigned long | getCountsPerForce () const |
unsigned long | getCountsPerTorque () const |
unsigned long | getDataCounter () const |
unsigned long | getScalingFactor () const |
vpColVector | getForceTorque () const |
void | setCountsPerForce (unsigned long counts) |
void | setCountsPerTorque (unsigned long counts) |
void | setScalingFactor (unsigned long scaling_factor) |
bool | startStreaming () |
void | stopStreaming () |
void | unbias () |
bool | waitForNewData (unsigned int timeout=50) |
Protected Attributes | |
unsigned long | m_counts_per_force |
unsigned long | m_counts_per_torque |
unsigned long | m_scaling_factor |
vpColVector | m_ft_bias |
unsigned long | m_data_count |
unsigned long | m_data_count_prev |
vpColVector | m_ft |
bool | m_is_streaming_started |
Inherited functionalities from vpUDPClient | |
bool | m_is_init |
void | init (const std::string &hostname, int port) |
int | receive (std::string &msg, int timeoutMs=0) |
int | receive (void *msg, size_t len, int timeoutMs=0) |
int | send (const std::string &msg) |
int | send (const void *msg, size_t len) |
Interface for ATI force/torque sensor using Net F/T over UDP.
The Network Force/Torque (Net F/T) sensor system measures six components of force and torque (Fx, Fy, Fz, Tx, Ty, Tz). The Net F/T provides an EtherNet/IP communication interface and is compatible with standard Ethernet. The Net F/T system is available with any of ATI transducer models. The Net F/T's web browser interface allows for easy configuration and set up via the Ethernet connection present on all NetBox models.
This class was tested with ATI Nano 43 F/T sensor connected to a NetBox. To use this class, you don't need to install any specific third-party.
To use this class, connect an Ethernet cable to the NetBox. The default IP address of the Net F/T is: 192.168.1.1. The default Ethernet port is 49152. You can use your favorite web browser on http://192.168.1.1 to modify Net F/T sensor settings and select sensor calibration configuration.
The following example shows how to use this class to get F/T measurements.
It produces the following output:
where 3 first values are forces Fx, Fy, Fz in N and the 3 last are torques Tx, Ty, Tz in Nm.
Definition at line 105 of file vpForceTorqueAtiNetFTSensor.h.
vpForceTorqueAtiNetFTSensor::vpForceTorqueAtiNetFTSensor | ( | ) |
Default constructor that set counts per force to 1000000, counts per torque to 1000000000 and scaling factor to 1. Note that counts per force, counts per torque and scaling factor are used to transform force / torque in user units (N and Nm). These default values could be changed using setCountsPerForce(), setCountsPerTorque() and setScalingFactor().
Definition at line 63 of file vpForceTorqueAtiNetFTSensor.cpp.
vpForceTorqueAtiNetFTSensor::vpForceTorqueAtiNetFTSensor | ( | const std::string & | hostname, |
int | port | ||
) |
Constructor that initializes an Eternet UDP connection to a given hostname and port.
hostname | : Device hostname or IP address. |
port | : Ethernet port. |
Definition at line 74 of file vpForceTorqueAtiNetFTSensor.cpp.
|
virtual |
Destructor that stops Net F/T streaming and closes the Ethernet connection with the device.
Definition at line 149 of file vpForceTorqueAtiNetFTSensor.cpp.
void vpForceTorqueAtiNetFTSensor::bias | ( | unsigned int | n_counts = 50 | ) |
Bias F/T sensor. Bias value is a mean over a given number of counts.
n_counts | : Number of counts used to bias. |
Definition at line 163 of file vpForceTorqueAtiNetFTSensor.cpp.
|
inline |
Definition at line 117 of file vpForceTorqueAtiNetFTSensor.h.
|
inline |
Definition at line 122 of file vpForceTorqueAtiNetFTSensor.h.
|
inline |
Definition at line 126 of file vpForceTorqueAtiNetFTSensor.h.
vpColVector vpForceTorqueAtiNetFTSensor::getForceTorque | ( | ) | const |
Return force / torque measurements in user units, respectively N and Nm.
To obtain the force and torque values in user units (N and Nm), each received force value is internally multiplied by the scaling factor and divided by the counts per force and each received torque value is internally multiplied by the scaling factor and divided by the counts per torque.
Definition at line 204 of file vpForceTorqueAtiNetFTSensor.cpp.
|
inline |
Definition at line 131 of file vpForceTorqueAtiNetFTSensor.h.
|
inherited |
Initialize a (IPv4) UDP client.
hostname | : Server hostname or IP address. |
port | : Server port number. |
Definition at line 115 of file vpUDPClient.cpp.
|
inherited |
Receive data sent by the server.
msg | : ASCII message or byte data. |
timeoutMs | : Timeout in millisecond (if zero, the call is blocking). |
Definition at line 192 of file vpUDPClient.cpp.
|
inherited |
Receive data sent by the server.
msg | : A message to send over the network. |
len | : Message length. |
timeoutMs | : Timeout in millisecond (if zero, the call is blocking). |
Definition at line 238 of file vpUDPClient.cpp.
|
inherited |
Send data to the server.
msg | : ASCII message or byte data. |
Definition at line 299 of file vpUDPClient.cpp.
|
inherited |
Send data to the server.
msg | : Message to send. |
len | : Message length. |
Definition at line 328 of file vpUDPClient.cpp.
|
inline |
Set counts per force value. Default value is 1000000.
counts | : Counts per force. |
Definition at line 138 of file vpForceTorqueAtiNetFTSensor.h.
|
inline |
Set counts per torque value. Default value is 1000000000.
counts | : Counts per torque. |
Definition at line 144 of file vpForceTorqueAtiNetFTSensor.h.
|
inline |
Set scaling factor. Default value is 1.
scaling_factor | : scaling factor. |
Definition at line 150 of file vpForceTorqueAtiNetFTSensor.h.
bool vpForceTorqueAtiNetFTSensor::startStreaming | ( | ) |
Start high-speed real-time Net F/T streaming.
Definition at line 84 of file vpForceTorqueAtiNetFTSensor.cpp.
void vpForceTorqueAtiNetFTSensor::stopStreaming | ( | ) |
Stop high-speed real-time Net F/T streaming.
Definition at line 120 of file vpForceTorqueAtiNetFTSensor.cpp.
void vpForceTorqueAtiNetFTSensor::unbias | ( | ) |
Unbias F/T sensor.
Definition at line 192 of file vpForceTorqueAtiNetFTSensor.cpp.
bool vpForceTorqueAtiNetFTSensor::waitForNewData | ( | unsigned int | timeout = 50 | ) |
Wait for new data.
timeout | : Timeout in ms. |
Definition at line 226 of file vpForceTorqueAtiNetFTSensor.cpp.
|
protected |
Definition at line 158 of file vpForceTorqueAtiNetFTSensor.h.
|
protected |
Definition at line 159 of file vpForceTorqueAtiNetFTSensor.h.
|
protected |
Definition at line 162 of file vpForceTorqueAtiNetFTSensor.h.
|
protected |
Definition at line 163 of file vpForceTorqueAtiNetFTSensor.h.
|
protected |
Definition at line 164 of file vpForceTorqueAtiNetFTSensor.h.
|
protected |
Definition at line 161 of file vpForceTorqueAtiNetFTSensor.h.
|
protectedinherited |
Definition at line 185 of file vpUDPClient.h.
|
protected |
Definition at line 165 of file vpForceTorqueAtiNetFTSensor.h.
|
protected |
Definition at line 160 of file vpForceTorqueAtiNetFTSensor.h.