mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
GCS_MAVLink: add send_ekf_origin
This commit is contained in:
parent
d66a980be3
commit
9a45940c25
@ -158,6 +158,8 @@ public:
|
||||
void send_vibration(const AP_InertialSensor &ins) const;
|
||||
void send_home(const Location &home) const;
|
||||
static void send_home_all(const Location &home);
|
||||
void send_ekf_origin(const Location &ekf_origin) const;
|
||||
static void send_ekf_origin_all(const Location &ekf_origin);
|
||||
void send_heartbeat(uint8_t type, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status);
|
||||
void send_servo_output_raw(bool hil);
|
||||
static void send_collision_all(const AP_Avoidance::Obstacle &threat, MAV_COLLISION_ACTION behaviour);
|
||||
|
@ -1416,6 +1416,33 @@ void GCS_MAVLINK::send_home_all(const Location &home)
|
||||
}
|
||||
}
|
||||
|
||||
void GCS_MAVLINK::send_ekf_origin(const Location &ekf_origin) const
|
||||
{
|
||||
if (HAVE_PAYLOAD_SPACE(chan, GPS_GLOBAL_ORIGIN)) {
|
||||
mavlink_msg_gps_global_origin_send(
|
||||
chan,
|
||||
ekf_origin.lat,
|
||||
ekf_origin.lng,
|
||||
ekf_origin.alt * 10);
|
||||
}
|
||||
}
|
||||
|
||||
void GCS_MAVLINK::send_ekf_origin_all(const Location &ekf_origin)
|
||||
{
|
||||
for (uint8_t i=0; i<MAVLINK_COMM_NUM_BUFFERS; i++) {
|
||||
if ((1U<<i) & mavlink_active) {
|
||||
mavlink_channel_t chan = (mavlink_channel_t)(MAVLINK_COMM_0+i);
|
||||
if (HAVE_PAYLOAD_SPACE(chan, GPS_GLOBAL_ORIGIN)) {
|
||||
mavlink_msg_gps_global_origin_send(
|
||||
chan,
|
||||
ekf_origin.lat,
|
||||
ekf_origin.lng,
|
||||
ekf_origin.alt * 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
wrapper for sending heartbeat
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user