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

#include <Compass_learn.h>

Collaboration diagram for CompassLearn:
[legend]

Classes

struct  sample
 

Public Member Functions

 CompassLearn (AP_AHRS &ahrs, Compass &compass)
 
void update (void)
 

Private Member Functions

void io_timer (void)
 
void process_sample (const struct sample &s)
 

Private Attributes

const AP_AHRSahrs
 
Compasscompass
 
bool have_earth_field
 
Vector3f predicted_offsets [num_sectors]
 
float errors [num_sectors]
 
uint32_t num_samples
 
Vector3f mag_ef
 
AP_HAL::Semaphoresem
 
Matrix3f mat
 
struct sample new_sample
 
bool sample_available
 
Vector3f last_field
 
Vector3f best_offsets
 
float best_error
 
float best_yaw_deg
 
float worst_error
 
bool converged
 

Static Private Attributes

static const uint16_t num_sectors = 72
 
static const uint32_t min_field_change = 60
 

Detailed Description

Definition at line 9 of file Compass_learn.h.

Constructor & Destructor Documentation

◆ CompassLearn()

CompassLearn::CompassLearn ( AP_AHRS ahrs,
Compass compass 
)

Definition at line 15 of file Compass_learn.cpp.

Member Function Documentation

◆ io_timer()

void CompassLearn::io_timer ( void  )
private

Definition at line 130 of file Compass_learn.cpp.

Referenced by update().

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

◆ process_sample()

void CompassLearn::process_sample ( const struct sample s)
private

Definition at line 149 of file Compass_learn.cpp.

Referenced by io_timer().

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

◆ update()

void CompassLearn::update ( void  )

Definition at line 24 of file Compass_learn.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ ahrs

const AP_AHRS& CompassLearn::ahrs
private

Definition at line 18 of file Compass_learn.h.

Referenced by update().

◆ best_error

float CompassLearn::best_error
private

Definition at line 52 of file Compass_learn.h.

Referenced by process_sample(), and update().

◆ best_offsets

Vector3f CompassLearn::best_offsets
private

Definition at line 51 of file Compass_learn.h.

Referenced by process_sample(), and update().

◆ best_yaw_deg

float CompassLearn::best_yaw_deg
private

Definition at line 53 of file Compass_learn.h.

Referenced by process_sample(), and update().

◆ compass

Compass& CompassLearn::compass
private

Definition at line 19 of file Compass_learn.h.

Referenced by update().

◆ converged

bool CompassLearn::converged
private

Definition at line 55 of file Compass_learn.h.

Referenced by update().

◆ errors

float CompassLearn::errors[num_sectors]
private

Definition at line 26 of file Compass_learn.h.

Referenced by process_sample(), and update().

◆ have_earth_field

bool CompassLearn::have_earth_field
private

Definition at line 20 of file Compass_learn.h.

Referenced by update().

◆ last_field

Vector3f CompassLearn::last_field
private

Definition at line 48 of file Compass_learn.h.

Referenced by update().

◆ mag_ef

Vector3f CompassLearn::mag_ef
private

Definition at line 30 of file Compass_learn.h.

Referenced by process_sample(), and update().

◆ mat

Matrix3f CompassLearn::mat
private

Definition at line 44 of file Compass_learn.h.

Referenced by process_sample(), and update().

◆ min_field_change

const uint32_t CompassLearn::min_field_change = 60
staticprivate

Definition at line 49 of file Compass_learn.h.

Referenced by update().

◆ new_sample

struct sample CompassLearn::new_sample
private

Definition at line 46 of file Compass_learn.h.

Referenced by io_timer(), and update().

◆ num_samples

uint32_t CompassLearn::num_samples
private

Definition at line 27 of file Compass_learn.h.

Referenced by process_sample(), and update().

◆ num_sectors

const uint16_t CompassLearn::num_sectors = 72
staticprivate

Definition at line 23 of file Compass_learn.h.

Referenced by process_sample(), and update().

◆ predicted_offsets

Vector3f CompassLearn::predicted_offsets[num_sectors]
private

Definition at line 25 of file Compass_learn.h.

Referenced by process_sample().

◆ sample_available

bool CompassLearn::sample_available
private

Definition at line 47 of file Compass_learn.h.

Referenced by io_timer(), and update().

◆ sem

AP_HAL::Semaphore* CompassLearn::sem
private

Definition at line 33 of file Compass_learn.h.

Referenced by io_timer(), process_sample(), and update().

◆ worst_error

float CompassLearn::worst_error
private

Definition at line 54 of file Compass_learn.h.

Referenced by process_sample(), and update().


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