sdf_tutorials icon indicating copy to clipboard operation
sdf_tutorials copied to clipboard

Should name attribute restrictions apply to custom elements?

Open scpeters opened this issue 4 years ago • 6 comments

The SDFormat 1.7 frame semantics proposal contains two restrictions on the contents of //@name attributes:

Should these restrictions apply to a name attribute in a custom namespaced element?

Moved from this comment thread: https://github.com/osrf/sdformat/pull/381#pullrequestreview-518802131

scpeters avatar Oct 28 '20 16:10 scpeters

I think it makes sense to relax these requirements when it comes to custom elements.

chapulina avatar Oct 29 '20 15:10 chapulina

Agreed. I dunno if I can come up with a real use case where you want @name to be non-unique, but ideally we do as little as possible when it comes to custom elements / attributes.

EricCousineau-TRI avatar Oct 29 '20 22:10 EricCousineau-TRI

Agreed. I dunno if I can come up with a real use case where you want @name to be non-unique, but ideally we do as little as possible when it comes to custom elements / attributes.

what about //drake:joint from https://github.com/RobotLocomotion/drake/pull/13824 ?

scpeters avatar Oct 29 '20 23:10 scpeters

I don't think that's an issue?

After reviewing: https://github.com/osrf/sdformat/issues/288

  1. If it stays as //drake:joint, then it's Drake's responsibility to inject frames / test for conflicts, so libsdformat should have no duty there.
  2. If it does get implemented using //joint/@type="custom", then it's already handled.

If (1) happens, then yeah, we have to inject frames via some hook API (yuck), so I think it'd still fail fast in the right way, just with dumb error messages.

EricCousineau-TRI avatar Oct 29 '20 23:10 EricCousineau-TRI

I don't think that's an issue?

After reviewing: osrf/sdformat#288

  1. If it stays as //drake:joint, then it's Drake's responsibility to inject frames / test for conflicts, so libsdformat should have no duty there.
  2. If it does get implemented using //joint/@type="custom", then it's already handled.

If (1) happens, then yeah, we have to inject frames via some hook API (yuck), so I think it'd still fail fast in the right way, just with dumb error messages.

I would like to see //joint/@type="custom" supported rather than encourage people to make custom joint elements for this reason, but i suppose it makes sense to still err on the side of not interfering with custom elements

scpeters avatar Oct 30 '20 00:10 scpeters

Agreed on that point! (//joint/@type="custom" smells wayyyyy better than the other alt.s)

EricCousineau-TRI avatar Oct 30 '20 00:10 EricCousineau-TRI