-
Notifications
You must be signed in to change notification settings - Fork 10
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
Handle additional case with NPFG waypoint navigation handling #53
Conversation
This commit adds an additional case where the vehicle can be ahead of the current waypoint. Previously this case was not handled and resulted in the vehicle indefinitely continuing along the waypoint line segment
Is this a proper fix or more like a hack that it does not happen again? |
@acfloria My intention was a proper fix (The case was simply not handled in the waypoint logic), but if there are other possible ways to improve the logic please let me know! |
How does L1 actually handle this? I think such a fix might be fine but I kind of don't like the hard switch of behavior. Maybe @tstastny has an idea how to fix it since this will also need to be fixed in the upstream PR. |
I fully agree @acfloria I believe the case in L1 is this one: ethzasl_fw_px4/src/lib/l1/ECL_L1_Pos_Controller.cpp Lines 150 to 158 in 0c2bf74
and seems like the same corner case with the issue this PR is addressing |
I see. I would probably also do something like this. Using a cone instead of checking if it is in front of the waypoint, because then it would react a bit earlier. Also it is closer to L1, which would make the upstream merge a bit easier. |
@Jaeyoung-Lim - good catch. However, maybe two comments.. 1) if you want to do a point tracking conversion to handle this case similar to L1 logic, I wouldn't recommend defining tracking to the opposite direction line as you have it now. Rather use the guideToPoint() method. 2) I made a fix for this moving the handling of this case to the mission block in PX4#18810 (comment) - this would be my preferred fix. Let me know what you think. @acfloria I'm a bit skeptical on the 100 deg cone as L1 implements it.. as this even limits the range of where the aircraft will start turning back towards the waypoint. Having the switch logic occur at either in the acceptance radius or passed the terminal waypoint simplifies all this. |
@tstastny Thanks for the review and comments!
This feels like a much more sensible thing to do 😄 I will update this PR once upstream is merged so that there are no additional changes that require a backport |
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
Describe problem solved by this pull request
The NPFG waypoint handling logic did not handle the case when the vehicle was further along the line segment and passed the current waypoint.
This resulted in the vehicle continuing along the line segment defined by the previous(Waypoint A) and current waypoint(Waypoint B) even though the vehicle has passed the current waypoint (Waypoint B).
This can happen when the current waypoint altitude difference is big, so that the vehicle switches to a loiter setpoint to climb, and then switches back to a considering it as a position setpoint only after when it has passed the current waypoint.
My guess is that this was hidden since we never had position waypoints that were consecutively on different altitudes.
Describe your solution
This PR adds additional case handling of the navigate waypoints in NPFG
Test data / coverage
Tested in SITL Gazebo
Before PR
Flight Log: https://logs.px4.io/plot_app?log=b38bb0ad-52ea-448d-b18f-425c6e8b24c6
After PR
Flight Log: https://logs.px4.io/plot_app?log=7eba14da-5c0e-4d35-9770-da4c31254e9b
Additional context