mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 07:03:33 +08:00
sensors: create vehicle_angular_velocity module (#12596)
* split out filtered sensor_gyro aggregation from mc_att_control and move to wq:rate_ctrl
This commit is contained in:
@@ -95,6 +95,7 @@ void MulticopterLandDetector::_update_topics()
|
||||
_actuator_controls_sub.update(&_actuator_controls);
|
||||
_battery_sub.update(&_battery_status);
|
||||
_sensor_bias_sub.update(&_sensor_bias);
|
||||
_vehicle_angular_velocity_sub.update(&_vehicle_angular_velocity);
|
||||
_vehicle_attitude_sub.update(&_vehicle_attitude);
|
||||
_vehicle_control_mode_sub.update(&_control_mode);
|
||||
_vehicle_local_position_sub.update(&_vehicle_local_position);
|
||||
@@ -215,9 +216,9 @@ bool MulticopterLandDetector::_get_maybe_landed_state()
|
||||
// Next look if all rotation angles are not moving.
|
||||
float maxRotationScaled = _params.maxRotation_rad_s * landThresholdFactor;
|
||||
|
||||
bool rotating = (fabsf(_vehicle_attitude.rollspeed) > maxRotationScaled) ||
|
||||
(fabsf(_vehicle_attitude.pitchspeed) > maxRotationScaled) ||
|
||||
(fabsf(_vehicle_attitude.yawspeed) > maxRotationScaled);
|
||||
bool rotating = (fabsf(_vehicle_angular_velocity.xyz[0]) > maxRotationScaled) ||
|
||||
(fabsf(_vehicle_angular_velocity.xyz[1]) > maxRotationScaled) ||
|
||||
(fabsf(_vehicle_angular_velocity.xyz[2]) > maxRotationScaled);
|
||||
|
||||
// Return status based on armed state and throttle if no position lock is available.
|
||||
if (!_has_altitude_lock() && !rotating) {
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#include <uORB/topics/battery_status.h>
|
||||
#include <uORB/topics/parameter_update.h>
|
||||
#include <uORB/topics/sensor_bias.h>
|
||||
#include <uORB/topics/vehicle_angular_velocity.h>
|
||||
#include <uORB/topics/vehicle_attitude.h>
|
||||
#include <uORB/topics/vehicle_control_mode.h>
|
||||
#include <uORB/topics/vehicle_local_position.h>
|
||||
@@ -126,6 +127,7 @@ private:
|
||||
uORB::Subscription _actuator_controls_sub{ORB_ID(actuator_controls_0)};
|
||||
uORB::Subscription _battery_sub{ORB_ID(battery_status)};
|
||||
uORB::Subscription _sensor_bias_sub{ORB_ID(sensor_bias)};
|
||||
uORB::Subscription _vehicle_angular_velocity_sub{ORB_ID(vehicle_angular_velocity)};
|
||||
uORB::Subscription _vehicle_attitude_sub{ORB_ID(vehicle_attitude)};
|
||||
uORB::Subscription _vehicle_control_mode_sub{ORB_ID(vehicle_control_mode)};
|
||||
uORB::Subscription _vehicle_local_position_sub{ORB_ID(vehicle_local_position)};
|
||||
@@ -136,6 +138,7 @@ private:
|
||||
vehicle_control_mode_s _control_mode {};
|
||||
sensor_bias_s _sensor_bias {};
|
||||
vehicle_attitude_s _vehicle_attitude {};
|
||||
vehicle_angular_velocity_s _vehicle_angular_velocity{};
|
||||
vehicle_local_position_s _vehicle_local_position {};
|
||||
vehicle_local_position_setpoint_s _vehicle_local_position_setpoint {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user