bool service_app_create(void *data) { appdata *ad = data; LOGE("Service launched"); if (!_check_remote_port(ad)) { LOGE("Failed to found remote port!"); return false; } if (!_check_for_sensor(SENSOR_ACCELEROMETER) || !_check_for_sensor(SENSOR_GYROSCOPE)) { LOGE("Sensors are not supported"); } else { // init sensors LOGE("Initialization of sensors"); if (!_init_sensor(SENSOR_ACCELEROMETER, &ad->accel, &ad->accel_listener) || !_init_sensor(SENSOR_GYROSCOPE, &ad->gyro, &ad->gyro_listener)) { LOGE("Failed to init sensors"); } else { LOGE("Sensor initialized!"); } } return true; }
void AP_InertialSensor::init( Start_style style, Sample_rate sample_rate, void (*delay_cb)(unsigned long t), void (*flash_leds_cb)(bool on), AP_PeriodicProcess * scheduler, FastSerial * serial) { _serial = serial; _product_id = _init_sensor(scheduler, sample_rate); // check scaling Vector3f accel_scale = _accel_scale.get(); if( accel_scale.x == 0 && accel_scale.y == 0 && accel_scale.z == 0 ) { accel_scale.x = accel_scale.y = accel_scale.z = 1.0; _accel_scale.set(accel_scale); } if (WARM_START != style) { if (_serial) _serial->printf_P(PSTR("Init Cold start")); // //TEO // //per comodità inserisco calibrazione accel // _init_accel(delay_cb, flash_leds_cb); // do cold-start calibration for gyro only _init_gyro(delay_cb, flash_leds_cb); } }
void AP_InertialSensor::init( Start_style style, Sample_rate sample_rate) { _product_id = _init_sensor(sample_rate); // check scaling Vector3f accel_scale = _accel_scale.get(); if( accel_scale.x == 0 && accel_scale.y == 0 && accel_scale.z == 0 ) { accel_scale.x = accel_scale.y = accel_scale.z = 1.0; _accel_scale.set(accel_scale); } if (WARM_START != style) { // do cold-start calibration for gyro only _init_gyro(); } }
void AP_InertialSensor::init( Start_style style, Sample_rate sample_rate) { _product_id = _init_sensor(sample_rate); // check scaling for (uint8_t i=0; i<get_accel_count(); i++) { if (_accel_scale[i].get().is_zero()) { _accel_scale[i].set(Vector3f(1,1,1)); } } if (WARM_START != style) { // do cold-start calibration for gyro only _init_gyro(); } }
void AP_InertialSensor::init( Start_style style, void (*delay_cb)(unsigned long t), void (*flash_leds_cb)(bool on), AP_PeriodicProcess * scheduler ) { _product_id = _init_sensor(scheduler); // check scaling Vector3f accel_scale = _accel_scale.get(); if( accel_scale.x == 0 && accel_scale.y == 0 && accel_scale.z == 0 ) { accel_scale.x = accel_scale.y = accel_scale.z = 1.0; _accel_scale.set(accel_scale); } if (WARM_START != style) { // do cold-start calibration for gyro only _init_gyro(delay_cb, flash_leds_cb); } }