mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-20 03:13:44 +08:00
FlightTaskManual: increase rc timeout to 1.5 x COM_RC_LOSS_T
This commit is contained in:
committed by
ChristophTobler
parent
1f1c9fde01
commit
a24fdb93c3
@@ -262,10 +262,12 @@ void FlightTaskAuto::_set_heading_from_mode()
|
||||
if (v.length() > NAV_ACC_RAD.get()) {
|
||||
_compute_heading_from_2D_vector(_yaw_setpoint, v);
|
||||
_yaw_lock = false;
|
||||
|
||||
} else {
|
||||
if (!_yaw_lock) {
|
||||
_yaw_setpoint = _yaw;
|
||||
_yaw_lock = true;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
@@ -37,8 +37,10 @@
|
||||
#include "FlightTaskManual.hpp"
|
||||
#include <mathlib/mathlib.h>
|
||||
#include <float.h>
|
||||
#include <drivers/drv_hrt.h>
|
||||
|
||||
using namespace matrix;
|
||||
using namespace time_literals;
|
||||
|
||||
bool FlightTaskManual::initializeSubscriptions(SubscriptionArray &subscription_array)
|
||||
{
|
||||
@@ -67,8 +69,10 @@ bool FlightTaskManual::updateInitialize()
|
||||
|
||||
bool FlightTaskManual::_evaluateSticks()
|
||||
{
|
||||
hrt_abstime rc_timeout = (COM_RC_LOSS_T.get() * 1.5f) * 1_s;
|
||||
|
||||
/* Sticks are rescaled linearly and exponentially to [-1,1] */
|
||||
if ((_time_stamp_current - _sub_manual_control_setpoint->get().timestamp) < _timeout) {
|
||||
if ((_time_stamp_current - _sub_manual_control_setpoint->get().timestamp) < rc_timeout) {
|
||||
|
||||
/* Linear scale */
|
||||
_sticks(0) = _sub_manual_control_setpoint->get().x; /* NED x, "pitch" [-1,1] */
|
||||
|
||||
@@ -76,6 +76,7 @@ private:
|
||||
(ParamFloat<px4::params::MPC_Z_MAN_EXPO>)
|
||||
_z_vel_man_expo, /**< ratio of exponential curve for stick input in z direction */
|
||||
(ParamFloat<px4::params::MPC_YAW_EXPO>)
|
||||
_yaw_expo /**< ratio of exponential curve for stick input in yaw for modes except acro */
|
||||
_yaw_expo, /**< ratio of exponential curve for stick input in yaw for modes except acro */
|
||||
(ParamFloat<px4::params::COM_RC_LOSS_T>) COM_RC_LOSS_T /**< time at which commander considers RC lost */
|
||||
)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user