31void boardDumperThread::setDevice(PolyDriver *board_d, PolyDriver *debug_d,
int rate, std::string portPrefix, std::string dataToDump,
bool logOnDisk)
40 ok &= board_d->view(pos);
41 ok &= board_d->view(vel);
42 ok &= board_d->view(enc);
43 ok &= board_d->view(pid);
44 ok &= board_d->view(amp);
45 ok &= board_d->view(lim);
46 ok &= board_d->view(trq);
47 ok &= board_d->view(cmod);
48 ok &= board_d->view(imod);
49 ok &= board_d->view(imot);
50 ok &= board_d->view(imotenc);
53 printf(
"Problems acquiring interfaces\n");
55 printf(
"Control board was accessed succesfully!\n");
57 pos->getAxes(&numberOfJoints);
58 fprintf(stderr,
"Number of axes is: %d \n", numberOfJoints);
61 data =
new double [numberOfJoints];
65 portName = portPrefix + dataToDump;
68 logToFile = logOnDisk;
69 this->setPeriod((
double)rate/1000.0);
98 strcpy(buff, this->portName.c_str());
99 for (
size_t i=0; i<strlen(buff); i++)
100 if (buff[i]==
'/') buff[i]=
'_';
105 logFile = fopen(buff,
"w");
108 printf (
"error opening logfile: %s\n",this->portName.c_str());
112 printf (
"logfile opened: %s\n",this->portName.c_str());