Skip to content
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

Fix a crash due to an invalid pointer #486

Merged
merged 2 commits into from
Mar 18, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dartsim/src/SDFFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -744,10 +744,11 @@ Identity SDFFeatures::ConstructSdfJoint(

{
auto childsParentJoint = _child->getParentJoint();
std::string parentName = worldParent? "world" : _parent->getName();
if (childsParentJoint->getType() != "FreeJoint")
{
ignerr << "Asked to create a joint between links "
<< "[" << _parent->getName() << "] as parent and ["
<< "[" << parentName << "] as parent and ["
<< _child->getName() << "] as child, but the child link already "
<< "has a parent joint of type [" << childsParentJoint->getType()
<< "].\n";
Expand All @@ -757,7 +758,7 @@ Identity SDFFeatures::ConstructSdfJoint(
{
// TODO(MXG): Add support for non-tree graph structures
ignerr << "Asked to create a closed kinematic chain between links "
<< "[" << _parent->getName() << "] and [" << _child->getName()
<< "[" << parentName << "] and [" << _child->getName()
<< "], but that is not supported by the dartsim wrapper yet.\n";
return this->GenerateInvalidId();
}
Expand Down