Skip to content

Commit 846d488

Browse files
authored
Merge pull request #3614 from opensim-org/constant_curvature_joint_fix
Use `OPENSIM_ASSERT` in `ConstantCurvatureJoint::ConstantCurvatureJointImpl`
2 parents d349581 + 1b1a1d5 commit 846d488

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

OpenSim/Simulation/SimbodyEngine/ConstantCurvatureJoint.cpp

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Vec3 OpenSim::ConstantCurvatureJoint::clamp(const SimTK::Vec3& q) {
5656
"to unphysical behavior. Please adjust your model "
5757
"or simulation to avoid this state.",
5858
pos(0), bound));
59-
OPENSIM_ASSERT_FRMOBJ(false);
59+
OPENSIM_ASSERT(false);
6060
pos(0) = bound;
6161
}
6262
if (pos(0) < -bound) {
@@ -67,7 +67,7 @@ Vec3 OpenSim::ConstantCurvatureJoint::clamp(const SimTK::Vec3& q) {
6767
"to unphysical behavior. Please adjust your model "
6868
"or simulation to avoid this state.",
6969
pos(0), -bound));
70-
OPENSIM_ASSERT_FRMOBJ(false);
70+
OPENSIM_ASSERT(false);
7171
pos(0) = -bound;
7272
}
7373
if (pos(1) > bound) {
@@ -78,7 +78,7 @@ Vec3 OpenSim::ConstantCurvatureJoint::clamp(const SimTK::Vec3& q) {
7878
"to unphysical behavior. Please adjust your model "
7979
"or simulation to avoid this state.",
8080
pos(1), bound));
81-
OPENSIM_ASSERT_FRMOBJ(false);
81+
OPENSIM_ASSERT(false);
8282
pos(1) = bound;
8383
}
8484
if (pos(1) < -bound) {
@@ -89,7 +89,7 @@ Vec3 OpenSim::ConstantCurvatureJoint::clamp(const SimTK::Vec3& q) {
8989
"to unphysical behavior. Please adjust your model "
9090
"or simulation to avoid this state.",
9191
pos(1), -bound));
92-
OPENSIM_ASSERT_FRMOBJ(false);
92+
OPENSIM_ASSERT(false);
9393
pos(1) = -bound;
9494
}
9595
if (pos(2) > bound) {
@@ -100,7 +100,7 @@ Vec3 OpenSim::ConstantCurvatureJoint::clamp(const SimTK::Vec3& q) {
100100
"to unphysical behavior. Please adjust your model "
101101
"or simulation to avoid this state.",
102102
pos(2), bound));
103-
OPENSIM_ASSERT_FRMOBJ(false);
103+
OPENSIM_ASSERT(false);
104104
pos(2) = bound;
105105
}
106106
if (pos(2) < -bound) {
@@ -111,7 +111,7 @@ Vec3 OpenSim::ConstantCurvatureJoint::clamp(const SimTK::Vec3& q) {
111111
"to unphysical behavior. Please adjust your model "
112112
"or simulation to avoid this state.",
113113
pos(2), -bound));
114-
OPENSIM_ASSERT_FRMOBJ(false);
114+
OPENSIM_ASSERT(false);
115115
pos(2) = -bound;
116116
}
117117
return pos;
@@ -205,7 +205,7 @@ Mat33 OpenSim::ConstantCurvatureJoint::eulerXZYToMatrixGrad(
205205
ret(1, 2) = -(-sy) * sx + cx * (cy)*sz;
206206
ret(2, 2) = cx * (-sy) + sx * (cy)*sz;
207207
} else {
208-
OPENSIM_ASSERT_FRMOBJ(false);
208+
OPENSIM_ASSERT(false);
209209
}
210210

211211
return ret;
@@ -247,7 +247,7 @@ Mat63 OpenSim::ConstantCurvatureJoint::getEulerJacobian(const Vec3& q) {
247247

248248
Mat63 OpenSim::ConstantCurvatureJoint::getEulerJacobianDerivWrtPos(
249249
const Vec3& q, int index) {
250-
OPENSIM_ASSERT_FRMOBJ(index < 3);
250+
OPENSIM_ASSERT(index < 3);
251251

252252
Mat63 DJ_Dq;
253253
DJ_Dq.setToZero();
@@ -678,10 +678,10 @@ class ConstantCurvatureJointImpl
678678
OpenSim::ConstantCurvatureJoint::clamp(q + neutralPos), length);
679679
Vec6 result = J * Vec3(u[0], u[1], u[2]);
680680

681-
OPENSIM_ASSERT_FRMOBJ(!q.isNaN());
682-
OPENSIM_ASSERT_FRMOBJ(!J.isNaN());
683-
OPENSIM_ASSERT_FRMOBJ(!J.isInf());
684-
OPENSIM_ASSERT_FRMOBJ(!result.isNaN());
681+
OPENSIM_ASSERT(!q.isNaN());
682+
OPENSIM_ASSERT(!J.isNaN());
683+
OPENSIM_ASSERT(!J.isInf());
684+
OPENSIM_ASSERT(!result.isNaN());
685685

686686
return SpatialVec(result.getSubVec<3>(0), result.getSubVec<3>(3));
687687
}
@@ -699,10 +699,10 @@ class ConstantCurvatureJointImpl
699699

700700
Vec3 result = J.transpose() * rawSpatial;
701701

702-
OPENSIM_ASSERT_FRMOBJ(!q.isNaN());
703-
OPENSIM_ASSERT_FRMOBJ(!J.isNaN());
704-
OPENSIM_ASSERT_FRMOBJ(!J.isInf());
705-
OPENSIM_ASSERT_FRMOBJ(!result.isNaN());
702+
OPENSIM_ASSERT(!q.isNaN());
703+
OPENSIM_ASSERT(!J.isNaN());
704+
OPENSIM_ASSERT(!J.isInf());
705+
OPENSIM_ASSERT(!result.isNaN());
706706

707707
Vec3::updAs(f) = result;
708708
}
@@ -722,11 +722,11 @@ class ConstantCurvatureJointImpl
722722
dq, length);
723723
Vec6 result = dJ * Vec3(u[0], u[1], u[2]);
724724

725-
OPENSIM_ASSERT_FRMOBJ(!q.isNaN());
726-
OPENSIM_ASSERT_FRMOBJ(!dq.isNaN());
727-
OPENSIM_ASSERT_FRMOBJ(!dJ.isNaN());
728-
OPENSIM_ASSERT_FRMOBJ(!dJ.isInf());
729-
OPENSIM_ASSERT_FRMOBJ(!result.isNaN());
725+
OPENSIM_ASSERT(!q.isNaN());
726+
OPENSIM_ASSERT(!dq.isNaN());
727+
OPENSIM_ASSERT(!dJ.isNaN());
728+
OPENSIM_ASSERT(!dJ.isInf());
729+
OPENSIM_ASSERT(!result.isNaN());
730730

731731
return SpatialVec(result.getSubVec<3>(0), result.getSubVec<3>(3));
732732
}
@@ -748,24 +748,24 @@ class ConstantCurvatureJointImpl
748748

749749
Vec3 result = dJ.transpose() * rawSpatial;
750750

751-
OPENSIM_ASSERT_FRMOBJ(!q.isNaN());
752-
OPENSIM_ASSERT_FRMOBJ(!dq.isNaN());
753-
OPENSIM_ASSERT_FRMOBJ(!dJ.isNaN());
754-
OPENSIM_ASSERT_FRMOBJ(!dJ.isInf());
755-
OPENSIM_ASSERT_FRMOBJ(!result.isNaN());
751+
OPENSIM_ASSERT(!q.isNaN());
752+
OPENSIM_ASSERT(!dq.isNaN());
753+
OPENSIM_ASSERT(!dJ.isNaN());
754+
OPENSIM_ASSERT(!dJ.isInf());
755+
OPENSIM_ASSERT(!result.isNaN());
756756

757757
Vec3::updAs(f) = result;
758758
}
759759

760760
void setQToFitTransform(
761761
const State&, const Transform& X_FM, int nq, Real* q) const {
762-
OPENSIM_ASSERT_FRMOBJ(false);
762+
OPENSIM_ASSERT(false);
763763
Vec3::updAs(q) = X_FM.p();
764764
}
765765

766766
void setUToFitVelocity(
767767
const State&, const SpatialVec& V_FM, int nu, Real* u) const {
768-
OPENSIM_ASSERT_FRMOBJ(false);
768+
OPENSIM_ASSERT(false);
769769
Vec3::updAs(u) = V_FM[1];
770770
}
771771

0 commit comments

Comments
 (0)