-
Notifications
You must be signed in to change notification settings - Fork 25
Re-Introduces Occupancy Grid Export #389
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?
Conversation
We seem to have removed any way of exporting occupancy grids from the site editor. This commit adds a small UI to do said task. Signed-off-by: Arjo Chakravarty <[email protected]>
This commit exports the occupancy grid to a PNG in a user selected target directory. Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
|
Just a heads up, this is going to run into some merge conflicts with #373 which does a refactor of |
|
Should I retarget #373 or wait for that to be merged? |
|
Definitely wait for the merge since we'll be doing a squash merge which will bork the git history if you merge in #373 as-is into this branch. |
|
The other PR has been merged. The conflicts for this PR are now visible. |
Signed-off-by: Arjo <[email protected]>
Signed-off-by: Arjo <[email protected]>
Signed-off-by: Arjo <[email protected]>
You should be able to simply go `File` > `Export Occupancy Grid` and the occupancy grids will be generated directly. Signed-off-by: Arjo <[email protected]>
|
Works on desktops. You can simply click output2.mp4 |
Signed-off-by: Arjo Chakravarty <[email protected]>
| } | ||
|
|
||
| fn handle_calculate_grid_request( | ||
| fn handle_export_request( |
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'm generally not too excited about this function since it's pretty much the exact same as the one below, with one line of difference in "what we do after calculate_grid is over".
My preference would be to refactor them into a single function, on top of my head I can think of a few ways:
- Refactor the two input events
ExportGridRequestandCalculateGridRequestinto a single event that has an additional field that says "what do we do with the output", we could match it and either send the saving event (your function) or send the replan event (the original function). - Make the function generic, perhaps as a generic parameter a closure that takes
Worldand decides what to do after the grid is exported? - Bite the bullet and make this a workflow, which is quite a good fit for "sequence of operations that we need to run one after the other", so we could have the first node of the workflow that handles the
calculate_gridrequest in a common service, then two workflows, one to calculate the occupancy grid and replan and the other one to calculate the occupancy grid and send a file dialog request.
First is quick and easy, second is possibly not a great idea, third would probably be the best but a bit more work to implement.
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 had done 1 earlier (before having to rewrite the entire PR): #389 (comment)
2 will make the code unnecessarily complex.
3 is a fair deal more of work but probably the correct way to handle it.
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Implemented feature
Adds support to export an occupancy grid to a PNG so other external tools may consume the exported occupancy grid.
Implementation description
GenAI Use
We follow OSRA's policy on GenAI tools
Generated-by: