mirror of https://github.com/ArduPilot/ardupilot
Tracker: use send_text method on the GCS singleton
This commit is contained in:
parent
02532af64b
commit
2039222c7e
|
@ -868,7 +868,7 @@ void Tracker::mavlink_delay_cb()
|
||||||
}
|
}
|
||||||
if (tnow - last_5s > 5000) {
|
if (tnow - last_5s > 5000) {
|
||||||
last_5s = tnow;
|
last_5s = tnow;
|
||||||
gcs_send_text(MAV_SEVERITY_INFO, "Initialising APM");
|
gcs().send_text(MAV_SEVERITY_INFO, "Initialising APM");
|
||||||
}
|
}
|
||||||
DataFlash.EnableWrites(true);
|
DataFlash.EnableWrites(true);
|
||||||
tracker.in_mavlink_delay = false;
|
tracker.in_mavlink_delay = false;
|
||||||
|
@ -898,26 +898,6 @@ void Tracker::gcs_update(void)
|
||||||
gcs().update();
|
gcs().update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tracker::gcs_send_text(MAV_SEVERITY severity, const char *str)
|
|
||||||
{
|
|
||||||
gcs().send_statustext(severity, 0xFF, str);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* send a low priority formatted message to the GCS
|
|
||||||
* only one fits in the queue, so if you send more than one before the
|
|
||||||
* last one gets into the serial buffer then the old one will be lost
|
|
||||||
*/
|
|
||||||
void Tracker::gcs_send_text_fmt(MAV_SEVERITY severity, const char *fmt, ...)
|
|
||||||
{
|
|
||||||
char str[MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN] {};
|
|
||||||
va_list arg_list;
|
|
||||||
va_start(arg_list, fmt);
|
|
||||||
hal.util->vsnprintf((char *)str, sizeof(str), fmt, arg_list);
|
|
||||||
va_end(arg_list);
|
|
||||||
gcs().send_statustext(severity, 0xFF, str);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
retry any deferred messages
|
retry any deferred messages
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -207,7 +207,6 @@ private:
|
||||||
void gcs_send_message(enum ap_message id);
|
void gcs_send_message(enum ap_message id);
|
||||||
void gcs_data_stream_send(void);
|
void gcs_data_stream_send(void);
|
||||||
void gcs_update(void);
|
void gcs_update(void);
|
||||||
void gcs_send_text(MAV_SEVERITY severity, const char *str);
|
|
||||||
void gcs_retry_deferred(void);
|
void gcs_retry_deferred(void);
|
||||||
void load_parameters(void);
|
void load_parameters(void);
|
||||||
void update_auto(void);
|
void update_auto(void);
|
||||||
|
@ -255,7 +254,6 @@ private:
|
||||||
void tracking_update_pressure(const mavlink_scaled_pressure_t &msg);
|
void tracking_update_pressure(const mavlink_scaled_pressure_t &msg);
|
||||||
void tracking_manual_control(const mavlink_manual_control_t &msg);
|
void tracking_manual_control(const mavlink_manual_control_t &msg);
|
||||||
void update_armed_disarmed();
|
void update_armed_disarmed();
|
||||||
void gcs_send_text_fmt(MAV_SEVERITY severity, const char *fmt, ...);
|
|
||||||
void init_capabilities(void);
|
void init_capabilities(void);
|
||||||
void compass_cal_update();
|
void compass_cal_update();
|
||||||
void Log_Write_Attitude();
|
void Log_Write_Attitude();
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
void Tracker::init_barometer(bool full_calibration)
|
void Tracker::init_barometer(bool full_calibration)
|
||||||
{
|
{
|
||||||
gcs_send_text(MAV_SEVERITY_INFO, "Calibrating barometer");
|
gcs().send_text(MAV_SEVERITY_INFO, "Calibrating barometer");
|
||||||
if (full_calibration) {
|
if (full_calibration) {
|
||||||
barometer.calibrate();
|
barometer.calibrate();
|
||||||
} else {
|
} else {
|
||||||
barometer.update_calibration();
|
barometer.update_calibration();
|
||||||
}
|
}
|
||||||
gcs_send_text(MAV_SEVERITY_INFO, "Barometer calibration complete");
|
gcs().send_text(MAV_SEVERITY_INFO, "Barometer calibration complete");
|
||||||
}
|
}
|
||||||
|
|
||||||
// read the barometer and return the updated altitude in meters
|
// read the barometer and return the updated altitude in meters
|
||||||
|
|
|
@ -98,7 +98,7 @@ void Tracker::init_tracker()
|
||||||
current_loc.lat = g.start_latitude * 1.0e7f;
|
current_loc.lat = g.start_latitude * 1.0e7f;
|
||||||
current_loc.lng = g.start_longitude * 1.0e7f;
|
current_loc.lng = g.start_longitude * 1.0e7f;
|
||||||
} else {
|
} else {
|
||||||
gcs_send_text(MAV_SEVERITY_NOTICE, "Ignoring invalid START_LATITUDE or START_LONGITUDE parameter");
|
gcs().send_text(MAV_SEVERITY_NOTICE, "Ignoring invalid START_LATITUDE or START_LONGITUDE parameter");
|
||||||
}
|
}
|
||||||
|
|
||||||
// see if EEPROM has a default location as well
|
// see if EEPROM has a default location as well
|
||||||
|
@ -108,7 +108,7 @@ void Tracker::init_tracker()
|
||||||
|
|
||||||
init_capabilities();
|
init_capabilities();
|
||||||
|
|
||||||
gcs_send_text(MAV_SEVERITY_INFO,"Ready to track");
|
gcs().send_text(MAV_SEVERITY_INFO,"Ready to track");
|
||||||
hal.scheduler->delay(1000); // Why????
|
hal.scheduler->delay(1000); // Why????
|
||||||
|
|
||||||
set_mode(AUTO); // tracking
|
set_mode(AUTO); // tracking
|
||||||
|
|
Loading…
Reference in New Issue