Add entity_namespace support for spawned entities - #925
Draft
C88-YQ wants to merge 12 commits into
Draft
Conversation
Signed-off-by: C88-YQ <1409947012@qq.com>
Signed-off-by: C88-YQ <1409947012@qq.com>
Signed-off-by: C88-YQ <1409947012@qq.com>
Signed-off-by: C88-YQ <1409947012@qq.com>
Signed-off-by: C88-YQ <1409947012@qq.com>
Signed-off-by: C88-YQ <1409947012@qq.com>
Signed-off-by: C88-YQ <1409947012@qq.com>
Signed-off-by: C88-YQ <1409947012@qq.com>
Signed-off-by: C88-YQ <1409947012@qq.com>
This reverts commit dfd7e39. Signed-off-by: C88-YQ <1409947012@qq.com>
Signed-off-by: C88-YQ <1409947012@qq.com>
Contributor
Author
|
EntityFactory already has gazebosim/gz-msgs#595 will be backported to older branches, and To make this PR easier to backport, it mainly uses the A follow-up PR will update the code to use |
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
Related to gazebosim/gz-sim#3871
Summary
This PR adds
entity_namespacesupport to:createnodegz_spawn_model.launchgz_spawn_model.launch.pyros_gz_spawn_model.launch.pyGzSpawnModellaunch actionspawn_entityserviceThe create node now uses Gazebo's
/create_with_nsservice and sendsEntityFactoryWithNsrequests. Whenentity_namespaceis set, it is passed to Gazebo as the spawned entity namespace. When it is empty, the spawn behavior stays the same as before.Backport Policy
Test it
First start a Gazebo world. For example, use a world named
default.Then test spawning models with
entity_namespacefrom the supported entry points.1. Test
ros_gz_sim create2. Test gz_spawn_model.launch
3. Test ros_gz_spawn_model.launch.py
4. Test ROS 2 Simulation Interfaces
5. Test
GzSpawnModellaunch actionCreate a test launch file, for example:
test_gz_spawn_model_action.launch.xml
Run it with:
After each command, check that the entity is created successfully. Also check the Gazebo GUI side panel and confirm that the displayed namespace matches the namespace used in the spawn command.
Checklist
codecheckpassed (See contributing)Assisted-by: Codex(gpt-5.4)