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

#include <AP_InertialSensor_PX4.h>

Inheritance diagram for AP_InertialSensor_PX4:
[legend]
Collaboration diagram for AP_InertialSensor_PX4:
[legend]

Public Member Functions

 AP_InertialSensor_PX4 (AP_InertialSensor &imu)
 
bool update ()
 
void accumulate (void) override
 
- Public Member Functions inherited from AP_InertialSensor_Backend
 AP_InertialSensor_Backend (AP_InertialSensor &imu)
 
 AP_InertialSensor_Backend (const AP_InertialSensor_Backend &that)=delete
 
virtual ~AP_InertialSensor_Backend (void)
 
virtual void start ()
 
virtual AuxiliaryBusget_auxiliary_bus ()
 
int16_t get_id () const
 
void notify_fifo_reset (void)
 

Static Public Member Functions

static AP_InertialSensor_Backenddetect (AP_InertialSensor &imu)
 

Private Member Functions

bool _init_sensor (void)
 
void _get_sample (void)
 
void _new_accel_sample (uint8_t i, accel_report &accel_report)
 
void _new_gyro_sample (uint8_t i, gyro_report &gyro_report)
 
bool _get_gyro_sample (uint8_t i, struct gyro_report &gyro_report)
 
bool _get_accel_sample (uint8_t i, struct accel_report &accel_report)
 
uint8_t _queue_depth (uint16_t sensor_sample_rate) const
 

Private Attributes

uint64_t _last_accel_timestamp [INS_MAX_INSTANCES]
 
uint64_t _last_gyro_timestamp [INS_MAX_INSTANCES]
 
float _accel_sample_time [INS_MAX_INSTANCES]
 
float _gyro_sample_time [INS_MAX_INSTANCES]
 
uint8_t _num_accel_instances
 
uint8_t _num_gyro_instances
 
int _accel_fd [INS_MAX_INSTANCES]
 
int _gyro_fd [INS_MAX_INSTANCES]
 
uint8_t _accel_instance [INS_MAX_INSTANCES]
 
uint8_t _gyro_instance [INS_MAX_INSTANCES]
 

Additional Inherited Members

- Public Types inherited from AP_InertialSensor_Backend
enum  DevTypes {
  DEVTYPE_BMI160 = 0x09, DEVTYPE_L3G4200D = 0x10, DEVTYPE_ACC_LSM303D = 0x11, DEVTYPE_ACC_BMA180 = 0x12,
  DEVTYPE_ACC_MPU6000 = 0x13, DEVTYPE_ACC_MPU9250 = 0x16, DEVTYPE_ACC_IIS328DQ = 0x17, DEVTYPE_ACC_LSM9DS1 = 0x18,
  DEVTYPE_GYR_MPU6000 = 0x21, DEVTYPE_GYR_L3GD20 = 0x22, DEVTYPE_GYR_MPU9250 = 0x24, DEVTYPE_GYR_I3G4250D = 0x25,
  DEVTYPE_GYR_LSM9DS1 = 0x26, DEVTYPE_INS_ICM20789 = 0x27, DEVTYPE_INS_ICM20689 = 0x28
}
 
- Protected Member Functions inherited from AP_InertialSensor_Backend
void _rotate_and_correct_accel (uint8_t instance, Vector3f &accel)
 
void _rotate_and_correct_gyro (uint8_t instance, Vector3f &gyro)
 
void _publish_gyro (uint8_t instance, const Vector3f &gyro)
 
void _notify_new_gyro_raw_sample (uint8_t instance, const Vector3f &accel, uint64_t sample_us=0)
 
void _publish_accel (uint8_t instance, const Vector3f &accel)
 
void _notify_new_accel_raw_sample (uint8_t instance, const Vector3f &accel, uint64_t sample_us=0, bool fsync_set=false)
 
void _set_accel_oversampling (uint8_t instance, uint8_t n)
 
void _set_gyro_oversampling (uint8_t instance, uint8_t n)
 
void _set_accel_sensor_rate_sampling_enabled (uint8_t instance, bool value)
 
void _set_gyro_sensor_rate_sampling_enabled (uint8_t instance, bool value)
 
void _set_raw_sample_accel_multiplier (uint8_t instance, uint16_t mul)
 
void _set_raw_sampl_gyro_multiplier (uint8_t instance, uint16_t mul)
 
void _update_sensor_rate (uint16_t &count, uint32_t &start_us, float &rate_hz) const
 
void _set_accel_max_abs_offset (uint8_t instance, float offset)
 
uint32_t _accel_raw_sample_rate (uint8_t instance) const
 
void _set_accel_raw_sample_rate (uint8_t instance, uint16_t rate_hz)
 
uint32_t _gyro_raw_sample_rate (uint8_t instance) const
 
void _set_gyro_raw_sample_rate (uint8_t instance, uint16_t rate_hz)
 
void _publish_temperature (uint8_t instance, float temperature)
 
void _set_accel_error_count (uint8_t instance, uint32_t error_count)
 
void _set_gyro_error_count (uint8_t instance, uint32_t error_count)
 
void _inc_accel_error_count (uint8_t instance)
 
void _inc_gyro_error_count (uint8_t instance)
 
uint8_t _accel_filter_cutoff (void) const
 
uint8_t _gyro_filter_cutoff (void) const
 
uint16_t get_sample_rate_hz (void) const
 
void update_gyro (uint8_t instance)
 
void update_accel (uint8_t instance)
 
void set_gyro_orientation (uint8_t instance, enum Rotation rotation)
 
void set_accel_orientation (uint8_t instance, enum Rotation rotation)
 
void increment_clip_count (uint8_t instance)
 
bool enable_fast_sampling (uint8_t instance)
 
void _notify_new_accel_sensor_rate_sample (uint8_t instance, const Vector3f &accel)
 
void _notify_new_gyro_sensor_rate_sample (uint8_t instance, const Vector3f &gyro)
 
void notify_accel_fifo_reset (uint8_t instance)
 
void notify_gyro_fifo_reset (uint8_t instance)
 
- Protected Attributes inherited from AP_InertialSensor_Backend
AP_InertialSensor_imu
 
AP_HAL::Semaphore_sem
 
int16_t _id = -1
 
int8_t _last_accel_filter_hz [INS_MAX_INSTANCES]
 
int8_t _last_gyro_filter_hz [INS_MAX_INSTANCES]
 

Detailed Description

Definition at line 16 of file AP_InertialSensor_PX4.h.

Constructor & Destructor Documentation

◆ AP_InertialSensor_PX4()

AP_InertialSensor_PX4::AP_InertialSensor_PX4 ( AP_InertialSensor imu)

Definition at line 19 of file AP_InertialSensor_PX4.cpp.

Referenced by detect().

Here is the caller graph for this function:

Member Function Documentation

◆ _get_accel_sample()

bool AP_InertialSensor_PX4::_get_accel_sample ( uint8_t  i,
struct accel_report &  accel_report 
)
private

Definition at line 283 of file AP_InertialSensor_PX4.cpp.

Referenced by _get_sample().

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

◆ _get_gyro_sample()

bool AP_InertialSensor_PX4::_get_gyro_sample ( uint8_t  i,
struct gyro_report &  gyro_report 
)
private

Definition at line 294 of file AP_InertialSensor_PX4.cpp.

Referenced by _get_sample().

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

◆ _get_sample()

void AP_InertialSensor_PX4::_get_sample ( void  )
private

Definition at line 251 of file AP_InertialSensor_PX4.cpp.

Referenced by accumulate(), and update().

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

◆ _init_sensor()

bool AP_InertialSensor_PX4::_init_sensor ( void  )
private

Definition at line 53 of file AP_InertialSensor_PX4.cpp.

Referenced by accumulate(), and detect().

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

◆ _new_accel_sample()

void AP_InertialSensor_PX4::_new_accel_sample ( uint8_t  i,
accel_report &  accel_report 
)
private

Definition at line 178 of file AP_InertialSensor_PX4.cpp.

Referenced by _get_sample().

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

◆ _new_gyro_sample()

void AP_InertialSensor_PX4::_new_gyro_sample ( uint8_t  i,
gyro_report &  gyro_report 
)
private

Definition at line 216 of file AP_InertialSensor_PX4.cpp.

Referenced by _get_sample().

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

◆ _queue_depth()

uint8_t AP_InertialSensor_PX4::_queue_depth ( uint16_t  sensor_sample_rate) const
private

Definition at line 44 of file AP_InertialSensor_PX4.cpp.

Referenced by _init_sensor().

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

◆ accumulate()

void AP_InertialSensor_PX4::accumulate ( void  )
inlineoverridevirtual

Reimplemented from AP_InertialSensor_Backend.

Definition at line 29 of file AP_InertialSensor_PX4.h.

Here is the call graph for this function:

◆ detect()

AP_InertialSensor_Backend * AP_InertialSensor_PX4::detect ( AP_InertialSensor imu)
static

Definition at line 27 of file AP_InertialSensor_PX4.cpp.

Referenced by AP_InertialSensor::detect_backends().

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

◆ update()

bool AP_InertialSensor_PX4::update ( void  )
virtual

Implements AP_InertialSensor_Backend.

Definition at line 162 of file AP_InertialSensor_PX4.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _accel_fd

int AP_InertialSensor_PX4::_accel_fd[INS_MAX_INSTANCES]
private

Definition at line 52 of file AP_InertialSensor_PX4.h.

Referenced by _get_accel_sample(), and _init_sensor().

◆ _accel_instance

uint8_t AP_InertialSensor_PX4::_accel_instance[INS_MAX_INSTANCES]
private

Definition at line 57 of file AP_InertialSensor_PX4.h.

Referenced by _init_sensor(), _new_accel_sample(), and update().

◆ _accel_sample_time

float AP_InertialSensor_PX4::_accel_sample_time[INS_MAX_INSTANCES]
private

Definition at line 36 of file AP_InertialSensor_PX4.h.

Referenced by _init_sensor(), and _new_accel_sample().

◆ _gyro_fd

int AP_InertialSensor_PX4::_gyro_fd[INS_MAX_INSTANCES]
private

Definition at line 53 of file AP_InertialSensor_PX4.h.

Referenced by _get_gyro_sample(), and _init_sensor().

◆ _gyro_instance

uint8_t AP_InertialSensor_PX4::_gyro_instance[INS_MAX_INSTANCES]
private

Definition at line 58 of file AP_InertialSensor_PX4.h.

Referenced by _init_sensor(), _new_gyro_sample(), and update().

◆ _gyro_sample_time

float AP_InertialSensor_PX4::_gyro_sample_time[INS_MAX_INSTANCES]
private

Definition at line 37 of file AP_InertialSensor_PX4.h.

Referenced by _init_sensor(), and _new_gyro_sample().

◆ _last_accel_timestamp

uint64_t AP_InertialSensor_PX4::_last_accel_timestamp[INS_MAX_INSTANCES]
private

Definition at line 34 of file AP_InertialSensor_PX4.h.

Referenced by _get_accel_sample(), and _new_accel_sample().

◆ _last_gyro_timestamp

uint64_t AP_InertialSensor_PX4::_last_gyro_timestamp[INS_MAX_INSTANCES]
private

Definition at line 35 of file AP_InertialSensor_PX4.h.

Referenced by _get_gyro_sample(), and _new_gyro_sample().

◆ _num_accel_instances

uint8_t AP_InertialSensor_PX4::_num_accel_instances
private

Definition at line 49 of file AP_InertialSensor_PX4.h.

Referenced by _get_accel_sample(), _get_sample(), _init_sensor(), and update().

◆ _num_gyro_instances

uint8_t AP_InertialSensor_PX4::_num_gyro_instances
private

Definition at line 50 of file AP_InertialSensor_PX4.h.

Referenced by _get_gyro_sample(), _get_sample(), _init_sensor(), and update().


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