-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Joint default values need to be stored in Joint #13065
Comments
\cc @amcastro-tri |
I agree, @joemasterjohn. All the parsing info ought to reside in the Joint so we can create and destroy the mobilizer graph as an afterthought. |
BTW This isn't our policy per se, but I do like to title issues that make it obvious they're an issue, not a PR (e.g. "Joint default values need to be deferred to mobilizer" or "Should make [...]"). |
As @jwnimmer-tri pointed out, my commented here may make this issue moot:
Sorry for not reading this more fully! |
FTR, it was deprecated as it was (a) redundant w.r.t. Here is the spec for Perhaps you can instruct |
Basically, I think this issue should maybe be reworded to "Should teach SDFormat parser to read //world/state". (and state should ideally not be coupled to a given model?) |
|
I don't see anything in it that looks like it records a trajectory. It just asks for time as the state. And FTR I'm not necessarily saying all of We can always take a subset of the element that works best for us, and then work on refining that element with OSRC (e.g. make quantities coupled to dynamics engines be tagged as such). |
See my comment in #13105. I do think the model definition should include initial_position when that is a property of the model rather than just an arbitrary setting. That occurs much more often with closed topology systems than with tree-structured ones. |
@sherm1 I'm all for abstracting away the zero configuration such that Which are y'all advocating for the most? To me, zero configuration may need BTW Is this the real root motivation for this issue? If so, would be super nice to have that stated in the overview! |
I'm not sure which of things above you're referring to? My motivation would be to associate a reasonable non-zero default value for a joint's coordinates if that makes sense for the model (as opposed to just something application dependent). So SetDefaultState() would not necessarily set all the joint coords to zero. An app can always override that, the point is to have a reasonable default, and zero is not always reasonable. For closed topology systems, zero is often the "flatline" configuration from which it is nearly impossible to compute an assembled configuration. |
Ah, I see. Yes, if the default value is explicitly intended to be for the aspect of a model, and not be confused with trying to capture the model's state, then yeah, I guess I can see this purpose. My suggestion is to make this Drake-specific for now; do not use SDFormat's effectively unsupported (and soon-to-be-deprecated)
I was referring to the intended application of using the default value for use with closed-loop topologies. At first, since the intent was to use |
Gotcha, yes that makes sense. |
This is a great discussion, thank you guys @sherm1 and @EricCousineau-TRI.
|
Yes, thanks @sherm1, @EricCousineau-TRI and @amcastro-tri . Sorry I'm late to the party and didn't make it clear that the intention for parsing the I'll try to make the issue and related PR(#13105) agnostic to the particular tag the parser would actually use. |
@joemasterjohn Sweet! That sounds great! @amcastro-tri Er, can you explain more we why we'd want a non-zero default velocity? |
That's actually a good point @EricCousineau-TRI. I was trying to avoid some future deprecation. What do you think @sherm1 ? |
Yes, I was going to make the same point but @EricCousineau-TRI beat me to it. A recommended initial configuration makes sense as part of the modeler's work, but a non-zero initial velocity would be up to the particular application using that model. |
ok, thanks for the clarification (sry for the close/open spam, github crushed on me this morning and I followed up by pressing the wrong buttons). Then we'd like something like?:
|
If we agree that it's semantically valid for the xml to store a non-zero default position per the modeler, then I'm unclear on why http://sdformat.org/spec?ver=1.7&elem=joint#axis_initial_position is going to be deprecated, @EricCousineau-TRI? Can we just use the standard element and undo the deprecation? Or do we really want to highlight "initial" vs "default" somehow being different? |
I would like to converge on terminology that makes the purpose clear, so yes, I want to keep the deprecation. |
On @amcastro-tri's point, I don't have a concrete suggestion on the syntax. From reviewing the current docs, we don't have long-form example of what multi-axis joints look like: So will have that in the Thurs meeting. @amcastro-tri @joemasterjohn Would y'all (or one of you) want to join the meeting to discuss this? |
@EricCousineau-TRI sure thing, you can go ahead and invite me. |
Done! |
This is a PR to have the Joint class store a default value and to pass the value to its mobilizer implementation upon construction of the joint implementation. Solves the issue of mobilizers storing default joint positions (#13065)
Seems like this could have been closed via #13105? |
Or perhaps the issue has taken on more meaning that the issue name suggests, and should be renamed to "set default joint positions via sdf" or something more up to date? |
…ives Adds the ability to set default joint positions and default free body poses in the add_model directive. I would have liked to be able to enable a tag like default_positions which takes a vector, but the position vector is not defined until after Finalize(), so it unavailable at parsing time. Related to RobotLocomotion#13065, and this slack discussion: https://drakedevelopers.slack.com/archives/C2WBPQDB7/p1601749507024400
…ives Adds the ability to set default joint positions and default free body poses in the add_model directive. I would have liked to be able to enable a tag like default_positions which takes a vector, but the position vector is not defined until after Finalize(), so it unavailable at parsing time. Related to RobotLocomotion#13065, and this slack discussion: https://drakedevelopers.slack.com/archives/C2WBPQDB7/p1601749507024400
…ives (#17802) * [multibody/parsing] Add support for default positions in model directives Adds the ability to set default joint positions and default free body poses in the add_model directive. I would have liked to be able to enable a tag like default_positions which takes a vector, but the position vector is not defined until after Finalize(), so it unavailable at parsing time. Related to #13065, and this slack discussion: https://drakedevelopers.slack.com/archives/C2WBPQDB7/p1601749507024400
@joemasterjohn -- can you update or close this issue (per my comment just above)? |
The discussions around #15948 are somewhat related here. Now that model directives can specify default joint positions as of #17802, we will eventually need Drake's SDFormat parser to reach feature parity on that front so that our DMD->SDF conversion tool has a way to convert that spelling. As such, we'll need some XML tag in our SDFormat parser for the initial joint position. That could be a custom tag like If that process it too slow, we can start with the drake-custom tag for now, but I doesn't seem like it should be difficult to do it correctly from the get-go. |
I think we need to get out in front of this. I assume it will take a little while to adjust SDFormat, prior to Drake being able to use the new spelling. SDFormat needs a spec upgrade that defines your new preferred spelling (e.g., Is there a tracking issue (feature request) anywhere on the SDFormat side yet? I was not able to find one. |
See also related discussion in #19230. |
I'm working on parsing the
<joint><axis><initial_position>
tag to set the default angle for aRevoluteJoint
and aPrismaticJoint
inmultibody/parsing/detail_sdf_parser.cc
. Here is my branch (currently only parsingRevoluteJoint
):https://github.com/joemasterjohn/drake/tree/parsing_joint_initial_position
Right now
RevoluteJoint
andPrismaticJoint
are deferring ownership of the their default positions (RevoluteJoint::set_default_angle()
andPrismaticJoint::set_default_translation()
respectively) to theirMobilizer
. This disallows setting the initial position prior to the parentMultibodyTree
being finalized because of a precondition inget_mutable_mobilizer()
. I believe the default position should live in theJoint
class. Thoughts?The text was updated successfully, but these errors were encountered: