38 #include <visp3/core/vpConfig.h>
40 #if defined(VISP_HAVE_ATIDAQ) && defined(VISP_HAVE_COMEDI)
44 #include <visp3/core/vpException.h>
45 #include <visp3/sensor/vpForceTorqueAtiSensor.h>
47 static Calibration *s_calibinfo = NULL;
54 : m_calibfile(
""), m_index(1), m_num_axes(6), m_num_channels(6), m_sample_bias()
87 Bias(s_calibinfo, sample_bias);
89 delete [] sample_bias;
113 Bias(s_calibinfo, sample_bias);
115 delete [] sample_bias;
123 if(s_calibinfo != NULL) {
125 destroyCalibration(s_calibinfo);
150 voltage[i] = phydata[i];
154 ConvertToFT(s_calibinfo, voltage, ft);
171 std::string units(s_calibinfo->ForceUnits);
179 std::string units(s_calibinfo->TorqueUnits);
203 destroyCalibration(s_calibinfo);
205 char file[FILENAME_MAX];
209 s_calibinfo = createCalibration(file,
m_index);
210 if (s_calibinfo==NULL) {
239 if (s_calibinfo==NULL) {
240 os <<
"Calibration Information is not available" << std::endl;
245 os <<
"Calibration Information for " << ati.
m_calibfile <<
", index #" << ati.
m_index <<
":" << std::endl;
246 os <<
" Serial: " << s_calibinfo->Serial << std::endl;
247 os <<
" Body Style: " << s_calibinfo->BodyStyle << std::endl;
248 os <<
" Calibration: " << s_calibinfo->PartNumber << std::endl;
249 os <<
" Calibration Date: " << s_calibinfo->CalDate << std::endl;
250 os <<
" Family: " << s_calibinfo->Family << std::endl;
251 os <<
" # Channels: " << s_calibinfo->rt.NumChannels << std::endl;
252 os <<
" # Axes: " << s_calibinfo->rt.NumAxes << std::endl;
253 os <<
" Force Units: " << s_calibinfo->ForceUnits << std::endl;
254 os <<
" Torque Units: " << s_calibinfo->TorqueUnits << std::endl;
255 os <<
"Temperature Compensation: " << (s_calibinfo->TempCompAvailable ?
"Yes" :
"No") << std::endl;
258 os <<
"\nRated Loads:" << std::endl;
259 for (
unsigned short i=0;i<s_calibinfo->rt.NumAxes;i++) {
261 if ((s_calibinfo->AxisNames[i])[0]==
'F') {
262 units=s_calibinfo->ForceUnits;
263 }
else units=s_calibinfo->TorqueUnits;
264 os << s_calibinfo->AxisNames[i] <<
": " << s_calibinfo->MaxLoads[i] <<
" " << units << std::endl;
268 if (s_calibinfo->TempCompAvailable) {
269 os <<
"\nTemperature Compensation Information:" << std::endl;
271 for (
unsigned short i=0;i<s_calibinfo->rt.NumChannels-1;i++) {
272 os << s_calibinfo->rt.bias_slopes[i] <<
" ";
275 for (
unsigned short i=0;i<s_calibinfo->rt.NumChannels-1;i++) {
276 os << s_calibinfo->rt.gain_slopes[i] <<
" ";
278 os <<
"\nTherm: " << s_calibinfo->rt.thermistor << std::endl;
285 #elif !defined(VISP_BUILD_SHARED_LIBS)
287 void dummy_vpForceTorqueAtiSensor() {};
void setChannelNumbers(const unsigned int &nchannel)
unsigned short m_index
Index of calibration in file (default: 1)
vpColVector getForceTorque() const
error that can be emited by ViSP classes.
unsigned int size() const
Return the number of elements of the 2D array.
std::string m_calibfile
ATI calibration file FT*.cal.
virtual ~vpForceTorqueAtiSensor()
friend std::ostream & operator<<(std::ostream &s, const vpArray2D< Type > &A)
vpColVector m_sample_bias
Sample value used for bias.
Implementation of column vector and the associated operations.
std::string getForceUnits() const
void setCalibrationFile(const std::string &calibfile, unsigned short index=1)
unsigned short m_num_axes
Number of axis or gages available from the sensor.
unsigned short m_num_channels
Number of channels available from the sensor.
vpColVector getPhyData() const
std::string getTorqueUnits() const