41 #include <visp3/core/vpConfig.h>
42 #include <visp3/core/vpException.h>
43 #include <visp3/core/vpTime.h>
44 #include <visp3/sensor/vpForceTorqueAtiNetFTSensor.h>
49 #ifdef VISP_HAVE_FUNC_INET_NTOP
65 :
vpUDPClient(), m_counts_per_force(1000000), m_counts_per_torque(1000000000), m_scaling_factor(1), m_ft_bias(6, 0),
66 m_data_count(0), m_data_count_prev(0), m_ft(6, 0), m_is_streaming_started(false)
76 :
vpUDPClient(hostname, port), m_counts_per_force(1000000), m_counts_per_torque(1000000000), m_scaling_factor(1),
77 m_ft_bias(6, 0), m_data_count(0), m_data_count_prev(0), m_ft(6, 0), m_is_streaming_started(false)
96 for (
unsigned int i = 0; i < 10; ++i) {
98 unsigned char request[8];
99 *(uint16_t *)&request[0] = htons(0x1234);
100 *(uint16_t *)&request[2] = htons(0x0002);
101 *(uint32_t *)&request[4] = htonl(0);
104 if (
send(request, len) != len) {
107 std::cout <<
"wait: " << i << std::endl;
132 unsigned char request[8];
133 *(uint16_t *)&request[0] = htons(0x1234);
134 *(uint16_t *)&request[2] = htons(0x0000);
135 *(uint32_t *)&request[4] = htonl(0);
138 if (
send(request, len) != len) {
180 for (
unsigned int i = 0; i < n_counts; i++) {
240 unsigned char response[36];
242 if (
receive((
void *)response, 36)) {
244 resp.
ft_sequence = ntohl(*(uint32_t *)&response[4]);
245 resp.
status = ntohl(*(uint32_t *)&response[8]);
246 for (
int i = 0; i < 6; i++) {
247 resp.
FTData[i] = ntohl(*(int32_t *)&response[12 + i * 4]);
256 for (
int i = 0; i < 3; i++) {
259 for (
int i = 3; i < 6; i++) {