bool IMUCounter::handle_msg(const struct log_Format &f, uint8_t *msg) { if (strncmp(f.name,"IMU",4)) { // not an IMU message return true; } if (handler->field_value(msg, "TimeUS", last_imu_timestamp)) { } else if (handler->field_value(msg, "TimeMS", last_imu_timestamp)) { last_imu_timestamp *= 1000; } else { ::printf("Unable to find timestamp in IMU message"); } return true; }
bool IMUCounter::handle_msg(const struct log_Format &f, uint8_t *msg) { if (strncmp(f.name,"PARM",4) == 0) { // gather parameter values to check for SCHED_LOOP_RATE parm_handler->field_value(msg, "Name", last_parm_name, sizeof(last_parm_name)); parm_handler->field_value(msg, "Value", last_parm_value); return true; } if (strncmp(f.name,"IMU",4) && strncmp(f.name,"IMT",4)) { // not an IMU message return true; } if (handler->field_value(msg, "TimeUS", last_clock_timestamp)) { } else if (handler->field_value(msg, "TimeMS", last_clock_timestamp)) { last_clock_timestamp *= 1000; } else { ::printf("Unable to find timestamp in message"); } return true; }