mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 11:33:33 +08:00
delete unused actuator_controls_3
This commit is contained in:
@@ -561,40 +561,6 @@ void MavlinkReceiver::handle_message_command_both(mavlink_message_t *msg, const
|
||||
send_ack = true;
|
||||
}
|
||||
|
||||
} else if (cmd_mavlink.command == MAV_CMD_DO_SET_ACTUATOR) {
|
||||
// since we're only paying attention to 3 AUX outputs, the
|
||||
// index should be 0, otherwise ignore the message
|
||||
if (((int) vehicle_command.param7) == 0) {
|
||||
actuator_controls_s actuator_controls{};
|
||||
// update with existing values to avoid changing unspecified controls
|
||||
_actuator_controls_3_sub.update(&actuator_controls);
|
||||
|
||||
actuator_controls.timestamp = hrt_absolute_time();
|
||||
|
||||
bool updated = false;
|
||||
|
||||
if (PX4_ISFINITE(vehicle_command.param1)) {
|
||||
actuator_controls.control[5] = vehicle_command.param1;
|
||||
updated = true;
|
||||
}
|
||||
|
||||
if (PX4_ISFINITE(vehicle_command.param2)) {
|
||||
actuator_controls.control[6] = vehicle_command.param2;
|
||||
updated = true;
|
||||
}
|
||||
|
||||
if (PX4_ISFINITE(vehicle_command.param3)) {
|
||||
actuator_controls.control[7] = vehicle_command.param3;
|
||||
updated = true;
|
||||
}
|
||||
|
||||
if (updated) {
|
||||
_actuator_controls_pubs[3].publish(actuator_controls);
|
||||
}
|
||||
}
|
||||
|
||||
_cmd_pub.publish(vehicle_command);
|
||||
|
||||
} else if (cmd_mavlink.command == MAV_CMD_DO_AUTOTUNE_ENABLE) {
|
||||
|
||||
bool has_module = true;
|
||||
|
||||
@@ -290,7 +290,7 @@ private:
|
||||
uint16_t _mavlink_status_last_packet_rx_drop_count{0};
|
||||
|
||||
// ORB publications
|
||||
uORB::Publication<actuator_controls_s> _actuator_controls_pubs[4] {ORB_ID(actuator_controls_0), ORB_ID(actuator_controls_1), ORB_ID(actuator_controls_2), ORB_ID(actuator_controls_3)};
|
||||
uORB::Publication<actuator_controls_s> _actuator_controls_pubs[3] {ORB_ID(actuator_controls_0), ORB_ID(actuator_controls_1), ORB_ID(actuator_controls_2)};
|
||||
uORB::Publication<airspeed_s> _airspeed_pub{ORB_ID(airspeed)};
|
||||
uORB::Publication<battery_status_s> _battery_pub{ORB_ID(battery_status)};
|
||||
uORB::Publication<camera_status_s> _camera_status_pub{ORB_ID(camera_status)};
|
||||
@@ -353,7 +353,6 @@ private:
|
||||
uORB::Subscription _vehicle_local_position_sub{ORB_ID(vehicle_local_position)};
|
||||
uORB::Subscription _vehicle_global_position_sub{ORB_ID(vehicle_global_position)};
|
||||
uORB::Subscription _vehicle_status_sub{ORB_ID(vehicle_status)};
|
||||
uORB::Subscription _actuator_controls_3_sub{ORB_ID(actuator_controls_3)};
|
||||
uORB::Subscription _autotune_attitude_control_status_sub{ORB_ID(autotune_attitude_control_status)};
|
||||
|
||||
uORB::SubscriptionInterval _parameter_update_sub{ORB_ID(parameter_update), 1_s};
|
||||
|
||||
@@ -53,9 +53,6 @@ public:
|
||||
|
||||
case 2:
|
||||
return "ACTUATOR_CONTROL_TARGET2";
|
||||
|
||||
case 3:
|
||||
return "ACTUATOR_CONTROL_TARGET3";
|
||||
}
|
||||
|
||||
return "ACTUATOR_CONTROL_TARGET";
|
||||
@@ -88,10 +85,6 @@ private:
|
||||
case 2:
|
||||
_act_ctrl_sub = new uORB::Subscription{ORB_ID(actuator_controls_2)};
|
||||
break;
|
||||
|
||||
case 3:
|
||||
_act_ctrl_sub = new uORB::Subscription{ORB_ID(actuator_controls_3)};
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user