Skip to content

Commit

Permalink
windows CI eigen3.2 sidestepping fix;
Browse files Browse the repository at this point in the history
check normalize for non-zero lengths and setIdentity for splinemotion transforms
  • Loading branch information
ddengster committed Oct 28, 2020
1 parent a2241df commit 10e12cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion include/fcl/math/motion/spline_motion-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ SplineMotion<S>::SplineMotion(
RB = (Rd[0] - Rd[1] * 2 + Rd[2]) * 3;
RC = (Rd[2] - Rd[0]) * 3;

tf.setIdentity();
integrate(0.0);
}

Expand Down Expand Up @@ -124,7 +125,8 @@ bool SplineMotion<S>::integrate(S dt) const
Vector3<S> cur_T = Td[0] * getWeight0(dt) + Td[1] * getWeight1(dt) + Td[2] * getWeight2(dt) + Td[3] * getWeight3(dt);
Vector3<S> cur_w = Rd[0] * getWeight0(dt) + Rd[1] * getWeight1(dt) + Rd[2] * getWeight2(dt) + Rd[3] * getWeight3(dt);
S cur_angle = cur_w.norm();
cur_w.normalize();
if (cur_w.squaredNorm() > 0.0)
cur_w.normalize();

tf.linear() = AngleAxis<S>(cur_angle, cur_w).toRotationMatrix();
tf.translation() = cur_T;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ leafTesting(int, int) const
this->nsolver->shapeDistance(*(this->model1), this->tf1, *(this->model2), this->tf2, &distance, &closest_p1, &closest_p2);

Vector3<S> n = closest_p2 - closest_p1;
n.normalize();
if (n.squaredNorm() > 0.0)
n.normalize();
TBVMotionBoundVisitor<RSS<S>> mb_visitor1(model1_bv, n);
TBVMotionBoundVisitor<RSS<S>> mb_visitor2(model2_bv, -n);
S bound1 = motion1->computeMotionBound(mb_visitor1);
Expand Down

0 comments on commit 10e12cc

Please sign in to comment.