gazebosim / sdformat

Simulation Description Format (SDFormat) parser and description files.
http://sdformat.org
Apache License 2.0
166 stars 95 forks source link

Diagnostics for invalid numeric input #228

Open osrf-migration opened 4 years ago

osrf-migration commented 4 years ago

Original report (archived issue) by Jeremy Nimmer (Bitbucket: Jeremy Nimmer).


# Summary

When a user makes a mistake and provides invalid data, e.g., for a (link pose)[http://sdformat.org/spec?ver=1.6&elem=link#link_pose], the sdformat parser should provide a diagnostic.

# Motivation

In many cases `*.sdf` files are authored by hand, possibly even with xacro or related tools. It is easy to accidentally make a typo and end up with a file that appears to be valid, but in fact will behave poorly in simulation for some unknown reason, e.g., if 1.O1e2 is parsed as "1." instead of "101.".

# Describe alternatives you've considered

I would appreciate if the parser provided an API channel for errors, but I believe this isn't available yet – even for mistakes that it does provide diagnostics for. Starting out with log printouts for numeric typos would be a step in the right direction.

# Additional context

Here is an example stanza that does not produce any diagnostics as of tag/sdformat9_9.1.0:

      <collision name='link1_collision1'>
        <pose>foo foo foo foo foo foo foo foo -1e899999</pose>
        <geometry>
          <plane>
            <normal>1.0 2.0 3.0 foo</normal>
          </plane>
        </geometry>
        <surface>
          <friction>
            <ode>
              <mu>0.8 gravitons</mu>
              <mu2>0.3 muons</mu2>
            </ode>
          </friction>
        </surface>
      </collision>

osrf-migration commented 4 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


slightly related, I just noticed a failure of the PoseNoValue test on i386

Tobias-Fischer commented 4 years ago

We also observed more failures of the PoseNoValue test on OSX when building for Conda: https://github.com/conda-forge/libsdformat-feedstock/pull/16

Should we open a separate issue for this?