Skip to content

Commit

Permalink
Temporary fix for gazebosim#2165 until gazebosim#2217 is resolved.
Browse files Browse the repository at this point in the history
Signed-off-by: Johan Rutgeerts <[email protected]>
  • Loading branch information
jrutgeer committed Nov 21, 2023
1 parent 14f8796 commit a89796c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/systems/joint_position_controller/JointPositionController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,19 @@ void JointPositionController::PreUpdate(
{
GZ_PROFILE("JointPositionController::PreUpdate");

if (kNullEntity == this->dataPtr->model.Entity())
{
return;
}

if (!this->dataPtr->model.Valid(_ecm))
{
gzwarn << "JointPositionController model no longer valid. "
<< "Disabling plugin." << std::endl;
this->dataPtr->model = Model(kNullEntity);
return;
}

// \TODO(anyone) Support rewind
if (_info.dt < std::chrono::steady_clock::duration::zero())
{
Expand Down

0 comments on commit a89796c

Please sign in to comment.