APM:Libraries
Public Member Functions | Public Attributes | Static Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
AP_InertialSensor::BatchSampler Class Reference

#include <AP_InertialSensor.h>

Collaboration diagram for AP_InertialSensor::BatchSampler:
[legend]

Public Member Functions

 BatchSampler (const AP_InertialSensor &imu)
 
void init ()
 
void sample (uint8_t instance, IMU_SENSOR_TYPE _type, uint64_t sample_us, const Vector3f &sample)
 
void periodic ()
 
bool doing_sensor_rate_logging () const
 

Public Attributes

AP_Int16 _required_count
 
AP_Int8 _sensor_mask
 
AP_Int8 _batch_options_mask
 
AP_Int16 samples_per_msg
 
AP_Int8 push_interval_ms
 

Static Public Attributes

static const struct AP_Param::GroupInfo var_info []
 

Private Types

enum  batch_opt_t { BATCH_OPT_SENSOR_RATE = (1<<0) }
 

Private Member Functions

void rotate_to_next_sensor ()
 
void update_doing_sensor_rate_logging ()
 
bool should_log (uint8_t instance, IMU_SENSOR_TYPE type)
 
void push_data_to_log ()
 

Private Attributes

uint64_t measurement_started_us
 
bool initialised: 1
 
bool isbh_sent: 1
 
bool _doing_sensor_rate_logging: 1
 
uint8_t instance: 3
 
AP_InertialSensor::IMU_SENSOR_TYPE type: 1
 
uint16_t isb_seqnum
 
int16_t * data_x
 
int16_t * data_y
 
int16_t * data_z
 
uint16_t data_write_offset
 
uint16_t data_read_offset
 
uint32_t last_sent_ms
 
uint16_t multiplier
 
const AP_InertialSensor_imu
 

Detailed Description

Definition at line 283 of file AP_InertialSensor.h.

Member Enumeration Documentation

◆ batch_opt_t

Enumerator
BATCH_OPT_SENSOR_RATE 

Definition at line 322 of file AP_InertialSensor.h.

Constructor & Destructor Documentation

◆ BatchSampler()

AP_InertialSensor::BatchSampler::BatchSampler ( const AP_InertialSensor imu)
inline

Definition at line 285 of file AP_InertialSensor.h.

Here is the call graph for this function:

Member Function Documentation

◆ doing_sensor_rate_logging()

bool AP_InertialSensor::BatchSampler::doing_sensor_rate_logging ( ) const
inline

Definition at line 297 of file AP_InertialSensor.h.

Referenced by AP_InertialSensor_Backend::_notify_new_accel_sensor_rate_sample(), AP_InertialSensor_Backend::_notify_new_gyro_sensor_rate_sample(), AP_InertialSensor_Backend::log_accel_raw(), and AP_InertialSensor_Backend::log_gyro_raw().

Here is the caller graph for this function:

◆ init()

void AP_InertialSensor::BatchSampler::init ( void  )

Definition at line 46 of file BatchSampler.cpp.

Referenced by BatchSampler(), and AP_InertialSensor::init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ periodic()

void AP_InertialSensor::BatchSampler::periodic ( )

Definition at line 79 of file BatchSampler.cpp.

Referenced by BatchSampler(), and AP_InertialSensor::periodic().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ push_data_to_log()

void AP_InertialSensor::BatchSampler::push_data_to_log ( )
private

Definition at line 163 of file BatchSampler.cpp.

Referenced by periodic().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotate_to_next_sensor()

void AP_InertialSensor::BatchSampler::rotate_to_next_sensor ( )
private

Definition at line 104 of file BatchSampler.cpp.

Referenced by init(), and push_data_to_log().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sample()

void AP_InertialSensor::BatchSampler::sample ( uint8_t  instance,
AP_InertialSensor::IMU_SENSOR_TYPE  _type,
uint64_t  sample_us,
const Vector3f sample 
)

Definition at line 264 of file BatchSampler.cpp.

Referenced by AP_InertialSensor_Backend::_notify_new_accel_sensor_rate_sample(), AP_InertialSensor_Backend::_notify_new_gyro_sensor_rate_sample(), BatchSampler(), AP_InertialSensor_Backend::log_accel_raw(), and AP_InertialSensor_Backend::log_gyro_raw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ should_log()

bool AP_InertialSensor::BatchSampler::should_log ( uint8_t  instance,
IMU_SENSOR_TYPE  type 
)
private

Definition at line 236 of file BatchSampler.cpp.

Referenced by sample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_doing_sensor_rate_logging()

void AP_InertialSensor::BatchSampler::update_doing_sensor_rate_logging ( )
private

Definition at line 87 of file BatchSampler.cpp.

Referenced by rotate_to_next_sensor().

Here is the caller graph for this function:

Member Data Documentation

◆ _batch_options_mask

AP_Int8 AP_InertialSensor::BatchSampler::_batch_options_mask

Definition at line 305 of file AP_InertialSensor.h.

Referenced by update_doing_sensor_rate_logging().

◆ _doing_sensor_rate_logging

bool AP_InertialSensor::BatchSampler::_doing_sensor_rate_logging
private

◆ _imu

const AP_InertialSensor& AP_InertialSensor::BatchSampler::_imu
private

◆ _required_count

AP_Int16 AP_InertialSensor::BatchSampler::_required_count

Definition at line 303 of file AP_InertialSensor.h.

Referenced by init(), push_data_to_log(), and should_log().

◆ _sensor_mask

AP_Int8 AP_InertialSensor::BatchSampler::_sensor_mask

◆ data_read_offset

uint16_t AP_InertialSensor::BatchSampler::data_read_offset
private

Definition at line 344 of file AP_InertialSensor.h.

Referenced by push_data_to_log().

◆ data_write_offset

uint16_t AP_InertialSensor::BatchSampler::data_write_offset
private

Definition at line 343 of file AP_InertialSensor.h.

Referenced by push_data_to_log(), sample(), and should_log().

◆ data_x

int16_t* AP_InertialSensor::BatchSampler::data_x
private

Definition at line 340 of file AP_InertialSensor.h.

Referenced by init(), push_data_to_log(), and sample().

◆ data_y

int16_t* AP_InertialSensor::BatchSampler::data_y
private

Definition at line 341 of file AP_InertialSensor.h.

Referenced by init(), push_data_to_log(), and sample().

◆ data_z

int16_t* AP_InertialSensor::BatchSampler::data_z
private

Definition at line 342 of file AP_InertialSensor.h.

Referenced by init(), push_data_to_log(), and sample().

◆ initialised

bool AP_InertialSensor::BatchSampler::initialised
private

Definition at line 334 of file AP_InertialSensor.h.

Referenced by init(), push_data_to_log(), and should_log().

◆ instance

uint8_t AP_InertialSensor::BatchSampler::instance
private

◆ isb_seqnum

uint16_t AP_InertialSensor::BatchSampler::isb_seqnum
private

Definition at line 339 of file AP_InertialSensor.h.

Referenced by push_data_to_log().

◆ isbh_sent

bool AP_InertialSensor::BatchSampler::isbh_sent
private

Definition at line 335 of file AP_InertialSensor.h.

Referenced by push_data_to_log().

◆ last_sent_ms

uint32_t AP_InertialSensor::BatchSampler::last_sent_ms
private

Definition at line 345 of file AP_InertialSensor.h.

Referenced by push_data_to_log().

◆ measurement_started_us

uint64_t AP_InertialSensor::BatchSampler::measurement_started_us
private

Definition at line 332 of file AP_InertialSensor.h.

Referenced by push_data_to_log(), and sample().

◆ multiplier

uint16_t AP_InertialSensor::BatchSampler::multiplier
private

Definition at line 348 of file AP_InertialSensor.h.

Referenced by push_data_to_log(), rotate_to_next_sensor(), and sample().

◆ push_interval_ms

AP_Int8 AP_InertialSensor::BatchSampler::push_interval_ms

Definition at line 316 of file AP_InertialSensor.h.

Referenced by push_data_to_log().

◆ samples_per_msg

AP_Int16 AP_InertialSensor::BatchSampler::samples_per_msg

Definition at line 315 of file AP_InertialSensor.h.

Referenced by push_data_to_log().

◆ type

AP_InertialSensor::IMU_SENSOR_TYPE AP_InertialSensor::BatchSampler::type
private

◆ var_info

const AP_Param::GroupInfo AP_InertialSensor::BatchSampler::var_info
static

Definition at line 300 of file AP_InertialSensor.h.

Referenced by BatchSampler().


The documentation for this class was generated from the following files: