Rover: eliminate global static GCS_MAVLINK::send_home_all

This commit is contained in:
Peter Barker 2017-07-08 14:41:53 +10:00 committed by Francisco Ferreira
parent 731aaed8af
commit aeed1f0ff4
2 changed files with 4 additions and 2 deletions

View File

@ -14,6 +14,8 @@ public:
// return GCS link at offset ofs
GCS_MAVLINK_Rover &chan(const uint8_t ofs) override { return _chan[ofs]; };
// return GCS link at offset ofs
const GCS_MAVLINK_Rover &chan(const uint8_t ofs) const override { return _chan[ofs]; };
private:

View File

@ -136,7 +136,7 @@ bool Rover::set_home(const Location& loc, bool lock)
Log_Write_Home_And_Origin();
// send new home location to GCS
GCS_MAVLINK::send_home_all(loc);
gcs().send_home(loc);
// send text of home position to ground stations
gcs().send_text(MAV_SEVERITY_INFO, "Set HOME to %.6f %.6f at %.2fm",
@ -190,7 +190,7 @@ void Rover::update_home()
if (get_distance(loc, ahrs.get_home()) > DISTANCE_HOME_MAX) {
ahrs.set_home(loc);
Log_Write_Home_And_Origin();
GCS_MAVLINK::send_home_all(gps.location());
gcs().send_home(gps.location());
}
}
}