mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 11:33:33 +08:00
Fix confusion between trajectory_setpoint and vehicle_local_postion_setpoint
This commit is contained in:
committed by
Daniel Agar
parent
7c237fca74
commit
75c63aee2a
@@ -212,12 +212,12 @@ bool MulticopterLandDetector::_get_ground_contact_state()
|
||||
// if we have a valid velocity setpoint and the vehicle is demanded to go down but no vertical movement present,
|
||||
// we then can assume that the vehicle hit ground
|
||||
if (_flag_control_climb_rate_enabled) {
|
||||
vehicle_local_position_setpoint_s trajectory_setpoint;
|
||||
trajectory_setpoint_s trajectory_setpoint;
|
||||
|
||||
if (_trajectory_setpoint_sub.update(&trajectory_setpoint)) {
|
||||
// Setpoints can be NAN
|
||||
_in_descend = PX4_ISFINITE(trajectory_setpoint.vz)
|
||||
&& (trajectory_setpoint.vz >= crawl_speed_threshold);
|
||||
_in_descend = PX4_ISFINITE(trajectory_setpoint.velocity[2])
|
||||
&& (trajectory_setpoint.velocity[2] >= crawl_speed_threshold);
|
||||
}
|
||||
|
||||
// ground contact requires commanded descent until landed
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
#include <uORB/topics/hover_thrust_estimate.h>
|
||||
#include <uORB/topics/trajectory_setpoint.h>
|
||||
#include <uORB/topics/vehicle_control_mode.h>
|
||||
#include <uORB/topics/vehicle_local_position_setpoint.h>
|
||||
#include <uORB/topics/takeoff_status.h>
|
||||
|
||||
#include "LandDetector.h"
|
||||
|
||||
Reference in New Issue
Block a user