47 #include <uORB/topics/vehicle_command.h> 48 #include <uORB/topics/vehicle_command_ack.h> 50 #include "timestamped_list.h" 51 #include "mavlink_bridge_header.h" 52 #include <v2.0/mavlink_types.h> 93 do {}
while (px4_sem_wait(&_lock) != 0);
102 static px4_sem_t _lock;
105 static const unsigned MAX_MAVLINK_CHANNEL = 4;
108 mavlink_command_long_t command = {};
111 int8_t num_sent_per_channel[MAX_MAVLINK_CHANNEL] = {-1, -1, -1, -1};
116 bool _debug_enabled =
false;
117 static constexpr uint8_t RETRIES = 3;
118 static constexpr uint64_t TIMEOUT_US = 500000;
static void initialize()
initialize: call this once on startup (this function is not thread-safe!)
Definition: mavlink_command_sender.cpp:49
void check_timeout(mavlink_channel_t channel)
Check timeouts to verify if an commands need retransmission.
Definition: mavlink_command_sender.cpp:138
High-resolution timer with callouts and timekeeping.
Synchronization primitive: Semaphore.
void handle_mavlink_command_ack(const mavlink_command_ack_t &ack, uint8_t from_sysid, uint8_t from_compid)
Handle mavlink command_ack.
Definition: mavlink_command_sender.cpp:114
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
Definition: drv_hrt.h:58
int handle_vehicle_command(const struct vehicle_command_s &command, mavlink_channel_t channel)
Send a command on a channel and keep it in a queue for retransmission.
Definition: mavlink_command_sender.cpp:68
Definition: mavlink_command_sender.h:57