-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
update mission after changing home position #22834
Conversation
@bkueng Following your advice, I utilized _navigator->get_home_position()->update_count. |
Resolved Conflict Code |
@KonradRudin Looking forward to receiving your advice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thansk for the bug fix. Looks fine to me, just extend it for the previous and next as well.
@KonradRudin How about this modification? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes. Looking good for me, but there seems to be a conflict we recent changes. If you rebase it on newest main, i can approve.
@KonradRudin Thank you for your feedback! I've addressed the conflict and rebased the changes on the latest main branch. |
@bkueng it's ready to merge |
Can you run |
@bkueng OK ,I have finished it. |
Solved Problem
fix the bug which cause drone can't finish mission after changing home altitude.Update mission after changing home position.
Summary
This state management bug will result in the drone being unable to reach the waypoint and thus continuing the mission.And continues to drift irregularly near the waypoints.
Details
When the drone is executing a mission, PX4 calculates the distance between the drone and the current target waypoint, and checks if it has reached the vicinity.
Here calculates the distance.
PX4-Autopilot/src/modules/navigator/mission_block.cpp
Lines 197 to 201 in 8b96cd5
When mission altitude mode is Relative to Launch
mission_item_altitude_amsl=mission_item.altitude + home_alt
And here checks whether it is less than the acceptable radius.
PX4-Autopilot/src/modules/navigator/mission_block.cpp
Lines 394 to 396 in 8b96cd5
When the drone is executing a mission, if the user modifies the home point to a new location (with a different altitude), the value of 'dist' will immediately change based on the new home point's altitude (which determines the check for whether the drone has reached the waypoint). However, the current actual executed 'mission_item' does not get updated.
This will result in a discrepancy between the actual executed target of the drone and the checked completion target, causing the drone to start randomly oscillating near the waypoint.
Verification
We added some debug output to watch the drone's state change,and found every time the user changes the home point, 'dist_z' (altitude) also changes accordingly, but the 'mission_item' does not.
Temporary Patch
There are currently two patching approaches based on the expectations for how the drone should operate after modifying the home point:
Impact
can.t.reach.waypoint.mp4
Some bugs prevent you from directly viewing the video.You can download and check this vedio.
Solution
Test coverage