mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
camera_trigger : switch to queued publisher
This commit is contained in:
parent
b5ce55bab6
commit
3ba0275952
@ -1,3 +1,4 @@
|
||||
uint32 seq # Image sequence number
|
||||
|
||||
uint32 seq # Image sequence
|
||||
uint32 ORB_QUEUE_LENGTH = 3
|
||||
|
||||
|
||||
@ -631,8 +631,14 @@ CameraTrigger::engage(void *arg)
|
||||
|
||||
report.seq = trig->_trigger_seq++;
|
||||
|
||||
int instance_id = 0;
|
||||
orb_publish_auto(ORB_ID(camera_trigger), &trig->_trigger_pub, &report, &instance_id, ORB_PRIO_DEFAULT);
|
||||
if (trig->_trigger_pub == nullptr) {
|
||||
trig->_trigger_pub = orb_advertise_queue(ORB_ID(camera_trigger), &report,
|
||||
camera_trigger_s::ORB_QUEUE_LENGTH);
|
||||
|
||||
} else {
|
||||
orb_publish(ORB_ID(camera_trigger), trig->_trigger_pub, &report);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user