-
Notifications
You must be signed in to change notification settings - Fork 287
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
Chain::create has unintuitive behavior #437
Comments
When you construct a Chain, it maintains a list of its Joints by maintaining a list of the child BodyNodes of those Joints. Vice versa, if a given BodyNode is in a Chain (or any other kind of referential skeleton) then its parent Joint is in the Chain. The assumption being made by the Chain constructor is that you want to include the
or
I'd be fine with either of these, although I think I'd prefer the second option, because I always tend to favor offering more choices. |
I'd prefer the first option since this definition of "chain" is pretty common. I don't feel strongly enough to argue about it, though, so I am also fine with a flag that defaults to being non-inclusive. 😄 |
The main reason that I want to offer both options is because I can see two use cases for the Chain class:
The first one would be useful for geometric planning while the second one would be useful for a controller (let's say I want to compute the center of mass of a chain of bodies). |
I don't see how this change would affect use case (2). We're only changing which However, if you feel strongly about this, I'm fine with adding a flag that defaults to non-inclusive. |
The way the indexing works, a Joint gets included in a ReferentialSkeleton by having its child BodyNode included. When you call So under the current scheme, there is a 1-to-1 correspondence between the Joints in a ReferentialSkeleton and the BodyNodes in that ReferentialSkeleton. There's a tiny bit more flexibility for DegreesOfFreedom (you can have a BodyNode in a ReferentialSkeleton without having all of its DegreesOfFreedom), but you only really get to take advantage of that flexibility if you use the Group class instead of the Linkage class. It may be possible to rework the scheme, but I feel like that might add unnecessary complexity. |
I see. In that case it makes sense to add a flag. |
It occurs to me that the default behavior we've agreed on can produce some unexpected results if the target is upstream of the start. Let's say you have:
And you run Would you prefer if the default behavior is to check which BodyNode is upstream/downstream of the other, and then select whether to exclude the start or target according to that? If so, I assume that if neither are downstream of the other, then both should be included. |
Fixed with #443 |
The
Chain::create
function surprisingly includes the parent joint of_start
in the chain. This is incorrect because the parent joint of_start
is not a member of the chain from_start
to_end
.This also conflicts with the convention in other software packages. Here's an excerpt from the SRDF documentation:
And the OpenRAVE documentation:
The text was updated successfully, but these errors were encountered: