gazebosim / gz-sim

Open source robotics simulator. The latest version of Gazebo.
https://gazebosim.org
Apache License 2.0
708 stars 269 forks source link

Serialization of nested models fails when nested model pose has "relative_to" #1071

Open azeey opened 3 years ago

azeey commented 3 years ago

Environment

Description

Steps to reproduce

  1. Run the following world with ign gazebo -v1

    <?xml version="1.0" ?>
    <sdf version="1.8">
    <world name="nested_model_world">
    <model name="model_00">
      <link name="link_00"/>
    
      <model name="model_01">
        <pose relative_to="link_00">1 0 0.0 0 0 0</pose> <!-- Causes serialization errors -->
        <link name="link_01"/>
      </model>
    </model>
    </world>
    </sdf>

Output

Error:   Could not find the 'robot' element in the xml file
         at line 80 in /build/urdfdom-YMMa9X/urdfdom-1.0.0/urdf_parser/src/model.cpp
Error [parser_urdf.cc:3255] Unable to call parseURDF on robot model
Error [parser.cc:820] parse as old deprecated model file failed.
[GUI] [Err] [Model.hh:73] Unable to unserialize sdf::Model

I printed out the received SDFormat string for deserialization in serializers::SdfModelSerializer::Deserialize and ran it under ign sdf -k:

Error:   Could not find the 'robot' element in the xml file
         at line 80 in /build/urdfdom-YMMa9X/urdfdom-1.0.0/urdf_parser/src/model.cpp
Error Code 5: [:/home/addisu/ws/fortress/src/ign-gazebo/test.sdf:L2]: Msg: Attribute //pose[@relative_to] of top level model must be left empty, found //pose[@relative_to='link_00'].

Error Code 9: Msg: Errors were found when checking the XML of element<sdf>.
Error Code 1: Msg: Unable to read file:/home/addisu/ws/fortress/src/ign-gazebo/test.sdf
asreejith-vcrs commented 2 years ago

Is this something that's still being worked on? Is there a workaround for this?