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

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

Open
scpeters-test opened this issue Aug 30, 2018 · 0 comments
Open

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

scpeters-test opened this issue Aug 30, 2018 · 0 comments
Labels
bug Something isn't working major

Comments

@scpeters-test
Copy link
Collaborator

Original report (archived issue) by Steve Peters (Bitbucket: Steven Peters).


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

<?xml version="1.0" ?>
<robot name="static_test">

  <link name="world"/>
  <gazebo>
    <static>1</static>
  </gazebo>
  <gazebo/>

</robot>
$ gz sdf -p test/integration/static_test.urdf 
Warning [parser_urdf.cc:1115] multiple inconsistent <static> exists due to fixed joint reduction overwriting previous value [true] with [false].
<sdf version='1.6'>
  <model name='static_test'>
    <static>0</static>
  </model>
</sdf>

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<TiXmlElementPtr>::iterator
@scpeters-test scpeters-test added major bug Something isn't working labels Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working major
Projects
None yet
Development

No branches or pull requests

0 participants