Skip to content

Commit

Permalink
fix(franka_gazebo): add gravity component to joint collision checking
Browse files Browse the repository at this point in the history
This commit makes sure the gravity contribution is accounted for in the
joint collision checking. This needs to be done since it is not stored
in `joint->command` variable.
  • Loading branch information
rickstaa committed Feb 22, 2022
1 parent 1d5a464 commit a07f15e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions franka_gazebo/src/joint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ double Joint::getLinkMass() const {
}

bool Joint::isInCollision() const {
return std::abs(this->effort - this->command) > this->collision_threshold;
return std::abs(this->effort - this->command + this->gravity) > this->collision_threshold;
}

bool Joint::isInContact() const {
return std::abs(this->effort - this->command) > this->contact_threshold;
return std::abs(this->effort - this->command + this->gravity) > this->contact_threshold;
}
} // namespace franka_gazebo

0 comments on commit a07f15e

Please sign in to comment.