gazebosim / gazebosim/sdformat

Diagnostics for invalid numeric input

Open
#228 2 comments 0 reactions 0 assignees View on GitHub
enhancement minor
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/228)) by Jeremy Nimmer (Bitbucket: [Jeremy Nimmer](https://bitbucket.org/%7B127cef5b-add8-4be7-9175-2c7214f56bcf%7D/)).**

----------------------------------------
\# 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](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:

```xml

foo foo foo foo foo foo foo foo -1e899999


1.0 2.0 3.0 foo





0.8 gravitons
0.3 muons




```

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the sdformat parser handles numeric values in the example SDF, including malformed tokens such as `foo`, `1.O1e2`, and units like `gravitons`. Define done as diagnostics being emitted for invalid numeric input, with coverage for the reported examples and a clear parser-facing error channel or log output.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.