15#include "embObjAnalogSensor.h"
18#include "EoProtocol.h"
20#include <yarp/os/Time.h>
25#include "EOYtheSystem.h"
160 return(eo_prot_BRDdummy);
163 return(fid_boardnum-1);
171#ifdef _SETPOINT_TEST_
177void check_received_debug_data(
FEAT_ID *
id,
int jointNum, setpoint_test_data_t *test_data_ptr)
179 static int old_diff_packets[10][8] = {0};
180 struct timespec curr_time;
181 static int count = 0;
182 static bool ep_printed_6 =
false;
183 static bool ep_printed_8 =
false;
184 uint64_t curr_time_us;
185 uint64_t diff_ms = 0;
188 if(!((
tmp->getFeat_id().boardNum == 6) || (
tmp->getFeat_id().boardNum == 8)))
194 printf(
"error in heck_received_debug_data\n");
214 if((jointNum == 0) && ((
tmp->getFeat_id().boardNum == 6) || (
tmp->getFeat_id().boardNum == 8)))
220 if(test_data_ptr->diff_packets != old_diff_packets[
tmp->getFeat_id().boardNum][jointNum])
222 yError() <<
"board" <<
tmp->getFeat_id().name <<
"joint" << jointNum <<
"--------- diff_packets ----- " << test_data_ptr->diff_packets;
223 old_diff_packets[
tmp->getFeat_id().boardNum][jointNum] = test_data_ptr->diff_packets;
228 if((test_data_ptr->time == 0xABABABABABABABAB) &&
229 (test_data_ptr->setpoint == 0xCCCCCCCC) &&
230 (test_data_ptr->numofrecpkt == 0xFF) &&
231 (test_data_ptr->numofprocesspkt == 0xEE)
244 if((test_data_ptr->numofrecpkt != test_data_ptr->numofprocesspkt) || (test_data_ptr->numofrecpkt > 1))
246 struct timeval err_time;
247 gettimeofday(&err_time, NULL);
248 yError() <<
"[" << err_time.tv_sec <<
"." <<err_time.tv_usec <<
"] QUEUEUEUEUE" <<
tmp->getFeat_id().boardNum <<
"joint " << jointNum <<
"recv " << test_data_ptr->numofrecpkt <<
"processed " << test_data_ptr->numofprocesspkt;
254 if((test_data_ptr->exit_cond != 0) && (test_data_ptr->exit_cond != -5))
256 struct timeval err_time;
257 gettimeofday(&err_time, NULL);
258 yError() <<
"[" << err_time.tv_sec <<
"." <<err_time.tv_usec <<
"] board " <<
tmp->getFeat_id().boardNum <<
"exit_cond" << test_data_ptr->exit_cond;
262 tmp->j_debug_data[jointNum].mutex.wait();
264 if(test_data_ptr->setpoint ==
tmp->j_debug_data[jointNum].pos)
266 if(
tmp->j_debug_data[jointNum].gotIt)
268 tmp->j_debug_data[jointNum].mutex.post();
274 tmp->j_debug_data[jointNum].gotIt =
true;
275 curr_time_us = eoy_sys_abstime_get(eoy_sys_GetHandle());
276 diff_ms = (curr_time_us - test_data_ptr->time) /1000;
277 struct timeval err_time;
278 gettimeofday(&err_time, NULL);
280 yWarning() <<
"Got Ack for EMS" <<
tmp->getFeat_id().boardNum <<
"joint " << jointNum <<
"with time " << diff_ms <<
"and count_old " <<
tmp->j_debug_data[jointNum].count_old <<
"[" << err_time.tv_sec <<
"." <<err_time.tv_usec <<
"]";
284 else if(test_data_ptr->setpoint ==
tmp->j_debug_data[jointNum].last_pos)
286 tmp->j_debug_data[jointNum].count_old++;
288 if(
tmp->j_debug_data[jointNum].count_old == 10)
289 yWarning() <<
"*** for EMS" <<
tmp->getFeat_id().boardNum <<
"joint " << jointNum <<
"count_old =" <<
tmp->j_debug_data[jointNum].count_old;
293 if(!
tmp->j_debug_data[jointNum].wtf)
295 struct timeval err_time;
296 gettimeofday(&err_time, NULL);
298 yError() <<
"[" << err_time.tv_sec <<
"." <<err_time.tv_usec <<
"] LOST PACKET for EMS" <<
tmp->getFeat_id().boardNum <<
"joint " << jointNum <<
"and count_old " <<
tmp->j_debug_data[jointNum].count_old;
301 tmp->j_debug_data[jointNum].wtf =
true;
304 tmp->j_debug_data[jointNum].mutex.post();
embObjMotionControl : driver for iCub motor control boards EMS on a ETH bus.
static eth::TheEthManager * _interface2ethManager