36 #include <visp3/core/vpConfig.h>
38 #if defined(VISP_HAVE_ATIDAQ) && defined(VISP_HAVE_COMEDI)
42 #include <visp3/core/vpException.h>
43 #include <visp3/sensor/vpForceTorqueAtiSensor.h>
45 static Calibration *s_calibinfo =
nullptr;
52 : m_calibfile(
""), m_index(1), m_num_axes(6), m_num_channels(6), m_sample_bias()
85 Bias(s_calibinfo, sample_bias);
112 Bias(s_calibinfo, sample_bias);
114 delete[] sample_bias;
123 if (s_calibinfo !=
nullptr) {
125 destroyCalibration(s_calibinfo);
126 s_calibinfo =
nullptr;
151 voltage[i] = phydata[i];
155 ConvertToFT(s_calibinfo, voltage, ft);
172 std::string units(s_calibinfo->ForceUnits);
180 std::string units(s_calibinfo->TorqueUnits);
201 destroyCalibration(s_calibinfo);
205 if (s_calibinfo ==
nullptr) {
238 if (s_calibinfo ==
nullptr) {
239 os <<
"Calibration Information is not available" << std::endl;
244 os <<
"Calibration Information for " << ati.
m_calibfile <<
", index #" << ati.
m_index <<
":" << std::endl;
245 os <<
" Serial: " << s_calibinfo->Serial << std::endl;
246 os <<
" Body Style: " << s_calibinfo->BodyStyle << std::endl;
247 os <<
" Calibration: " << s_calibinfo->PartNumber << std::endl;
248 os <<
" Calibration Date: " << s_calibinfo->CalDate << std::endl;
249 os <<
" Family: " << s_calibinfo->Family << std::endl;
250 os <<
" # Channels: " << s_calibinfo->rt.NumChannels << std::endl;
251 os <<
" # Axes: " << s_calibinfo->rt.NumAxes << std::endl;
252 os <<
" Force Units: " << s_calibinfo->ForceUnits << std::endl;
253 os <<
" Torque Units: " << s_calibinfo->TorqueUnits << std::endl;
254 os <<
"Temperature Compensation: " << (s_calibinfo->TempCompAvailable ?
"Yes" :
"No") << std::endl;
257 os <<
"\nRated Loads:" << std::endl;
258 for (
unsigned short i = 0; i < s_calibinfo->rt.NumAxes; i++) {
260 if ((s_calibinfo->AxisNames[i])[0] ==
'F') {
261 units = s_calibinfo->ForceUnits;
264 units = s_calibinfo->TorqueUnits;
265 os << s_calibinfo->AxisNames[i] <<
": " << s_calibinfo->MaxLoads[i] <<
" " << units << std::endl;
269 if (s_calibinfo->TempCompAvailable) {
270 os <<
"\nTemperature Compensation Information:" << std::endl;
272 for (
unsigned short i = 0; i < s_calibinfo->rt.NumChannels - 1; i++) {
273 os << s_calibinfo->rt.bias_slopes[i] <<
" ";
276 for (
unsigned short i = 0; i < s_calibinfo->rt.NumChannels - 1; i++) {
277 os << s_calibinfo->rt.gain_slopes[i] <<
" ";
279 os <<
"\nTherm: " << s_calibinfo->rt.thermistor << std::endl;
285 #elif !defined(VISP_BUILD_SHARED_LIBS)
288 void dummy_vpForceTorqueAtiSensor() { };
friend std::ostream & operator<<(std::ostream &s, const vpArray2D< Type > &A)
unsigned int size() const
Return the number of elements of the 2D array.
Implementation of column vector and the associated operations.
void setChannelNumbers(const unsigned int &nchannel)
vpColVector getPhyData() const
error that can be emitted by ViSP classes.
unsigned short m_index
Index of calibration in file (default: 1)
std::string getForceUnits() const
vpColVector getForceTorque() const
unsigned short m_num_axes
Number of axis or gages available from the sensor.
std::string getTorqueUnits() const
std::string m_calibfile
ATI calibration file FT*.cal.
vpColVector m_sample_bias
Sample value used for bias.
void setCalibrationFile(const std::string &calibfile, unsigned short index=1)
virtual ~vpForceTorqueAtiSensor() VP_OVERRIDE
unsigned short m_num_channels
Number of channels available from the sensor.