Visual Servoing Platform version 3.5.0
vpForceTorqueAtiNetFTSensor.h
1/****************************************************************************
2 *
3 * ViSP, open source Visual Servoing Platform software.
4 * Copyright (C) 2005 - 2019 by Inria. All rights reserved.
5 *
6 * This software is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 * See the file LICENSE.txt at the root directory of this source
11 * distribution for additional information about the GNU GPL.
12 *
13 * For using ViSP with software that can not be combined with the GNU
14 * GPL, please contact Inria about acquiring a ViSP Professional
15 * Edition License.
16 *
17 * See http://visp.inria.fr for more information.
18 *
19 * This software was developed at:
20 * Inria Rennes - Bretagne Atlantique
21 * Campus Universitaire de Beaulieu
22 * 35042 Rennes Cedex
23 * France
24 *
25 * If you have questions regarding the use of this file, please contact
26 * Inria at visp@inria.fr
27 *
28 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30 *
31 * Description:
32 * ATI Force torque interface.
33 *
34 * Authors:
35 * Fabien Spindler
36 *
37 *****************************************************************************/
38#ifndef _vpForceTorqueAtiNetFTSensor_h_
39#define _vpForceTorqueAtiNetFTSensor_h_
40
41#include <visp3/core/vpConfig.h>
42
43#include <ostream>
44
45#include <visp3/core/vpColVector.h>
46#include <visp3/core/vpUDPClient.h>
47
48// Make vpForceTorqueAtiNetFTSensor available only if inet_ntop() used to
49// communicate by UDP with the sensor through vpUDPClient is available; inet_ntop()
50// is not supported on win XP
51#ifdef VISP_HAVE_FUNC_INET_NTOP
52
106class VISP_EXPORT vpForceTorqueAtiNetFTSensor : public vpUDPClient
107{
108public:
110 vpForceTorqueAtiNetFTSensor(const std::string &hostname, int port);
112
113 void bias(unsigned int n_counts = 50);
118 inline unsigned long getCountsPerForce() const { return m_counts_per_force; }
123 inline unsigned long getCountsPerTorque() const { return m_counts_per_torque; }
127 inline unsigned long getDataCounter() const { return m_data_count; }
132 inline unsigned long getScalingFactor() const { return m_scaling_factor; }
133 vpColVector getForceTorque() const;
139 inline void setCountsPerForce(unsigned long counts) { m_counts_per_force = counts; }
145 inline void setCountsPerTorque(unsigned long counts) { m_counts_per_torque = counts; }
151 inline void setScalingFactor(unsigned long scaling_factor) { m_scaling_factor = scaling_factor; }
152 bool startStreaming();
153 void stopStreaming();
154
155 void unbias();
156 bool waitForNewData(unsigned int timeout = 50);
157
158protected:
159 unsigned long m_counts_per_force;
160 unsigned long m_counts_per_torque;
161 unsigned long m_scaling_factor;
163 unsigned long m_data_count;
164 unsigned long m_data_count_prev;
167};
168
169#endif
170#endif
Implementation of column vector and the associated operations.
Definition: vpColVector.h:131
void setCountsPerTorque(unsigned long counts)
void setCountsPerForce(unsigned long counts)
void setScalingFactor(unsigned long scaling_factor)
This class implements a basic (IPv4) User Datagram Protocol (UDP) client.
Definition: vpUDPClient.h:169