1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-23 16:25:26 +03:00

no loiter waypoint for vtol

This commit is contained in:
shota 2023-08-03 20:31:34 +09:00
parent 1188ff79fe
commit 258a88ce15
2 changed files with 6 additions and 22 deletions

View file

@ -70,27 +70,10 @@ PG_RESET_TEMPLATE(servoConfig_t, servoConfig,
.servo_autotrim_rotation_limit = SETTING_SERVO_AUTOTRIM_ROTATION_LIMIT_DEFAULT
);
// PG_REGISTER_ARRAY_WITH_RESET_FN(servoMixer_t, MAX_SERVO_RULES, customServoMixers, PG_SERVO_MIXER, 1);
// void pgResetFn_customServoMixers(servoMixer_t *instance)
// {
// for (int i = 0; i < MAX_SERVO_RULES; i++) {
// RESET_CONFIG(servoMixer_t, &instance[i],
// .targetChannel = 0,
// .inputSource = 0,
// .rate = 0,
// .speed = 0
// #ifdef USE_PROGRAMMING_FRAMEWORK
// ,.conditionId = -1
// #endif
// );
// }
// }
void Reset_servoMixers(servoMixer_t *instance)
{
for (int i = 0; i < MAX_SERVO_RULES; i++)
{
for (int i = 0; i < MAX_SERVO_RULES; i++){
RESET_CONFIG(servoMixer_t, &instance[i],
.targetChannel = 0,
.inputSource = 0,
@ -171,10 +154,6 @@ void servosInit(void)
servoOutputEnabled = true;
mixerUsesServos = true;
}
else {
servoOutputEnabled = false;
mixerUsesServos = false;
}
for (uint8_t i = 0; i < MAX_SUPPORTED_SERVOS; i++) {
servoComputeScalingFactors(i);

View file

@ -39,6 +39,7 @@
#include "flight/pid.h"
#include "flight/imu.h"
#include "flight/mixer.h"
#include "flight/mixer_profile.h"
#include "fc/config.h"
#include "fc/controlrate_profile.h"
@ -289,6 +290,10 @@ static void calculateVirtualPositionTarget_FW(float trackingPeriod)
needToCalculateCircularLoiter = isNavHoldPositionActive() &&
(distanceToActualTarget <= (navLoiterRadius / TAN_15DEG)) &&
(distanceToActualTarget > 50.0f);
//if vtol landing is required, fly straight to homepoint
if ((posControl.navState == NAV_STATE_RTH_HEAD_HOME) && navigationRTHAllowsLanding() && checkMixerATRequired(MIXERAT_REQUEST_LAND)){
needToCalculateCircularLoiter = false;
}
/* WP turn smoothing with 2 options, 1: pass through WP, 2: cut inside turn missing WP
* Works for turns > 30 degs and < 160 degs.