mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 03:43:34 +08:00
VTOL: remove virtual actuator_controls and instead use virtual torque/thrust topics
MC/FW rate controller and auto tuner: remove actuator_controls AirshipAttControl: remove actuator_controls MulticopterLandDetector: remove actuator_controls mavlink streams vfr_hud and high_latency2: remove actuator_controls RoverPositionController: remove actuator_controls UUVAttitudeController: remove actuator_controls battery: use length of thrust_setpoint for throttle compensation VehicleMagnetometer: use length of thrust_setpoint for throttle compensation Signed-off-by: Silvan Fuhrer
This commit is contained in:
@@ -364,11 +364,13 @@ void VehicleMagnetometer::UpdatePowerCompensation()
|
||||
if (_mag_comp_type != MagCompensationType::Disabled) {
|
||||
// update power signal for mag compensation
|
||||
if (_armed && (_mag_comp_type == MagCompensationType::Throttle)) {
|
||||
actuator_controls_s controls;
|
||||
vehicle_thrust_setpoint_s vehicle_thrust_setpoint;
|
||||
|
||||
if (_vehicle_thrust_setpoint_0_sub.update(&vehicle_thrust_setpoint)) {
|
||||
const matrix::Vector3f thrust_setpoint = matrix::Vector3f(vehicle_thrust_setpoint.xyz);
|
||||
|
||||
if (_actuator_controls_0_sub.update(&controls)) {
|
||||
for (auto &cal : _calibration) {
|
||||
cal.UpdatePower(controls.control[actuator_controls_s::INDEX_THROTTLE]);
|
||||
cal.UpdatePower(thrust_setpoint.length());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
#include <uORB/Subscription.hpp>
|
||||
#include <uORB/SubscriptionMultiArray.hpp>
|
||||
#include <uORB/SubscriptionCallback.hpp>
|
||||
#include <uORB/topics/actuator_controls.h>
|
||||
#include <uORB/topics/battery_status.h>
|
||||
#include <uORB/topics/estimator_sensor_bias.h>
|
||||
#include <uORB/topics/magnetometer_bias_estimate.h>
|
||||
@@ -60,6 +59,7 @@
|
||||
#include <uORB/topics/sensors_status.h>
|
||||
#include <uORB/topics/vehicle_control_mode.h>
|
||||
#include <uORB/topics/vehicle_magnetometer.h>
|
||||
#include <uORB/topics/vehicle_thrust_setpoint.h>
|
||||
|
||||
using namespace time_literals;
|
||||
|
||||
@@ -110,7 +110,7 @@ private:
|
||||
|
||||
uORB::SubscriptionInterval _parameter_update_sub{ORB_ID(parameter_update), 1_s};
|
||||
|
||||
uORB::Subscription _actuator_controls_0_sub{ORB_ID(actuator_controls_0)};
|
||||
uORB::Subscription _vehicle_thrust_setpoint_0_sub{ORB_ID(vehicle_thrust_setpoint), 0};
|
||||
uORB::Subscription _battery_status_sub{ORB_ID(battery_status), 0};
|
||||
uORB::Subscription _magnetometer_bias_estimate_sub{ORB_ID(magnetometer_bias_estimate)};
|
||||
uORB::Subscription _vehicle_control_mode_sub{ORB_ID(vehicle_control_mode)};
|
||||
|
||||
Reference in New Issue
Block a user