mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 03:13: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:
@@ -86,10 +86,10 @@ MulticopterLandDetector::MulticopterLandDetector()
|
||||
|
||||
void MulticopterLandDetector::_update_topics()
|
||||
{
|
||||
actuator_controls_s actuator_controls;
|
||||
vehicle_thrust_setpoint_s vehicle_thrust_setpoint;
|
||||
|
||||
if (_actuator_controls_sub.update(&actuator_controls)) {
|
||||
_actuator_controls_throttle = actuator_controls.control[actuator_controls_s::INDEX_THROTTLE];
|
||||
if (_vehicle_thrust_setpoint_sub.update(&vehicle_thrust_setpoint)) {
|
||||
_vehicle_thrust_setpoint_throttle = -vehicle_thrust_setpoint.xyz[2];
|
||||
}
|
||||
|
||||
vehicle_control_mode_s vehicle_control_mode;
|
||||
@@ -207,7 +207,7 @@ bool MulticopterLandDetector::_get_ground_contact_state()
|
||||
// low thrust: 30% of throttle range between min and hover, relaxed to 60% if hover thrust estimate available
|
||||
const float thr_pct_hover = _hover_thrust_estimate_valid ? 0.6f : 0.3f;
|
||||
const float sys_low_throttle = _params.minThrottle + (_params.hoverThrottle - _params.minThrottle) * thr_pct_hover;
|
||||
_has_low_throttle = (_actuator_controls_throttle <= sys_low_throttle);
|
||||
_has_low_throttle = (_vehicle_thrust_setpoint_throttle <= sys_low_throttle);
|
||||
bool ground_contact = _has_low_throttle;
|
||||
|
||||
// if we have a valid velocity setpoint and the vehicle is demanded to go down but no vertical movement present,
|
||||
@@ -256,7 +256,7 @@ bool MulticopterLandDetector::_get_maybe_landed_state()
|
||||
minimum_thrust_threshold = (_params.minManThrottle + 0.01f);
|
||||
}
|
||||
|
||||
const bool minimum_thrust_now = _actuator_controls_throttle <= minimum_thrust_threshold;
|
||||
const bool minimum_thrust_now = _vehicle_thrust_setpoint_throttle <= minimum_thrust_threshold;
|
||||
_minimum_thrust_8s_hysteresis.set_state_and_update(minimum_thrust_now, now);
|
||||
|
||||
// Next look if vehicle is not rotating (do not consider yaw)
|
||||
|
||||
@@ -42,10 +42,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <uORB/topics/actuator_controls.h>
|
||||
#include <uORB/topics/hover_thrust_estimate.h>
|
||||
#include <uORB/topics/trajectory_setpoint.h>
|
||||
#include <uORB/topics/vehicle_control_mode.h>
|
||||
#include <uORB/topics/vehicle_thrust_setpoint.h>
|
||||
#include <uORB/topics/takeoff_status.h>
|
||||
|
||||
#include "LandDetector.h"
|
||||
@@ -105,7 +105,7 @@ private:
|
||||
float crawlSpeed;
|
||||
} _params{};
|
||||
|
||||
uORB::Subscription _actuator_controls_sub{ORB_ID(actuator_controls_0)};
|
||||
uORB::Subscription _vehicle_thrust_setpoint_sub{ORB_ID(vehicle_thrust_setpoint)};
|
||||
uORB::Subscription _hover_thrust_estimate_sub{ORB_ID(hover_thrust_estimate)};
|
||||
uORB::Subscription _trajectory_setpoint_sub{ORB_ID(trajectory_setpoint)};
|
||||
|
||||
@@ -118,7 +118,7 @@ private:
|
||||
bool _flag_control_climb_rate_enabled{false};
|
||||
bool _hover_thrust_initialized{false};
|
||||
|
||||
float _actuator_controls_throttle{0.f};
|
||||
float _vehicle_thrust_setpoint_throttle{0.f};
|
||||
|
||||
uint8_t _takeoff_state{takeoff_status_s::TAKEOFF_STATE_DISARMED};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user