Skip to content

Commit

Permalink
Tracker: move automatic declination setting into AP_Compass itself
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker authored and tridge committed Aug 13, 2019
1 parent 9d54b48 commit 2428487
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 24 deletions.
3 changes: 0 additions & 3 deletions AntennaTracker/AntennaTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ void Tracker::one_second_loop()
// updated armed/disarmed status LEDs
update_armed_disarmed();

// init compass location for declination
init_compass_location();

if (!ahrs.home_is_set()) {
// set home to current location
Location temp_loc;
Expand Down
1 change: 0 additions & 1 deletion AntennaTracker/Tracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ class Tracker : public AP_HAL::HAL::Callbacks {
// sensors.cpp
void update_ahrs();
void compass_save();
void init_compass_location();
void update_compass(void);
void accel_cal_update(void);
void update_GPS(void);
Expand Down
20 changes: 0 additions & 20 deletions AntennaTracker/sensors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,6 @@ void Tracker::update_ahrs()
ahrs.update();
}

/*
initialise compass's location used for declination
*/
void Tracker::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;
}
}
}

/*
read and update compass
*/
Expand Down Expand Up @@ -85,11 +70,6 @@ void Tracker::update_GPS(void)
if (!set_home(current_loc)) {
// silently ignored
}

if (AP::compass().enabled()) {
// Set compass declination automatically
compass.set_initial_location(gps.location().lat, gps.location().lng);
}
ground_start_count = 0;
}
}
Expand Down

0 comments on commit 2428487

Please sign in to comment.