Browse Source

Rover: move automatic declination setting into AP_Compass itself

master
Peter Barker 6 years ago committed by Andrew Tridgell
parent
commit
9d54b4820f
  1. 3
      APMrover2/Rover.cpp
  2. 1
      APMrover2/Rover.h
  3. 15
      APMrover2/sensors.cpp

3
APMrover2/Rover.cpp

@ -283,9 +283,6 @@ void Rover::one_second_loop(void) @@ -283,9 +283,6 @@ void Rover::one_second_loop(void)
update_home();
}
// init compass location for declination
init_compass_location();
// update error mask of sensors and subsystems. The mask uses the
// MAV_SYS_STATUS_* values from mavlink. If a bit is set then it
// indicates that the sensor or subsystem is present but not

1
APMrover2/Rover.h

@ -423,7 +423,6 @@ private: @@ -423,7 +423,6 @@ private:
bool trim_radio();
// sensors.cpp
void init_compass_location(void);
void update_compass(void);
void compass_save(void);
void init_beacon();

15
APMrover2/sensors.cpp

@ -3,21 +3,6 @@ @@ -3,21 +3,6 @@
#include <AP_RangeFinder/RangeFinder_Backend.h>
#include <AP_VisualOdom/AP_VisualOdom.h>
/*
initialise compass's location used for declination
*/
void Rover::init_compass_location(void)
{
// update initial location used for declination
if (!compass_init_location) {
Location loc;
if (ahrs.get_position(loc)) {
compass.set_initial_location(loc.lat, loc.lng);
compass_init_location = true;
}
}
}
// check for new compass data - 10Hz
void Rover::update_compass(void)
{

Loading…
Cancel
Save