gazebosim / gazebosim/sdformat

Hard to set URDF model to static with multiple <gazebo> tags

Open
#197 0 comments 0 reactions 0 assignees View on GitHub
bug major URDF
Dominant language
C++
Stars
216
Forks
125
Avg merge
1d 14h
Merged PRs (30d)
14

Description

**Original report ([archived issue](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/issues/197)) by Steve Peters (Bitbucket: [Steven Peters](https://bitbucket.org/%7B2ccfed09-18b8-4921-8d58-15ef01092802%7D/), GitHub: [scpeters](https://github.com/scpeters)).**

----------------------------------------
@caguero and I discovered today that if you want to use `` to make a urdf model static, you might run into problems if you have multiple `` tags. For example, the following urdf will not be static after converting to sdf:

~~~



1

~~~

~~~
$ gz sdf -p test/integration/static_test.urdf
Warning [parser_urdf.cc:1115] multiple inconsistent exists due to fixed joint reduction overwriting previous value [true] with [false].


0

~~~

It gives a warning: "Warning [parser_urdf.cc:1115] multiple inconsistent exists due to fixed joint reduction overwriting previous value [true] with [false]."

I think the following code might fix the parsing for this specific model, relying on the fact that sdf models are not static by default, but it may have side-effects for other models.

~~~
diff -r 52b50d2823a67366ccbf17f9976aa36ed7cab4e5 src/parser_urdf.cc
--- a/src/parser_urdf.cc Thu Oct 26 14:18:25 2017 -0700
+++ b/src/parser_urdf.cc Wed Aug 29 17:43:43 2018 -0700
@@ -2346,8 +2346,6 @@
// insert static flag
if ((*ge)->setStaticFlag)
AddKeyValue(_elem, "static", "true");
- else
- AddKeyValue(_elem, "static", "false");

// copy extension containing blobs and without reference
for (std::vector::iterator
~~~

Contributor guide

Open the contributing guide

Research direction

Start in src/parser_urdf.cc around the static flag handling and inspect test/integration/static_test. Run the shown gz sdf -p command to reproduce the conversion and warning. Done means the URDF model remains static after conversion without the inconsistent static warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.