131 yError() <<
"strainInterface::print(): you must call strainInterface::open() first";
139 for(
size_t n=0;
n<values.size();
n++)
141 unsigned short unsigned_gaugeData[6] = {0};
142 signed short signed_gaugeData[6] = {0};
144 for(
size_t c=0; c<6; c++)
146 unsigned_gaugeData[c] = values[values.size()-1-
n].channel[c];
147 signed_gaugeData[c] = unsigned_gaugeData[c]-0x7fff;
152 fprintf(
fp,
"%d %d %d %d %d %d %d\n",
static_cast<int>(
n),signed_gaugeData[0],signed_gaugeData[1],signed_gaugeData[2],signed_gaugeData[3],signed_gaugeData[4],signed_gaugeData[5]);
154 yDebug(
"samples:%3d [0]:%+6d [1]:%+6d [2]:%+6d [3]:%+6d [4]:%+6d [5]:%+6d\r\n",
static_cast<int>(
n),signed_gaugeData[0],signed_gaugeData[1],signed_gaugeData[2],signed_gaugeData[3],signed_gaugeData[4],signed_gaugeData[5]);
166 yError() <<
"strainInterface::get(): you must call strainInterface::open() first";
170 double t0 = yarp::os::SystemClock::nowSystem();
172 yDebug() <<
"strainInterface::get(): is acquiring" << number <<
"from the 6 channels. Please wait ...";
174 const bool calibmode =
false;
175 downloader.strain_acquire_start(config.get_canbus(), config.get_canaddress(), config.get_txrate(), calibmode);
176 downloader.strain_acquire_get(config.get_canbus(), config.get_canaddress(), values, number);
178 downloader.strain_acquire_stop(config.get_canbus(), config.get_canaddress());
180 double t1 = yarp::os::SystemClock::nowSystem();
183 yDebug() <<
"strainInterface::get() has succesfully acquired" << values.size() <<
"values of the 6 channels in" << (t1-t0) <<
"seconds";
184 yDebug() <<
"the values are:";
185 for(
int i=0; i<values.size(); i++)
187 yDebug() <<
"#" << i+1 <<
"=" << values[i].channel[0] << values[i].channel[1] << values[i].channel[2] << values[i].channel[3] <<
188 values[i].channel[4] << values[i].channel[5] << values[i].valid;