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

Fix gazebo joint collision check bug #227

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
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
Next Next commit
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.
  • Loading branch information
rickstaa committed Mar 23, 2024
commit 90dde7f8008522238e3adf6055f9d2a501c3108a
4 changes: 2 additions & 2 deletions franka_gazebo/src/joint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ double Joint::getLinkMass() const {
}

bool Joint::isInCollision() const {
rickstaa marked this conversation as resolved.
Show resolved Hide resolved
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;
}

void Joint::setJointPosition(const double joint_position) {
Expand Down