-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
AC_WPNav: fix takeoff drift if vehicle is not in origin #17132
Conversation
@chobitsfan, thanks so much for this! |
This is just used during take off and can probably be done clearer like this:
|
This has a little kink as we define the S-Curve based on the distance between the origin and destination at the initialization. This can change as our origin shifts. The fundamental problem behind this is we should not be using the navigation controller to take off. To make it smooth we either need to recalculate the S-Curve on every loop, climb to a different height based on our origin height change, twitch at the start or twitch at the end. I think the twitch at the start or have the destination change height is the best trade off. |
Hi @lthall Thank you
I am sorry but I did not get it. Did you mean we should not use wpnav or pos_control? |
Sorry that isn't relevant to your PR. My statement is referring to the fact we can't navigate on the ground and we should be running a different strategy to break contact with the ground and then initialize the position controller and navigation after that. |
Both dbe1c55 and comments in
shift_wp_origin_to_current_pos()
states this function shifts the origin and destination so the origin starts at the current position. But its implementation seems incorrect. Everything was fine before, because it returns early if vehicle is not in originardupilot/libraries/AC_WPNav/AC_WPNav.cpp
Lines 282 to 285 in d66101d
But
_track_desired
assignment is removed when #15896 merged, it will always be zero and it never return early. This may cause a horizontal drift when vehicle takeoff.20 2021-4-8 am 09-41-18.zip
This PR fix this problem by implementing this function as its comments state. Test flights using motion capture system and ext nav.
25 2021-4-9 PM 03-43-38.zip
26 2021-4-9 PM 03-45-20.zip
related to #16478)