Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plane: THROTTLE_NUDGE doesn't work in GUIDED Mode #26094

Open
AutomationEngineer opened this issue Jan 29, 2024 · 3 comments
Open

Plane: THROTTLE_NUDGE doesn't work in GUIDED Mode #26094

AutomationEngineer opened this issue Jan 29, 2024 · 3 comments
Labels

Comments

@AutomationEngineer
Copy link

Having parameter THROTTLE_NUDGE set to 1, throttle stick have no effect on airspeed target value when in GUIDED mode while have an expected effect in AUTO mode.

Plane 4.3.8

Quadplane

CUAV X7 Pro Plus

The issue is probably dew to use of is_zero in navigation.cpp:

#if OFFBOARD_GUIDED == ENABLED
    if (control_mode == &mode_guided && !is_zero(guided_state.target_airspeed_cm) && (airspeed_nudge_cm != 0)) {
        airspeed_nudge_cm = 0; //airspeed_nudge_cm forced to zero
    }
#endif

which is not correct in this case, cause guided_state.target_airspeed_cm initiates to -1
other parts of code uses comparison to 0.0 instead, which is correct.

@rmackay9 rmackay9 changed the title THROTTLE_NUDGE doesn't work in GUIDED Mode Plane: THROTTLE_NUDGE doesn't work in GUIDED Mode Jan 29, 2024
@rmackay9 rmackay9 added the Plane label Jan 29, 2024
@IamPete1
Copy link
Member

A PR to fix that would be great. We should bring them all in line, I see 3 places its used, here we have !is_zero, > 0 and for logging is_positive. They should probably all be is_positive.

@AutomationEngineer
Copy link
Author

I've added a PR #26107, but it didn't pass plane SITL tests, however have passed quadplane tests.
Loking at logs showed some issues with fence handling (I can't imagine how it is related) and an issue with change altitude command in GUIDED mode, which is directly related to particular changes of code.
Plane didn't climb from 35 to 49 meters at some time, but could this be dew not neutral throttle, and low climb rate for this reason?
Could please somebody review the PR, my SITL logs and testing logs to point me where to move forward?

@AutomationEngineer
Copy link
Author

As PR is now passing the tests could we include it to Plane 4.5.x or should I rework it to make more "clean" (no loose comits)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants