Removed subscribtion to multiple _telemetry_status instances.

Since commander handles all telemetry_status the same there is no need to subscribe to multiple instances.


Signed-off-by: Claudio Micheli <claudio@auterion.com>
This commit is contained in:
Claudio Micheli
2019-03-12 11:24:33 +01:00
committed by Beat Küng
parent a53594135b
commit fb990d7de3
5 changed files with 87 additions and 100 deletions
+7 -2
View File
@@ -2552,8 +2552,13 @@ void Mavlink::publish_telemetry_status()
_tstatus.streams = _streams.size();
_tstatus.timestamp = hrt_absolute_time();
int instance;
orb_publish_auto(ORB_ID(telemetry_status), &_telem_status_pub, &_tstatus, &instance, ORB_PRIO_DEFAULT);
if (_telem_status_pub == nullptr) {
_telem_status_pub = orb_advertise_queue(ORB_ID(telemetry_status), &_tstatus, 3);
} else {
orb_publish(ORB_ID(telemetry_status), _telem_status_pub, &_tstatus);
}
}
void Mavlink::check_radio_config()
+1 -7
View File
@@ -1896,14 +1896,8 @@ MavlinkReceiver::handle_message_heartbeat(mavlink_message_t *msg)
tstatus.remote_component_id = msg->compid;
tstatus.remote_type = hb.type;
tstatus.remote_system_status = hb.system_status;
if (_telem_status_pub == nullptr) {
_telem_status_pub = orb_advertise(ORB_ID(telemetry_status), &tstatus);
} else {
orb_publish(ORB_ID(telemetry_status), _telem_status_pub, &tstatus);
}
}
}
}
-1
View File
@@ -253,7 +253,6 @@ private:
orb_advert_t _rc_pub{nullptr};
orb_advert_t _trajectory_waypoint_pub{nullptr};
orb_advert_t _transponder_report_pub{nullptr};
orb_advert_t _telem_status_pub{nullptr};
orb_advert_t _visual_odometry_pub{nullptr};
static constexpr int _gps_inject_data_queue_size{6};