Skip to content

Commit

Permalink
Fix issue that causes segfault when joint has not been populated yet.
Browse files Browse the repository at this point in the history
Signed-off-by: Arjo Chakravarty <[email protected]>
  • Loading branch information
arjo129 authored and chapulina committed Nov 2, 2021
1 parent ed39cb8 commit 5eddba7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lrauv_ignition_plugins/src/JointPositionPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ void TethysJointPlugin::PreUpdate(
return;

auto currentPos = jointPosComp->Data();
if (currentPos.size() == 0)
{
ignerr << "Joint ["
<< this->dataPtr->jointName
<< "] unable to get position" <<std::endl;
return;
}

// Get command position
double cmdPos;
Expand Down

0 comments on commit 5eddba7

Please sign in to comment.