mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 20: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)
|
||||
|
||||
Reference in New Issue
Block a user