PX4 Firmware
PX4 Autopilot Software http://px4.io
DfLsm9ds1Wrapper Class Reference
Inheritance diagram for DfLsm9ds1Wrapper:
Collaboration diagram for DfLsm9ds1Wrapper:

Classes

struct  accel_calibration_s
 
struct  gyro_calibration_s
 
struct  mag_calibration_s
 

Public Member Functions

 DfLsm9ds1Wrapper (bool mag_enabled, enum Rotation rotation)
 
 ~DfLsm9ds1Wrapper ()
 
int start ()
 Start automatic measurement. More...
 
int stop ()
 Stop automatic measurement. More...
 
void info ()
 Print some debug info. More...
 

Private Member Functions

int _publish (struct imu_sensor_data &data)
 
void _update_accel_calibration ()
 
void _update_gyro_calibration ()
 
void _update_mag_calibration ()
 

Private Attributes

orb_advert_t _accel_topic
 
orb_advert_t _gyro_topic
 
orb_advert_t _mag_topic
 
orb_advert_t _mavlink_log_pub
 
int _param_update_sub
 
struct DfLsm9ds1Wrapper::accel_calibration_s _accel_calibration
 
struct DfLsm9ds1Wrapper::gyro_calibration_s _gyro_calibration
 
struct DfLsm9ds1Wrapper::mag_calibration_s _mag_calibration
 
matrix::Dcmf _rotation_matrix
 
int _accel_orb_class_instance
 
int _gyro_orb_class_instance
 
int _mag_orb_class_instance
 
Integrator _accel_int
 
Integrator _gyro_int
 
unsigned _publish_count
 
perf_counter_t _read_counter
 
perf_counter_t _error_counter
 
perf_counter_t _fifo_overflow_counter
 
perf_counter_t _fifo_corruption_counter
 
perf_counter_t _gyro_range_hit_counter
 
perf_counter_t _accel_range_hit_counter
 
perf_counter_t _publish_perf
 
hrt_abstime _last_accel_range_hit_time
 
uint64_t _last_accel_range_hit_count
 
bool _mag_enabled
 

Detailed Description

Definition at line 81 of file df_lsm9ds1_wrapper.cpp.

Constructor & Destructor Documentation

◆ DfLsm9ds1Wrapper()

DfLsm9ds1Wrapper::DfLsm9ds1Wrapper ( bool  mag_enabled,
enum Rotation  rotation 
)

Definition at line 172 of file df_lsm9ds1_wrapper.cpp.

References _accel_calibration, _accel_int, _accel_orb_class_instance, _accel_range_hit_counter, _error_counter, _fifo_corruption_counter, _fifo_overflow_counter, _gyro_calibration, _gyro_int, _gyro_orb_class_instance, _gyro_range_hit_counter, _last_accel_range_hit_count, _last_accel_range_hit_time, _mag_calibration, _mag_enabled, _mag_orb_class_instance, _publish_count, _publish_perf, _read_counter, _rotation_matrix, get_rot_matrix(), LSM9DS1_NEVER_AUTOPUBLISH_US, PC_COUNT, PC_ELAPSED, perf_alloc, DfLsm9ds1Wrapper::accel_calibration_s::x_offset, DfLsm9ds1Wrapper::gyro_calibration_s::x_offset, DfLsm9ds1Wrapper::mag_calibration_s::x_offset, DfLsm9ds1Wrapper::accel_calibration_s::x_scale, DfLsm9ds1Wrapper::gyro_calibration_s::x_scale, DfLsm9ds1Wrapper::mag_calibration_s::x_scale, DfLsm9ds1Wrapper::accel_calibration_s::y_offset, DfLsm9ds1Wrapper::gyro_calibration_s::y_offset, DfLsm9ds1Wrapper::mag_calibration_s::y_offset, DfLsm9ds1Wrapper::accel_calibration_s::y_scale, DfLsm9ds1Wrapper::gyro_calibration_s::y_scale, DfLsm9ds1Wrapper::mag_calibration_s::y_scale, DfLsm9ds1Wrapper::accel_calibration_s::z_offset, DfLsm9ds1Wrapper::gyro_calibration_s::z_offset, DfLsm9ds1Wrapper::mag_calibration_s::z_offset, DfLsm9ds1Wrapper::accel_calibration_s::z_scale, DfLsm9ds1Wrapper::gyro_calibration_s::z_scale, and DfLsm9ds1Wrapper::mag_calibration_s::z_scale.

Referenced by df_lsm9ds1_wrapper::start().

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

◆ ~DfLsm9ds1Wrapper()

DfLsm9ds1Wrapper::~DfLsm9ds1Wrapper ( )

Definition at line 227 of file df_lsm9ds1_wrapper.cpp.

References _accel_range_hit_counter, _error_counter, _fifo_corruption_counter, _fifo_overflow_counter, _gyro_range_hit_counter, _publish_perf, _read_counter, and perf_free().

Here is the call graph for this function:

Member Function Documentation

◆ _publish()

int DfLsm9ds1Wrapper::_publish ( struct imu_sensor_data &  data)
private

Definition at line 558 of file df_lsm9ds1_wrapper.cpp.

References _accel_calibration, _accel_int, _accel_range_hit_counter, _accel_topic, _error_counter, _fifo_corruption_counter, _fifo_overflow_counter, _gyro_calibration, _gyro_int, _gyro_range_hit_counter, _gyro_topic, _last_accel_range_hit_count, _last_accel_range_hit_time, _mag_calibration, _mag_enabled, _mag_topic, _mavlink_log_pub, _param_update_sub, _publish_count, _publish_perf, _read_counter, _rotation_matrix, _update_accel_calibration(), _update_gyro_calibration(), sensor_gyro_s::device_id, sensor_accel_s::device_id, Integrator::get_and_filtered(), hrt_absolute_time(), hrt_elapsed_time(), sensor_gyro_s::integral_dt, sensor_accel_s::integral_dt, mag_report, mavlink_log_critical, orb_check(), orb_copy(), ORB_ID, orb_publish(), perf_begin(), perf_end(), perf_set_count(), Integrator::put_with_interval(), sensor_gyro_s::scaling, sensor_accel_s::scaling, sensor_gyro_s::timestamp, sensor_accel_s::timestamp, sensor_gyro_s::x, sensor_accel_s::x, sensor_gyro_s::x_integral, sensor_accel_s::x_integral, DfLsm9ds1Wrapper::accel_calibration_s::x_offset, DfLsm9ds1Wrapper::gyro_calibration_s::x_offset, DfLsm9ds1Wrapper::mag_calibration_s::x_offset, sensor_gyro_s::x_raw, sensor_accel_s::x_raw, DfLsm9ds1Wrapper::accel_calibration_s::x_scale, DfLsm9ds1Wrapper::gyro_calibration_s::x_scale, DfLsm9ds1Wrapper::mag_calibration_s::x_scale, sensor_accel_s::y, sensor_gyro_s::y, sensor_accel_s::y_integral, sensor_gyro_s::y_integral, DfLsm9ds1Wrapper::accel_calibration_s::y_offset, DfLsm9ds1Wrapper::gyro_calibration_s::y_offset, DfLsm9ds1Wrapper::mag_calibration_s::y_offset, sensor_gyro_s::y_raw, sensor_accel_s::y_raw, DfLsm9ds1Wrapper::accel_calibration_s::y_scale, DfLsm9ds1Wrapper::gyro_calibration_s::y_scale, DfLsm9ds1Wrapper::mag_calibration_s::y_scale, sensor_gyro_s::z, sensor_accel_s::z, sensor_gyro_s::z_integral, sensor_accel_s::z_integral, DfLsm9ds1Wrapper::accel_calibration_s::z_offset, DfLsm9ds1Wrapper::gyro_calibration_s::z_offset, DfLsm9ds1Wrapper::mag_calibration_s::z_offset, sensor_accel_s::z_raw, sensor_gyro_s::z_raw, DfLsm9ds1Wrapper::accel_calibration_s::z_scale, DfLsm9ds1Wrapper::gyro_calibration_s::z_scale, and DfLsm9ds1Wrapper::mag_calibration_s::z_scale.

Here is the call graph for this function:

◆ _update_accel_calibration()

void DfLsm9ds1Wrapper::_update_accel_calibration ( )
private

Definition at line 402 of file df_lsm9ds1_wrapper.cpp.

References _accel_calibration, device_id, OK, param_find(), param_get(), DfLsm9ds1Wrapper::accel_calibration_s::x_offset, DfLsm9ds1Wrapper::accel_calibration_s::x_scale, DfLsm9ds1Wrapper::accel_calibration_s::y_offset, DfLsm9ds1Wrapper::accel_calibration_s::y_scale, DfLsm9ds1Wrapper::accel_calibration_s::z_offset, and DfLsm9ds1Wrapper::accel_calibration_s::z_scale.

Referenced by _publish(), and start().

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

◆ _update_gyro_calibration()

void DfLsm9ds1Wrapper::_update_gyro_calibration ( )
private

Definition at line 327 of file df_lsm9ds1_wrapper.cpp.

References _gyro_calibration, device_id, OK, param_find(), param_get(), DfLsm9ds1Wrapper::gyro_calibration_s::x_offset, DfLsm9ds1Wrapper::gyro_calibration_s::x_scale, DfLsm9ds1Wrapper::gyro_calibration_s::y_offset, DfLsm9ds1Wrapper::gyro_calibration_s::y_scale, DfLsm9ds1Wrapper::gyro_calibration_s::z_offset, and DfLsm9ds1Wrapper::gyro_calibration_s::z_scale.

Referenced by _publish(), and start().

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

◆ _update_mag_calibration()

void DfLsm9ds1Wrapper::_update_mag_calibration ( )
private

Definition at line 478 of file df_lsm9ds1_wrapper.cpp.

References _mag_calibration, _mag_enabled, device_id, OK, param_find(), param_get(), DfLsm9ds1Wrapper::mag_calibration_s::x_offset, DfLsm9ds1Wrapper::mag_calibration_s::x_scale, DfLsm9ds1Wrapper::mag_calibration_s::y_offset, DfLsm9ds1Wrapper::mag_calibration_s::y_scale, DfLsm9ds1Wrapper::mag_calibration_s::z_offset, and DfLsm9ds1Wrapper::mag_calibration_s::z_scale.

Referenced by start().

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

◆ info()

void DfLsm9ds1Wrapper::info ( )

Print some debug info.

Definition at line 315 of file df_lsm9ds1_wrapper.cpp.

References _accel_range_hit_counter, _error_counter, _fifo_corruption_counter, _fifo_overflow_counter, _gyro_range_hit_counter, _publish_perf, _read_counter, and perf_print_counter().

Referenced by df_lsm9ds1_wrapper::info().

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

◆ start()

int DfLsm9ds1Wrapper::start ( )

Start automatic measurement.

Returns
0 on success

Definition at line 239 of file df_lsm9ds1_wrapper.cpp.

References _accel_orb_class_instance, _accel_topic, _gyro_orb_class_instance, _gyro_topic, _mag_enabled, _mag_orb_class_instance, _mag_topic, _param_update_sub, _update_accel_calibration(), _update_gyro_calibration(), _update_mag_calibration(), ToneAlarmInterface::init(), mag_report, orb_advertise_multi(), ORB_ID, ORB_PRIO_DEFAULT, orb_subscribe(), and start().

Referenced by df_lsm9ds1_wrapper::start().

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

◆ stop()

int DfLsm9ds1Wrapper::stop ( )

Stop automatic measurement.

Returns
0 on success

Definition at line 302 of file df_lsm9ds1_wrapper.cpp.

References stop().

Referenced by df_lsm9ds1_wrapper::stop().

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

Member Data Documentation

◆ _accel_calibration

struct DfLsm9ds1Wrapper::accel_calibration_s DfLsm9ds1Wrapper::_accel_calibration
private

◆ _accel_int

Integrator DfLsm9ds1Wrapper::_accel_int
private

Definition at line 153 of file df_lsm9ds1_wrapper.cpp.

Referenced by _publish(), and DfLsm9ds1Wrapper().

◆ _accel_orb_class_instance

int DfLsm9ds1Wrapper::_accel_orb_class_instance
private

Definition at line 149 of file df_lsm9ds1_wrapper.cpp.

Referenced by DfLsm9ds1Wrapper(), and start().

◆ _accel_range_hit_counter

perf_counter_t DfLsm9ds1Wrapper::_accel_range_hit_counter
private

Definition at line 163 of file df_lsm9ds1_wrapper.cpp.

Referenced by _publish(), DfLsm9ds1Wrapper(), info(), and ~DfLsm9ds1Wrapper().

◆ _accel_topic

orb_advert_t DfLsm9ds1Wrapper::_accel_topic
private

Definition at line 114 of file df_lsm9ds1_wrapper.cpp.

Referenced by _publish(), and start().

◆ _error_counter

perf_counter_t DfLsm9ds1Wrapper::_error_counter
private

Definition at line 159 of file df_lsm9ds1_wrapper.cpp.

Referenced by _publish(), DfLsm9ds1Wrapper(), info(), and ~DfLsm9ds1Wrapper().

◆ _fifo_corruption_counter

perf_counter_t DfLsm9ds1Wrapper::_fifo_corruption_counter
private

Definition at line 161 of file df_lsm9ds1_wrapper.cpp.

Referenced by _publish(), DfLsm9ds1Wrapper(), info(), and ~DfLsm9ds1Wrapper().

◆ _fifo_overflow_counter

perf_counter_t DfLsm9ds1Wrapper::_fifo_overflow_counter
private

Definition at line 160 of file df_lsm9ds1_wrapper.cpp.

Referenced by _publish(), DfLsm9ds1Wrapper(), info(), and ~DfLsm9ds1Wrapper().

◆ _gyro_calibration

struct DfLsm9ds1Wrapper::gyro_calibration_s DfLsm9ds1Wrapper::_gyro_calibration
private

◆ _gyro_int

Integrator DfLsm9ds1Wrapper::_gyro_int
private

Definition at line 154 of file df_lsm9ds1_wrapper.cpp.

Referenced by _publish(), and DfLsm9ds1Wrapper().

◆ _gyro_orb_class_instance

int DfLsm9ds1Wrapper::_gyro_orb_class_instance
private

Definition at line 150 of file df_lsm9ds1_wrapper.cpp.

Referenced by DfLsm9ds1Wrapper(), and start().

◆ _gyro_range_hit_counter

perf_counter_t DfLsm9ds1Wrapper::_gyro_range_hit_counter
private

Definition at line 162 of file df_lsm9ds1_wrapper.cpp.

Referenced by _publish(), DfLsm9ds1Wrapper(), info(), and ~DfLsm9ds1Wrapper().

◆ _gyro_topic

orb_advert_t DfLsm9ds1Wrapper::_gyro_topic
private

Definition at line 115 of file df_lsm9ds1_wrapper.cpp.

Referenced by _publish(), and start().

◆ _last_accel_range_hit_count

uint64_t DfLsm9ds1Wrapper::_last_accel_range_hit_count
private

Definition at line 167 of file df_lsm9ds1_wrapper.cpp.

Referenced by _publish(), and DfLsm9ds1Wrapper().

◆ _last_accel_range_hit_time

hrt_abstime DfLsm9ds1Wrapper::_last_accel_range_hit_time
private

Definition at line 166 of file df_lsm9ds1_wrapper.cpp.

Referenced by _publish(), and DfLsm9ds1Wrapper().

◆ _mag_calibration

struct DfLsm9ds1Wrapper::mag_calibration_s DfLsm9ds1Wrapper::_mag_calibration
private

◆ _mag_enabled

bool DfLsm9ds1Wrapper::_mag_enabled
private

Definition at line 169 of file df_lsm9ds1_wrapper.cpp.

Referenced by _publish(), _update_mag_calibration(), DfLsm9ds1Wrapper(), and start().

◆ _mag_orb_class_instance

int DfLsm9ds1Wrapper::_mag_orb_class_instance
private

Definition at line 151 of file df_lsm9ds1_wrapper.cpp.

Referenced by DfLsm9ds1Wrapper(), and start().

◆ _mag_topic

orb_advert_t DfLsm9ds1Wrapper::_mag_topic
private

Definition at line 116 of file df_lsm9ds1_wrapper.cpp.

Referenced by _publish(), and start().

◆ _mavlink_log_pub

orb_advert_t DfLsm9ds1Wrapper::_mavlink_log_pub
private

Definition at line 117 of file df_lsm9ds1_wrapper.cpp.

Referenced by _publish().

◆ _param_update_sub

int DfLsm9ds1Wrapper::_param_update_sub
private

Definition at line 119 of file df_lsm9ds1_wrapper.cpp.

Referenced by _publish(), and start().

◆ _publish_count

unsigned DfLsm9ds1Wrapper::_publish_count
private

Definition at line 156 of file df_lsm9ds1_wrapper.cpp.

Referenced by _publish(), and DfLsm9ds1Wrapper().

◆ _publish_perf

perf_counter_t DfLsm9ds1Wrapper::_publish_perf
private

Definition at line 164 of file df_lsm9ds1_wrapper.cpp.

Referenced by _publish(), DfLsm9ds1Wrapper(), info(), and ~DfLsm9ds1Wrapper().

◆ _read_counter

perf_counter_t DfLsm9ds1Wrapper::_read_counter
private

Definition at line 158 of file df_lsm9ds1_wrapper.cpp.

Referenced by _publish(), DfLsm9ds1Wrapper(), info(), and ~DfLsm9ds1Wrapper().

◆ _rotation_matrix

matrix::Dcmf DfLsm9ds1Wrapper::_rotation_matrix
private

Definition at line 148 of file df_lsm9ds1_wrapper.cpp.

Referenced by _publish(), and DfLsm9ds1Wrapper().


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