Comments (11)
I'm also encountering this issue. I would like to use the standard xjc
tooling that comes with JAXB to generate some Java classes for parsing URDF, and the xjc
compiler errors out on the "unbounded" value on maxOccurs
for link visuals and collisions.
from urdfdom.
So the link allows an arbitrary number of collision and visual tags. If we change it to a sequence, I wonder if each type of tag have to be adjacent or can they be mixed? Reading...
from urdfdom.
@lexknuther You seem to know a bit more about XML than I do, what about using choice
instead of sequence
? Something like this:
<!-- link node type -->
<xs:complexType name="link">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="inertial"
type="inertial" minOccurs="0" maxOccurs="1" />
<xs:element name="visual"
type="visual" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="collision"
type="collision" minOccurs="0" maxOccurs="unbounded" />
</xs:choice>
<xs:attribute name="name" type="xs:string" use="required" />
<!-- FIXME: undocumented but used by PR2 -->
<xs:attribute name="type" type="xs:string" />
</xs:complexType>
from urdfdom.
Oh, maybe the sequence could contain both collision and visual definitions...
from urdfdom.
Ok, I don't know what I'm talking about at all.
from urdfdom.
@scpeters From my limited understanding, an xs:all
doesn't enforce an ordering whereas a xs:sequence
does. An xs:choice
with an unbounded maxOccurs lets the choice show up as many times as you want and you can have additional bound constraints on the possible choices but in the case of code generators it can generate code that isn't type-safe.
For validation purposes, though, I think it should work.
from urdfdom.
Could the inertial
tag remain in an xs:all
block?
from urdfdom.
xs:complexType
can only have a single child element.
from urdfdom.
choice seems like the right thing to me
from urdfdom.
Using a sequence
of choice
s might make things look nicer for code generators. I'm going to keep playing with it.
from urdfdom.
The plot thickens.
@scpeters Okay so, apparently, using unbounded
in the xs:all
is actually valid in XSD 1.1…
It's just that almost nothing out in the wild supports XSD 1.1.
from urdfdom.
Related Issues (20)
- Question: check_urdf does not take into account transmission tag, wrong behaviour ? HOT 1
- Invalid path in urdfdom_INCLUDE_DIRS on Windows installation using vcpkg
- Using wrong headers HOT 2
- Deprecation warning on urdfdom_parser with Clang HOT 2
- check_urdf: no loop detection
- Branch urdfdom for Galactic HOT 5
- Usage of `version` attribute in `robot` xml-node HOT 2
- [cmake] urdf_LIBRARIES is still wrong HOT 2
- Feature request: check_urdf should be able to read from std_in HOT 2
- parseJointLimits() does not parse acceleration limits
- Joint limits (vel, effort) are checked even when the joint is continuous type.
- Build Status link in README.md is broken HOT 2
- Use tinyxml2 instead of tinyxml HOT 3
- Remove tinyxml2 from public API HOT 2
- Cannot parse capsule error HOT 1
- Fixed joints parse limits but not axis
- Add support for quaternion in URDF HOT 3
- Removing console_bridge for Logging HOT 4
- support export URDF HOT 1
- Don't use (outdated) self-provided gtest version (especially if another version is installed already) HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from urdfdom.