Update rover models using a master template.#244
Merged
Conversation
This template can be used to generate the rover SDF and config files, meaning only one file for each has to be edited by hand. Embedded ruby is the recommended templating method for SDF files. http://gazebosim.org/tutorials?tut=model_structure#ModelSDF.ERB
This updates config files to have proper model names. SDF changes are mostly whitespace and things like a decimal zero (0.0) changing to an integer zero (0). This has no impact on the model's performance. Some models had an incorrect left_rear_wheel collision geometry. Thor and Zeus' models were very out of date.
johncarl81
reviewed
Jan 24, 2019
|
|
||
| for rover in "${!rovers[@]}"; do | ||
| erb -T - rovername=${rover} \ | ||
| -- ${master_template_config} > ${model_path}/${rover}/model.config |
There was a problem hiding this comment.
I like this... didn't realize how easy ruby templating was 😃
gmfricke
approved these changes
Jan 24, 2019
Contributor
gmfricke
left a comment
There was a problem hiding this comment.
We have thought about doing this so many times. Thanks for giving us a push.
This was referenced Jan 29, 2019
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.
Hi guys,
This pull request would address issue #242 and hopefully make everyone's life a lot easier in maintaining the rover SDF files.
If PR #243 is merged, those updates would need to be included here in the template file.
Included here is:
model.sdf.erb), which requires therovernameandrovercolorvariables to be set on execution when converting the template to SDF.rovernamevariable to be set on execution when converting the template.misc/gen_rover_models.shto automate the generation of all 8 default rover SDF and config files.frame_id's. I'm happy to remove this and submit it separately if you prefer it in a different PR, or don't want the template file.There are many ways you could template a file like the rover model. Many ROS users use URDF files embedded with an xml macro language called Xacro. However, if you need to stick with SDF, the Gazebo tutorials suggest embedded ruby (ERB), and it's used in a few models in the official gazebo_models repository.
http://gazebosim.org/tutorials?tut=model_structure#ModelSDF.ERB
https://bitbucket.org/osrf/gazebo/src/b54961341ffb938a9f99c9976aed50a771c95216/worlds/flocking.world.erb?at=default
https://bitbucket.org/osrf/gazebo_models/src/default/cart_rigid_suspension/model.rsdf
The current recommended suffix is (
.erb) for template files.Let me know what you think.