Skip to content

Commit b8d14d3

Browse files
authored
Merge pull request #240 from Ipuch/master
SoftContact torque applied in world frame.
2 parents 5b59f72 + 9cd690a commit b8d14d3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/RigidBody/SoftContactNode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ RigidBodyDynamics::Math::SpatialVector rigidbody::SoftContactNode::computeForceA
9494

9595
// Find the application point of the force
9696
RigidBodyDynamics::Math::SpatialVector out(0, 0, 0, 0, 0, 0);
97-
out.block(0, 0, 3, 1) = force.cross(CoMinGlobal - applicationPoint(x));
97+
out.block(0, 0, 3, 1) = force.cross(- applicationPoint(x));
9898
out.block(3, 0, 3, 1) = force;
9999
return out;
100100
}

test/test_rigidbody.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ TEST(SoftContacts, ForceAtCoM){
409409

410410
RigidBodyDynamics::Math::SpatialVector force = sphere.computeForceAtCom(model, Q, QDot);
411411

412-
std::vector<double> forceExpected = {847.90514495586694, -529.16654948198982, 694.87983562160457,
412+
std::vector<double> forceExpected = {-169.49529328017607, 835.69754838406357, -2.2059677321320312,
413413
-275.74596651650978, -55.149193303301956, 294.47295042042418};
414414
for (unsigned int i = 0; i < 6; ++i) {
415415
SCALAR_TO_DOUBLE(f, force(i));

0 commit comments

Comments
 (0)