-
Notifications
You must be signed in to change notification settings - Fork 22
Waypoint node #566
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
base: main
Are you sure you want to change the base?
Waypoint node #566
Conversation
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.
Open a PR in vortex msgs so that we can test this
guidance/reference_filter_dp/config/reference_filter_params.yaml
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #566 +/- ##
========================================
- Coverage 6.61% 6.04% -0.57%
========================================
Files 37 39 +2
Lines 2117 2316 +199
Branches 50 64 +14
========================================
Hits 140 140
- Misses 1977 2176 +199
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
@@ -0,0 +1,311 @@ | |||
#include "waypoint_manager/waypoint_manager.hpp" |
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.
General comment on this file:
Because of the independent main blocking loop, there's a lot of locking/unlocking going on, and I can't immediately say that it's 100% correct.
Question is then: Do you really need this to run async, or could you fundamentally restructure the code so that you avoid the mutual exclusion requirement, or even use condition variables in a producer/consumer pattern?
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.
I have refactor the code to add a dedicated worker thread that uses condition variables instead of a busy-wait loop, can you have a look.
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.
tldr; it crashes due to throwing runtime error upon reaching the first waypoint
|
||
double distance = calculate_distance(current_pose, target_pose); | ||
|
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.
Be careful with this since the reference filter is not dependent on the drone position. The reference filter will go until it is close enough to the target point, and then it will finish and return success. I tried to test your code and when the drone reaches the first waypoint both the reference filter node and the waypoint manager node crashes. I would suggest that you let the respective guidance systems handle when they reach the waypoint by just waiting for the action to return success.
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.
I see... I will look into that, can you tell me which specific error the node is throwing?
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.
I refactor the code, can you try again?
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.
Now nothing seems to happen when the goal request is sent to the waypoint manager. I would advise you to run full tests of your own to make sure things work as intended before pushing.
Regarding my questions about the multithreading here, I wrote an MVP for the functionality that is desired here, and found that you really can just run this with a single-threaded executor? I also got the complexity down by using a service server to take waypoints in (which I think is the appropriate choice here, given that you don't really need to signal to the provider of waypoints that waypoints have been reached - thats the waypoint manager's (and guidance system's) job). A quick outline:
While this solution is not "100%" - i.e. the action client "feedback" mechanism is not used at all, and the logic I implemented as a test in 4. is very barebones, I think the point remains to simplify and single-thread. TLDR: Use a service server for incoming waypoints, and single-thread the waypoint manager |
You mentioned using a service server instead of an action server. Does this mean we don't need to support cancellation of waypoint sequences once they're submitted? What about cases where a mission needs to be aborted? |
Could you share the MVP implementation you created that will help me understand the simplified architecture better since I am new to C++ |
It is in the branch from easter testing: https://github.com/vortexntnu/vortex-auv/blob/easter-test-2025/mission/waypoint_manager/src/waypoint_manager2.cpp |
We can still send cancellation request directly to the guidance server. It will then return false (for success) which signals to the waypoint manager that it should not feed next waypoint. |
No description provided.