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

#include <AP_Compass_SITL.h>

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

Classes

struct  readings_compass
 

Public Member Functions

 AP_Compass_SITL (Compass &)
 
void read (void)
 
- Public Member Functions inherited from AP_Compass_Backend
 AP_Compass_Backend (Compass &compass)
 
virtual ~AP_Compass_Backend (void)
 
virtual void accumulate (void)
 
virtual void handle_mag_msg (Vector3f &mag)
 

Private Member Functions

void _timer ()
 

Private Attributes

uint8_t _compass_instance [SITL_NUM_COMPASSES]
 
SITL::SITL_sitl
 
uint8_t store_index
 
uint32_t last_store_time
 
VectorN< readings_compass, buffer_lengthbuffer
 
bool _has_sample
 
uint32_t _last_sample_time
 
Vector3f _mag_accum
 
uint32_t _accum_count
 

Static Private Attributes

static const uint8_t buffer_length = 50
 

Additional Inherited Members

- Public Types inherited from AP_Compass_Backend
enum  DevTypes {
  DEVTYPE_HMC5883_OLD = 0x01, DEVTYPE_HMC5883 = 0x07, DEVTYPE_LSM303D = 0x02, DEVTYPE_AK8963 = 0x04,
  DEVTYPE_BMM150 = 0x05, DEVTYPE_LSM9DS1 = 0x06, DEVTYPE_LIS3MDL = 0x08, DEVTYPE_AK09916 = 0x09,
  DEVTYPE_IST8310 = 0x0A, DEVTYPE_ICM20948 = 0x0B, DEVTYPE_MMC3416 = 0x0C, DEVTYPE_QMC5883L = 0x0D,
  DEVTYPE_MAG3110 = 0x0E
}
 
- Protected Member Functions inherited from AP_Compass_Backend
void rotate_field (Vector3f &mag, uint8_t instance)
 
void publish_raw_field (const Vector3f &mag, uint8_t instance)
 
void correct_field (Vector3f &mag, uint8_t i)
 
void publish_filtered_field (const Vector3f &mag, uint8_t instance)
 
void set_last_update_usec (uint32_t last_update, uint8_t instance)
 
uint8_t register_compass (void) const
 
void set_dev_id (uint8_t instance, uint32_t dev_id)
 
void set_external (uint8_t instance, bool external)
 
bool is_external (uint8_t instance)
 
void set_rotation (uint8_t instance, enum Rotation rotation)
 
bool field_ok (const Vector3f &field)
 
uint32_t get_error_count () const
 
- Protected Attributes inherited from AP_Compass_Backend
Compass_compass
 
AP_HAL::Semaphore_sem
 

Detailed Description

Definition at line 14 of file AP_Compass_SITL.h.

Constructor & Destructor Documentation

◆ AP_Compass_SITL()

AP_Compass_SITL::AP_Compass_SITL ( Compass compass)

Definition at line 8 of file AP_Compass_SITL.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ _timer()

void AP_Compass_SITL::_timer ( void  )
private

Definition at line 22 of file AP_Compass_SITL.cpp.

Referenced by AP_Compass_SITL().

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

◆ read()

void AP_Compass_SITL::read ( void  )
virtual

Implements AP_Compass_Backend.

Definition at line 91 of file AP_Compass_SITL.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _accum_count

uint32_t AP_Compass_SITL::_accum_count
private

Definition at line 39 of file AP_Compass_SITL.h.

Referenced by _timer(), and read().

◆ _compass_instance

uint8_t AP_Compass_SITL::_compass_instance[SITL_NUM_COMPASSES]
private

Definition at line 21 of file AP_Compass_SITL.h.

Referenced by _timer(), AP_Compass_SITL(), and read().

◆ _has_sample

bool AP_Compass_SITL::_has_sample
private

Definition at line 35 of file AP_Compass_SITL.h.

Referenced by _timer(), and read().

◆ _last_sample_time

uint32_t AP_Compass_SITL::_last_sample_time
private

Definition at line 36 of file AP_Compass_SITL.h.

Referenced by _timer().

◆ _mag_accum

Vector3f AP_Compass_SITL::_mag_accum
private

Definition at line 38 of file AP_Compass_SITL.h.

Referenced by _timer(), and read().

◆ _sitl

SITL::SITL* AP_Compass_SITL::_sitl
private

Definition at line 22 of file AP_Compass_SITL.h.

Referenced by _timer(), and AP_Compass_SITL().

◆ buffer

VectorN<readings_compass,buffer_length> AP_Compass_SITL::buffer
private

Definition at line 32 of file AP_Compass_SITL.h.

Referenced by _timer().

◆ buffer_length

const uint8_t AP_Compass_SITL::buffer_length = 50
staticprivate

Definition at line 31 of file AP_Compass_SITL.h.

Referenced by _timer().

◆ last_store_time

uint32_t AP_Compass_SITL::last_store_time
private

Definition at line 30 of file AP_Compass_SITL.h.

Referenced by _timer().

◆ store_index

uint8_t AP_Compass_SITL::store_index
private

Definition at line 29 of file AP_Compass_SITL.h.

Referenced by _timer().


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