Skip to content

Commit

Permalink
Dartsim joint features issues
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Sep 19, 2023
1 parent e4a12af commit 9f47486
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dartsim/src/JointFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,21 @@ void JointFeatures::SetJointAcceleration(
void JointFeatures::SetJointForce(
const Identity &_id, std::size_t _dof, double _value)
{
auto *jointInfo = this->ReferenceInterface<JointInfo>(_id);
if (jointInfo == nullptr)
{
gzerr << "Invalid joint id value in SetJointForce" << std::endl;

Check warning on line 130 in dartsim/src/JointFeatures.cc

View check run for this annotation

Codecov / codecov/patch

dartsim/src/JointFeatures.cc#L130

Added line #L130 was not covered by tests
return;
}

auto joint = this->ReferenceInterface<JointInfo>(_id)->joint;

if (joint == nullptr)
{
gzerr << "Invalid joint in SetJointForce" << std::endl;
return;

Check warning on line 139 in dartsim/src/JointFeatures.cc

View check run for this annotation

Codecov / codecov/patch

dartsim/src/JointFeatures.cc#L138-L139

Added lines #L138 - L139 were not covered by tests
}

// Take extra care that the value is finite. A nan can cause the DART
// constraint solver to fail, which will in turn either cause a crash or
// collisions to fail
Expand Down

0 comments on commit 9f47486

Please sign in to comment.