MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / sample

Method sample

libraries/AP_InertialSensor/BatchSampler.cpp:274–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272#endif // HAL_LOGGING_ENABLED
273
274void AP_InertialSensor::BatchSampler::sample(uint8_t _instance, AP_InertialSensor::IMU_SENSOR_TYPE _type, uint64_t sample_us, const Vector3f &_sample)
275{
276#if HAL_LOGGING_ENABLED
277 if (!should_log(_instance, _type)) {
278 return;
279 }
280 if (data_write_offset == 0) {
281 measurement_started_us = sample_us;
282 }
283
284 data_x[data_write_offset] = multiplier*_sample.x;
285 data_y[data_write_offset] = multiplier*_sample.y;
286 data_z[data_write_offset] = multiplier*_sample.z;
287
288 data_write_offset++; // may unblock the reading process
289#endif
290}
291#endif //#if AP_INERTIALSENSOR_BATCHSAMPLER_ENABLED

Callers 4

log_gyro_rawMethod · 0.80
log_accel_rawMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected