Skip to content

Commit a07f15e

Browse files
committed
fix(franka_gazebo): add gravity component to joint collision checking
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.
1 parent 1d5a464 commit a07f15e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

franka_gazebo/src/joint.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ double Joint::getLinkMass() const {
6464
}
6565

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

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

0 commit comments

Comments
 (0)