mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-17 19:00:35 +08:00
Replace PublicationQueued with Publication to automatically configure ORB_QUEUE_LENGTH
This commit is contained in:
@@ -86,7 +86,7 @@ static void arm_auth_request_msg_send()
|
||||
vcmd.command = vehicle_command_s::VEHICLE_CMD_ARM_AUTHORIZATION_REQUEST;
|
||||
vcmd.target_system = arm_parameters.struct_value.authorizer_system_id;
|
||||
|
||||
uORB::PublicationQueued<vehicle_command_s> vcmd_pub{ORB_ID(vehicle_command)};
|
||||
uORB::Publication<vehicle_command_s> vcmd_pub{ORB_ID(vehicle_command)};
|
||||
vcmd_pub.publish(vcmd);
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ static struct vehicle_status_flags_s status_flags = {};
|
||||
void *commander_low_prio_loop(void *arg);
|
||||
|
||||
static void answer_command(const vehicle_command_s &cmd, unsigned result,
|
||||
uORB::PublicationQueued<vehicle_command_ack_s> &command_ack_pub);
|
||||
uORB::Publication<vehicle_command_ack_s> &command_ack_pub);
|
||||
|
||||
#if defined(BOARD_HAS_POWER_CONTROL)
|
||||
static orb_advert_t power_button_state_pub = nullptr;
|
||||
@@ -184,7 +184,7 @@ static bool send_vehicle_command(uint16_t cmd, float param1 = NAN, float param2
|
||||
|
||||
vcmd.timestamp = hrt_absolute_time();
|
||||
|
||||
uORB::PublicationQueued<vehicle_command_s> vcmd_pub{ORB_ID(vehicle_command)};
|
||||
uORB::Publication<vehicle_command_s> vcmd_pub{ORB_ID(vehicle_command)};
|
||||
|
||||
return vcmd_pub.publish(vcmd);
|
||||
}
|
||||
@@ -532,7 +532,7 @@ Commander::Commander() :
|
||||
|
||||
bool
|
||||
Commander::handle_command(vehicle_status_s *status_local, const vehicle_command_s &cmd, actuator_armed_s *armed_local,
|
||||
uORB::PublicationQueued<vehicle_command_ack_s> &command_ack_pub)
|
||||
uORB::Publication<vehicle_command_ack_s> &command_ack_pub)
|
||||
{
|
||||
/* only handle commands that are meant to be handled by this system and component */
|
||||
if (cmd.target_system != status_local->system_id || ((cmd.target_component != status_local->component_id)
|
||||
@@ -3377,7 +3377,7 @@ Commander::print_reject_arm(const char *msg)
|
||||
}
|
||||
|
||||
void answer_command(const vehicle_command_s &cmd, unsigned result,
|
||||
uORB::PublicationQueued<vehicle_command_ack_s> &command_ack_pub)
|
||||
uORB::Publication<vehicle_command_ack_s> &command_ack_pub)
|
||||
{
|
||||
switch (result) {
|
||||
case vehicle_command_s::VEHICLE_CMD_RESULT_ACCEPTED:
|
||||
@@ -3425,7 +3425,7 @@ void *commander_low_prio_loop(void *arg)
|
||||
int cmd_sub = orb_subscribe(ORB_ID(vehicle_command));
|
||||
|
||||
/* command ack */
|
||||
uORB::PublicationQueued<vehicle_command_ack_s> command_ack_pub{ORB_ID(vehicle_command_ack)};
|
||||
uORB::Publication<vehicle_command_ack_s> command_ack_pub{ORB_ID(vehicle_command_ack)};
|
||||
|
||||
/* wakeup source(s) */
|
||||
px4_pollfd_struct_t fds[1];
|
||||
|
||||
@@ -140,7 +140,7 @@ private:
|
||||
void estimator_check(const vehicle_status_flags_s &status_flags);
|
||||
|
||||
bool handle_command(vehicle_status_s *status, const vehicle_command_s &cmd, actuator_armed_s *armed,
|
||||
uORB::PublicationQueued<vehicle_command_ack_s> &command_ack_pub);
|
||||
uORB::Publication<vehicle_command_ack_s> &command_ack_pub);
|
||||
|
||||
unsigned handle_command_motor_test(const vehicle_command_s &cmd);
|
||||
|
||||
@@ -420,7 +420,7 @@ private:
|
||||
|
||||
uORB::PublicationData<home_position_s> _home_pub{ORB_ID(home_position)};
|
||||
|
||||
uORB::PublicationQueued<vehicle_command_ack_s> _command_ack_pub{ORB_ID(vehicle_command_ack)};
|
||||
uORB::Publication<vehicle_command_ack_s> _command_ack_pub{ORB_ID(vehicle_command_ack)};
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -614,7 +614,7 @@ bool calibrate_cancel_check(orb_advert_t *mavlink_log_pub, const hrt_abstime &ca
|
||||
command_ack.target_component = cmd.source_component;
|
||||
command_ack.timestamp = hrt_absolute_time();
|
||||
|
||||
uORB::PublicationQueued<vehicle_command_ack_s> command_ack_pub{ORB_ID(vehicle_command_ack)};
|
||||
uORB::Publication<vehicle_command_ack_s> command_ack_pub{ORB_ID(vehicle_command_ack)};
|
||||
command_ack_pub.publish(command_ack);
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user