mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-23 08:13:56 -04:00
Compass_PX4: get_primary made public
This commit is contained in:
parent
c16672a529
commit
a6c29ba1c3
@ -135,9 +135,9 @@ bool AP_Compass_PX4::read(void)
|
|||||||
_count[i] = 0;
|
_count[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
last_update = _last_timestamp[_get_primary()];
|
last_update = _last_timestamp[get_primary()];
|
||||||
|
|
||||||
return _healthy[_get_primary()];
|
return _healthy[get_primary()];
|
||||||
}
|
}
|
||||||
|
|
||||||
void AP_Compass_PX4::accumulate(void)
|
void AP_Compass_PX4::accumulate(void)
|
||||||
@ -153,7 +153,7 @@ void AP_Compass_PX4::accumulate(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t AP_Compass_PX4::_get_primary(void) const
|
uint8_t AP_Compass_PX4::get_primary(void) const
|
||||||
{
|
{
|
||||||
if (_primary < _num_instances && _healthy[_primary]) {
|
if (_primary < _num_instances && _healthy[_primary]) {
|
||||||
return _primary;
|
return _primary;
|
||||||
|
@ -19,8 +19,10 @@ public:
|
|||||||
// return the number of compass instances
|
// return the number of compass instances
|
||||||
uint8_t get_count(void) const { return _num_instances; }
|
uint8_t get_count(void) const { return _num_instances; }
|
||||||
|
|
||||||
|
// return the primary compass
|
||||||
|
uint8_t get_primary(void) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint8_t _get_primary(void) const;
|
|
||||||
uint8_t _num_instances;
|
uint8_t _num_instances;
|
||||||
int _mag_fd[COMPASS_MAX_INSTANCES];
|
int _mag_fd[COMPASS_MAX_INSTANCES];
|
||||||
Vector3f _sum[COMPASS_MAX_INSTANCES];
|
Vector3f _sum[COMPASS_MAX_INSTANCES];
|
||||||
|
Loading…
Reference in New Issue
Block a user