Skip to content

Commit

Permalink
Log an error if JointPositionController cannot find the joint. (citad…
Browse files Browse the repository at this point in the history
…el retarget) (#1314)

In the event a user enters the wrong name for a certain joint, the JointPositionController system will silently fail. This PR adds a simple error message that tells the user that the joint was not found.

Signed-off-by: Arjo Chakravarty <[email protected]>
  • Loading branch information
arjo129 authored Jan 28, 2022
1 parent 749884d commit ebb3a9a
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,17 @@ void JointPositionController::PreUpdate(
this->dataPtr->model.JointByName(_ecm, this->dataPtr->jointName);
}

// If the joint is still not found then warn the user, they may have entered
// the wrong joint name.
if (this->dataPtr->jointEntity == kNullEntity)
{
static bool warned = false;
if(!warned)
ignerr << "Could not find joint with name ["
<< this->dataPtr->jointName <<"]\n";
warned = true;
return;
}

// Nothing left to do if paused.
if (_info.paused)
Expand Down

0 comments on commit ebb3a9a

Please sign in to comment.