mavlink: STATUSTEXT directly use mavlink_log subscription

- ORB_ID(mavlink_log) increase queue depth now that mavlink ringbuffer is gone
This commit is contained in:
Daniel Agar
2020-11-14 21:56:53 -05:00
parent 387659d615
commit ed8a30d73e
5 changed files with 115 additions and 111 deletions
+2 -9
View File
@@ -50,6 +50,7 @@
#include <lib/ecl/geo/geo.h>
#include <lib/mathlib/mathlib.h>
#include <lib/systemlib/mavlink_log.h>
#include <lib/version/version.h>
#include <uORB/Publication.hpp>
@@ -2151,8 +2152,6 @@ Mavlink::task_main(int argc, char *argv[])
/* command ack */
uORB::Publication<vehicle_command_ack_s> command_ack_pub{ORB_ID(vehicle_command_ack)};
uORB::Subscription mavlink_log_sub{ORB_ID(mavlink_log)};
vehicle_status_s status{};
status_sub.copy(&status);
@@ -2170,7 +2169,7 @@ Mavlink::task_main(int argc, char *argv[])
/* HEARTBEAT is constant rate stream, rate never adjusted */
configure_stream("HEARTBEAT", 1.0f);
/* STATUSTEXT stream is like normal stream but gets messages from logbuffer instead of uORB */
/* STATUSTEXT stream */
configure_stream("STATUSTEXT", 20.0f);
/* COMMAND_LONG stream: use unlimited rate to send all commands */
@@ -2362,12 +2361,6 @@ Mavlink::task_main(int argc, char *argv[])
}
}
mavlink_log_s mavlink_log;
if (mavlink_log_sub.update(&mavlink_log)) {
_logbuffer.put(&mavlink_log);
}
/* check for shell output */
if (_mavlink_shell && _mavlink_shell->available() > 0) {
if (get_free_tx_buf() >= MAVLINK_MSG_ID_SERIAL_CONTROL_LEN + MAVLINK_NUM_NON_PAYLOAD_BYTES) {