Adds a system which enables exporting occupancy grids. - #2958
Merged
Conversation
This PR adds a system which exports occupancy grids. Currently its a work in progress. The BFS algorithm seems to not identify when there cannot be any progress made. Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
ahcorde
previously requested changes
Jun 25, 2025
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
This commit pushes an initial version of the code. Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Contributor
|
Here's a patch to add the bazel.patchdiff --git a/BUILD.bazel b/BUILD.bazel
index 9d6d2d9bb..01bc304ad 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -801,6 +801,26 @@ gz_sim_system_libraries(
],
)
+gz_sim_system_libraries(
+ srcs = glob(
+ [
+ "src/systems/free_space_explorer/**/*.cc",
+ "src/systems/free_space_explorer/**/*.hh",
+ ],
+ ),
+ so_lib_name = "gz-sim-free-space_explorer--system.so",
+ static_lib_name = "gz-sim-free-space-explorer-system-static",
+ visibility = ["//visibility:public"],
+ deps = [
+ ":gz-sim",
+ "@gz-common//graphics",
+ "@gz-math",
+ "@gz-msgs//:gzmsgs_cc_proto",
+ "@gz-plugin//:register",
+ "@gz-transport",
+ ],
+)
+
gz_sim_system_libraries(
srcs = glob(
[After removing |
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
…m/gz-sim into arjo/feat/export_occupancy_grid
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
arjo129
marked this pull request as ready for review
August 22, 2025 09:33
azeey
requested changes
Aug 23, 2025
azeey
left a comment
Contributor
There was a problem hiding this comment.
The overall feature looks great! I have some concerns about where the computation is being done. In most of our plugins, we have the pattern where we only do trivail things in message callbacks and defer expensive computation to Pre/PostUpdate calls. There also a number of style issues.
AI was used to migrate the logic in OnLaserScanCallback. Generated-by: Gemini-2.5-Pro Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
…m/gz-sim into arjo/feat/export_occupancy_grid
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Since we are accessing the occupancy grid on the main simulation loop only now, we dont need a mutex to protect it. Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
azeey
approved these changes
Aug 23, 2025
azeey
left a comment
Contributor
There was a problem hiding this comment.
Looks great! Thanks for making all those changes.
Let's merge as is, but I'd ask if you can follow this up with an integration test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸
🎉 New feature
Closes #
Summary
Depends on: gazebosim/gz-math#685
This PR adds a system which exports occupancy grids. Currently its a work in progress. The BFS algorithm takes a fair deal of time to converge, hence writing a unit test may not make sense. We should also make a nice UI for it.
Test it
Follow the instructions in the example sdf.
The occupancy grid will be published as an image on the /scan_image topic.
To start the exploration, run the following command in a new terminal:
reduced_Screencast.From.2025-08-22.13-24-20.mp4
Checklist
codecheckpassed (See contributing)Generated-by: Gemini-2.5-Pro
Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-byandGenerated-bymessages.