open-navigation / opennav_docking

Nav2 Compatible Docking Task Server & BT Utils
Apache License 2.0
69 stars 10 forks source link

refactor of docking server #8

Closed mikeferguson closed 5 months ago

mikeferguson commented 5 months ago

This is still a WIP - opening for visibility

mikeferguson commented 5 months ago

This is ready to review - addresses everything that is crossed out in the design doc

I'll do another pass of documentation (especially around coordinate frame assumptions) once we switch to using the upstream controller.

mikeferguson commented 5 months ago

I walked through the whole docking loop - step by step (I've got some chicken scratch we can probably turn into a state diagram later):

mikeferguson commented 5 months ago

@SteveMacenski - I'm going to merge this so I can start working on top of graceful controller - if you have any comments after the latest revamp - just leave them here and I'll get them addressed in another PR/commit

SteveMacenski commented 5 months ago

@mikeferguson

mikeferguson commented 5 months ago

On the first point (L402) - it's my understanding that plain "throw" is actually preferred since it won't recreate the exception: https://stackoverflow.com/questions/2360597/c-exceptions-questions-on-rethrow-of-original-exception - but I'll admit, I don't use exceptions all that much, and so I'm not 100% sure

SteveMacenski commented 5 months ago

Oh, if that works, that works. I didn't know that throw in that context would implicitly throw the exception in the scope. I'd just test to verify that you get the right contextual errors and that the error_codes are populated (if it works for one, it'll work for all). I didn't expect C++ to be that non-explicit about it. I learned something new today

mikeferguson commented 5 months ago

re: stashDockData - it probably needs a rename - it also handles cleaning up that raw pointer that gets created when not using the dock database

SteveMacenski commented 5 months ago

If you added a success field, you could use that whether or not to store it or just clean it