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

Allow removal of model that has joint_position_controller plugin. #2252

Merged
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,21 @@
{
GZ_PROFILE("JointPositionController::PreUpdate");

// \TODO(anyone) This is a temporary fix for
// gazebosim/gz-sim#2165 until gazebosim/gz-sim#2217 is resolved.
if (kNullEntity == this->dataPtr->model.Entity())
{
return;

Check warning on line 327 in src/systems/joint_position_controller/JointPositionController.cc

View check run for this annotation

Codecov / codecov/patch

src/systems/joint_position_controller/JointPositionController.cc#L327

Added line #L327 was not covered by tests
}

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

Check warning on line 335 in src/systems/joint_position_controller/JointPositionController.cc

View check run for this annotation

Codecov / codecov/patch

src/systems/joint_position_controller/JointPositionController.cc#L332-L335

Added lines #L332 - L335 were not covered by tests
}

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