mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 21:53:34 +08:00
MultiCopterLandDetector: switch to local position
Instead of using the global position topic for NED velocities, let's use the local position topic. Also, use the xy and z valid flags instead of the system state. In case of no local position update, still rely on the throttle stick position.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2013-2015 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2013-2016 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -43,7 +43,7 @@
|
||||
#define __MULTICOPTER_LAND_DETECTOR_H__
|
||||
|
||||
#include "LandDetector.h"
|
||||
#include <uORB/topics/vehicle_global_position.h>
|
||||
#include <uORB/topics/vehicle_local_position.h>
|
||||
#include <uORB/topics/vehicle_attitude.h>
|
||||
#include <uORB/topics/vehicle_status.h>
|
||||
#include <uORB/topics/actuator_controls.h>
|
||||
@@ -97,25 +97,26 @@ private:
|
||||
struct {
|
||||
float maxClimbRate;
|
||||
float maxVelocity;
|
||||
float maxRotation;
|
||||
float maxRotation_rad_s;
|
||||
float maxThrottle;
|
||||
} _params;
|
||||
|
||||
private:
|
||||
int _vehicleGlobalPositionSub; /**< notification of global position */
|
||||
int _vehicleLocalPositionSub;
|
||||
int _vehicleStatusSub;
|
||||
int _actuatorsSub;
|
||||
int _armingSub;
|
||||
int _parameterSub;
|
||||
int _attitudeSub;
|
||||
|
||||
struct vehicle_global_position_s _vehicleGlobalPosition; /**< the result from global position subscription */
|
||||
struct vehicle_local_position_s _vehicleLocalPosition;
|
||||
struct vehicle_status_s _vehicleStatus;
|
||||
struct actuator_controls_s _actuators;
|
||||
struct actuator_armed_s _arming;
|
||||
struct vehicle_attitude_s _vehicleAttitude;
|
||||
|
||||
uint64_t _landTimer; /**< timestamp in microseconds since a possible land was detected*/
|
||||
/* timestamp in microseconds since a possible land was detected */
|
||||
uint64_t _landTimer;
|
||||
};
|
||||
|
||||
#endif //__MULTICOPTER_LAND_DETECTOR_H__
|
||||
|
||||
Reference in New Issue
Block a user