Configure .world file when starting#37
Open
pschillinger wants to merge 3 commits intoros-simulation:lunar-develfrom
Open
Configure .world file when starting#37pschillinger wants to merge 3 commits intoros-simulation:lunar-develfrom
pschillinger wants to merge 3 commits intoros-simulation:lunar-develfrom
Conversation
Member
|
Thanks for the contribution! Someone will have a look at this for merge as soon as possible. |
Member
|
Sorry, I accidentally closed this when changing the branch layout of the repository. I've reopened it and updated the target base to be |
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.
This might be of interest for others as well. It would be nicer if we could just pass a .world string instead of a file to stage, but I wanted to touch as little as possible.
I needed a way to dynamically configure a .world file when starting stage from a .launch file, e.g., spawn a parametrizable number of robots (in principle, idea similar to xacro for urdf). Since I didn't find a way, I added the following new option:
-c <script> [args] <worldfile><script>is a custom script to configure the .world file (see below)[args]are optional arguments to the script (all args following -c will be passed, so -u or -g need to preceed -c)<worldfile>as usual, the used .world file stays the last argument and will be as well passed to the script as targetAn arbitrary custom script can be used for configuration as long as it writes its result to
<worldfile>. For convenience and reference, I added the scriptrosparam_instantiate.pyto this PR:It accepts a rosparam namespace and instantiates all objects into the world
worldfile_in. It can be used in a launchfile like the following example:which will spawn the following object:
Note the following two aspects: