mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
mavlink: properly initialize vehicle_command queue
This makes sure that the vehicle_command topic is properly initialized from the beginning. orb_exists returns -1 or 0 and not a bool as one would expect.
This commit is contained in:
@@ -118,7 +118,7 @@ Mavlink::Mavlink() :
|
||||
}
|
||||
|
||||
// ensure topic exists, otherwise we might lose first queued commands
|
||||
if (!orb_exists(ORB_ID(vehicle_command), 0)) {
|
||||
if (orb_exists(ORB_ID(vehicle_command), 0) == PX4_ERROR) {
|
||||
orb_advertise_queue(ORB_ID(vehicle_command), nullptr, vehicle_command_s::ORB_QUEUE_LENGTH);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user