mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-30 12:40:35 +08:00
MAVLink: Queue transponder reports and send them at full data rate
This will ensure that no transponder reports are dropped and that all received reports are passed on to the GCS and other devices.
This commit is contained in:
@@ -1178,6 +1178,11 @@ public:
|
||||
return new MavlinkStreamADSBVehicle(mavlink);
|
||||
}
|
||||
|
||||
virtual bool const_rate()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned get_size()
|
||||
{
|
||||
return (_pos_time > 0) ? MAVLINK_MSG_ID_ADSB_VEHICLE_LEN + MAVLINK_NUM_NON_PAYLOAD_BYTES : 0;
|
||||
@@ -1201,7 +1206,7 @@ protected:
|
||||
{
|
||||
struct transponder_report_s pos;
|
||||
|
||||
if (_pos_sub->update(&_pos_time, &pos)) {
|
||||
while (_pos_sub->update(&_pos_time, &pos)) {
|
||||
mavlink_adsb_vehicle_t msg = {};
|
||||
|
||||
msg.ICAO_address = pos.ICAO_address;
|
||||
|
||||
@@ -2087,7 +2087,7 @@ void MavlinkReceiver::handle_message_adsb_vehicle(mavlink_message_t *msg)
|
||||
//warnx("code: %d callsign: %s, vel: %8.4f", (int)t.ICAO_address, t.callsign, (double)t.hor_velocity);
|
||||
|
||||
if (_transponder_report_pub == nullptr) {
|
||||
_transponder_report_pub = orb_advertise(ORB_ID(transponder_report), &t);
|
||||
_transponder_report_pub = orb_advertise_queue(ORB_ID(transponder_report), &t, transponder_report_s::ORB_QUEUE_LENGTH);
|
||||
|
||||
} else {
|
||||
orb_publish(ORB_ID(transponder_report), _transponder_report_pub, &t);
|
||||
|
||||
Reference in New Issue
Block a user