mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 13:53:34 +08:00
uORB::Publication improvements and cleanup (#14784)
- create common uORB::PublicationBase - uORB::PublicationQueued types are now type aliases - ORB_PRIO use enum type everywhere to avoid accidental misuse - PX4Accelerometer/PX4Gyroscope/etc driver libs explicitly advertise on construction, unadvertise on destruction. This is a workaround for any potential issues that might appear when accel/gyro cdev and uORB indexing doesn't align.
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
#include <px4_platform_common/px4_config.h>
|
||||
#include <lib/parameters/param.h>
|
||||
#include <systemlib/mavlink_log.h>
|
||||
#include <uORB/PublicationQueued.hpp>
|
||||
#include <uORB/Publication.hpp>
|
||||
#include <uORB/topics/vehicle_command.h>
|
||||
#include <uORB/topics/vehicle_command_ack.h>
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
|
||||
// publications
|
||||
#include <uORB/Publication.hpp>
|
||||
#include <uORB/PublicationQueued.hpp>
|
||||
#include <uORB/topics/actuator_armed.h>
|
||||
#include <uORB/topics/home_position.h>
|
||||
#include <uORB/topics/test_motor.h>
|
||||
|
||||
@@ -556,7 +556,7 @@ calibrate_return do_accel_calibration_measurements(orb_advert_t *mavlink_log_pub
|
||||
|
||||
if (device_id[cur_accel] != 0) {
|
||||
// Get priority
|
||||
int32_t prio;
|
||||
ORB_PRIO prio = ORB_PRIO_UNINITIALIZED;
|
||||
orb_priority(worker_data.subs[cur_accel], &prio);
|
||||
|
||||
if (prio > device_prio_max) {
|
||||
|
||||
@@ -332,7 +332,7 @@ int do_gyro_calibration(orb_advert_t *mavlink_log_pub)
|
||||
|
||||
if (worker_data.device_id[cur_gyro] != 0) {
|
||||
// Get priority
|
||||
int32_t prio;
|
||||
ORB_PRIO prio = ORB_PRIO_UNINITIALIZED;
|
||||
orb_priority(worker_data.gyro_sensor_sub[cur_gyro], &prio);
|
||||
|
||||
if (prio > device_prio_max) {
|
||||
|
||||
@@ -639,7 +639,7 @@ calibrate_return mag_calibrate_all(orb_advert_t *mavlink_log_pub, int32_t cal_ma
|
||||
|
||||
if (device_ids[cur_mag] != 0) {
|
||||
// Get priority
|
||||
int32_t prio;
|
||||
ORB_PRIO prio = ORB_PRIO_UNINITIALIZED;
|
||||
orb_priority(worker_data.sub_mag[cur_mag], &prio);
|
||||
|
||||
if (prio > device_prio_max) {
|
||||
|
||||
Reference in New Issue
Block a user