39 #include <visp3/core/vpConfig.h> 41 #if defined(VISP_HAVE_ATIDAQ) && defined(VISP_HAVE_COMEDI) 45 #include <visp3/core/vpException.h> 46 #include <visp3/sensor/vpForceTorqueAtiSensor.h> 48 static Calibration *s_calibinfo = NULL;
54 : m_calibfile(
""), m_index(1), m_num_axes(6), m_num_channels(6), m_sample_bias()
88 Bias(s_calibinfo, sample_bias);
115 Bias(s_calibinfo, sample_bias);
117 delete[] sample_bias;
126 if (s_calibinfo != NULL) {
128 destroyCalibration(s_calibinfo);
154 voltage[i] = phydata[i];
158 ConvertToFT(s_calibinfo, voltage, ft);
175 std::string units(s_calibinfo->ForceUnits);
183 std::string units(s_calibinfo->TorqueUnits);
204 destroyCalibration(s_calibinfo);
206 char file[FILENAME_MAX];
210 s_calibinfo = createCalibration(file,
m_index);
211 if (s_calibinfo == NULL) {
240 if (s_calibinfo == NULL) {
241 os <<
"Calibration Information is not available" << std::endl;
246 os <<
"Calibration Information for " << ati.
m_calibfile <<
", index #" << ati.
m_index <<
":" << std::endl;
247 os <<
" Serial: " << s_calibinfo->Serial << std::endl;
248 os <<
" Body Style: " << s_calibinfo->BodyStyle << std::endl;
249 os <<
" Calibration: " << s_calibinfo->PartNumber << std::endl;
250 os <<
" Calibration Date: " << s_calibinfo->CalDate << std::endl;
251 os <<
" Family: " << s_calibinfo->Family << std::endl;
252 os <<
" # Channels: " << s_calibinfo->rt.NumChannels << std::endl;
253 os <<
" # Axes: " << s_calibinfo->rt.NumAxes << std::endl;
254 os <<
" Force Units: " << s_calibinfo->ForceUnits << std::endl;
255 os <<
" Torque Units: " << s_calibinfo->TorqueUnits << std::endl;
256 os <<
"Temperature Compensation: " << (s_calibinfo->TempCompAvailable ?
"Yes" :
"No") << std::endl;
259 os <<
"\nRated Loads:" << std::endl;
260 for (
unsigned short i = 0; i < s_calibinfo->rt.NumAxes; i++) {
262 if ((s_calibinfo->AxisNames[i])[0] ==
'F') {
263 units = s_calibinfo->ForceUnits;
265 units = s_calibinfo->TorqueUnits;
266 os << s_calibinfo->AxisNames[i] <<
": " << s_calibinfo->MaxLoads[i] <<
" " << units << std::endl;
270 if (s_calibinfo->TempCompAvailable) {
271 os <<
"\nTemperature Compensation Information:" << std::endl;
273 for (
unsigned short i = 0; i < s_calibinfo->rt.NumChannels - 1; i++) {
274 os << s_calibinfo->rt.bias_slopes[i] <<
" ";
277 for (
unsigned short i = 0; i < s_calibinfo->rt.NumChannels - 1; i++) {
278 os << s_calibinfo->rt.gain_slopes[i] <<
" ";
280 os <<
"\nTherm: " << s_calibinfo->rt.thermistor << std::endl;
286 #elif !defined(VISP_BUILD_SHARED_LIBS) 289 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.
vpColVector getPhyData() const
std::string m_calibfile
ATI calibration file FT*.cal.
virtual ~vpForceTorqueAtiSensor()
std::string getTorqueUnits() const
vpColVector m_sample_bias
Sample value used for bias.
Implementation of column vector and the associated operations.
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.
std::string getForceUnits() const
friend VISP_EXPORT std::ostream & operator<<(std::ostream &os, const vpForceTorqueAtiSensor &ati)