-
Notifications
You must be signed in to change notification settings - Fork 288
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 constructor to not SEGFAULT when passed a nullptr #440
Conversation
Yes, I completely agree with this. In fact, if you use
(1) Is no longer valid, and (2) can be fixed by requiring that at least one Does that sound reasonable? Edit: Or instead of returning a nullptr, we could just return a pointer to a Linkage / Chain / etc that is empty. I'm not sure which would be preferable. |
I'm not sure that I follow. My understanding is was that
I would expect:
Is this correct? Do I have the roles of I'm not sure that I understand the purpose of |
It should be noted that the construction of a If you reverse the arguments that get passed into |
So all of your expectations would be correct, except that (2) would not produce an error, it would be the same as (1) but with the joint indices flipped. Edit: Your expectations will be correct, once I make the changes to Chain that we agreed on. |
Also, (4) would produce { j1 }. Correct? |
Ah yes, you're right. (4) would produce { j1 }. |
With respect to (5), we could either print a |
Ok, that makes sense to me: I agree 100% with what you said. This will require changing the behavior of
I'm not sure. I think it makes sense to:
The only cases I can think of for (2) are if both |
I'm actually permitting Linkages to consist of BodyNodes from multiple Skeletons, as long as there's an unbroken connection to the roots of each Skeleton. Nothing about the ReferentialSkeleton mechanics precludes referencing multiple Skeletons at once. I'm really thinking we should just outright permit passing in two nullptrs, and simply return an empty Chain. For example, what if someone is constructing Chains programmatically to test what kind of Chain is available between arbitrary BodyNodes, and they try Users would still have a reasonable way of seeing whether their Chain creation was successful. Instead of testing |
That's fine by me. Do you mind making this change? It sounds like this will affect |
Yep, I can make the changes, no problem. |
This pull request is now replaced by #443 |
It's very convenient to write code that looks like this:
Unfortunately, this currently SEGFAULTs if either
getBodyNode
returnsnullptr
. The only solution is to do this, which is much more verbose:This pull request modifies
Chain::create
to returnnullptr
if either inputBodyNode
isnullptr
. This enables you to write the first block of code.API Question: Should
Chain::create(~)
interpretnullptr
instart
to mean "the world"? This would be necessary, in conjunction with my proposal in #437, to create a chain that includes a link attached to theWorld
. This would be consistent with the usage of anullptr
parent in DART to refer to the world frame.