Skip to content
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

refactor ROS2SpawnerComponent #26

Open
wants to merge 6 commits into
base: forward_branch_wp2
Choose a base branch
from

Conversation

zakmat
Copy link
Member

@zakmat zakmat commented Jul 20, 2023

This is an enabler for further work on forward_branch. However, enhancements are generic enough so it should be suitable for development after rebase

Changes:

  • add namespace so multiple Spawners can be defined without collisions in service names. An empty namespace is an old behavior - a global namespace.
  • treat the typo in the spawn point name as an error. Previously when there was no match initial_pose field was used. Now in order to use initial_pose the xml field has to be empty.
  • make code more idiomatic: use ROS2Conversion utils, structured bindings, avoid double-lookups for maps, etc.
  • replaced GetWorldProperties with GetModelList - the former is deprecated
  • utilize robot_namespace request field to apply custom name for spawned entities - custom name is applied to either the highest entity with ROS2 Frame Component, the highest entity with simulated body (either static or dynamic) or root itself in that order

{
for (auto spawnPoint : GetSpawnPoints())
for (const auto& [name, info] : GetSpawnPoints())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetSpawnPoints is currently checking only children for SpawnPointComponent, what do you think about changing it to all descendants? Use case I have in mind: AMR docking station as a prefab - it could provide a spawning point right off the shelf

@zakmat zakmat marked this pull request as draft July 27, 2023 13:39
@zakmat
Copy link
Member Author

zakmat commented Jul 27, 2023

I am converting to draft due to the major changes in the Spawner's design in the upstream. I will reevaluate on top of those

@zakmat zakmat marked this pull request as ready for review July 31, 2023 13:17
arturkamieniecki and others added 6 commits August 14, 2023 11:47
* Add spawner interface to allow selection of spawn points

Signed-off-by: Artur Kamieniecki <[email protected]>
* add m_namespace so multiple Spawners can be defined without collisions
* treat typo in spawn point name as error instead of creating in initial_pose
* make code more idiomatic - use ROS2Conversion utils, structured bindings, avoid map double-lookups

Signed-off-by: Mateusz Żak <[email protected]>
* allow spawning non-ROS prefabs in the scene e.g. parts of envirionment
* use robot_namespace request field to customize name of the spawnable

Signed-off-by: Mateusz Żak <[email protected]>
MateuszWasilewski pushed a commit that referenced this pull request Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants