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

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

Open
azeey opened this issue Sep 29, 2021 · 1 comment
Open
Assignees
Labels
bug Something isn't working 🏯 fortress Ignition Fortress

Comments

@azeey
Copy link
Contributor

azeey commented Sep 29, 2021

Environment

  • OS Version:
  • Source or binary build? source, main, fa09864

Description

  • Expected behavior: No errors when running a world with nested models
  • Actual behavior: Serialization errors are printed when running a world with nested models where the pose of a model is given relative to another entity.

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
@azeey azeey added the bug Something isn't working label Sep 29, 2021
@azeey azeey added the 🏯 fortress Ignition Fortress label Sep 29, 2021
@azeey azeey changed the title Serialization of nested models fails when nested model pose has 'relative_to` Serialization of nested models fails when nested model pose has "relative_to" Sep 29, 2021
@asreejith-vcrs
Copy link

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

iche033 added a commit that referenced this issue May 3, 2022
This PR prevents serialization of a model component if it has the //pose/@relative_to attribute to avoid flooding the console with error messages when there are multiple models with nested models using this attribute. Since model deserialization with //pose/@relative_to never worked, this should not affect existing behavior. I believe the model serialization / deserialization functionality is mainly used by the component editor. Related issue: #1071

Signed-off-by: Ian Chen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🏯 fortress Ignition Fortress
Projects
None yet
Development

No branches or pull requests

2 participants