Skip to content

Commit dbe54a4

Browse files
committed
core: Continue to fix the debug build
1 parent 3c845b7 commit dbe54a4

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

include/pinocchio/algorithm/constraints/coulomb-friction-cone.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ namespace pinocchio
6969
explicit CoulombFrictionConeTpl(const Scalar mu)
7070
: mu(mu)
7171
{
72-
assert(mu >= 0 && "mu must be positive");
72+
assert(check_expression_if_real<Scalar>(mu >= 0) && "mu must be positive");
7373
}
7474

7575
/// \brief Copy constructor.
@@ -124,7 +124,7 @@ namespace pinocchio
124124
const Eigen::MatrixBase<Vector3LikeIn> & x,
125125
const Eigen::MatrixBase<Vector3LikeOut> & res_) const
126126
{
127-
assert(mu >= 0 && "mu must be positive");
127+
assert(check_expression_if_real<Scalar>(mu >= 0) && "mu must be positive");
128128
// EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Vector3Like, 3);
129129
assert(x.size() == 3 && "The input vector is of wrong size.");
130130
typedef Eigen::Matrix<Scalar, 2, 1> Vector2Plain;
@@ -168,11 +168,11 @@ namespace pinocchio
168168
typename PINOCCHIO_EIGEN_PLAIN_TYPE(Vector3Like1) weightedProject(
169169
const Eigen::MatrixBase<Vector3Like1> & x, const Eigen::MatrixBase<Vector3Like2> & R) const
170170
{
171-
assert(mu >= 0 && "mu must be positive");
171+
assert(check_expression_if_real<Scalar>(mu >= 0) && "mu must be positive");
172172
// EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Vector3Like, 3);
173173
assert(x.size() == 3 && "The input vector is of wrong size.");
174-
assert(R(2) > 0 && "R(2) must be strictly positive");
175-
assert(R(0) == R(1) && "R(0) must be equal to R(1)");
174+
assert(check_expression_if_real<Scalar>(R(2) > 0) && "R(2) must be strictly positive");
175+
assert(check_expression_if_real<Scalar>(R(0) == R(1)) && "R(0) must be equal to R(1)");
176176

177177
typedef typename PINOCCHIO_EIGEN_PLAIN_TYPE(Vector3Like1) Vector3Plain;
178178

@@ -302,7 +302,7 @@ namespace pinocchio
302302
explicit DualCoulombFrictionConeTpl(const Scalar mu)
303303
: mu(mu)
304304
{
305-
assert(mu >= 0 && "mu must be positive");
305+
assert(check_expression_if_real<Scalar>(mu >= 0) && "mu must be positive");
306306
}
307307

308308
/// \brief Copy constructor.
@@ -344,7 +344,7 @@ namespace pinocchio
344344
const Eigen::MatrixBase<Vector3LikeIn> & x,
345345
const Eigen::MatrixBase<Vector3LikeOut> & res_) const
346346
{
347-
assert(mu >= 0 && "mu must be positive");
347+
assert(check_expression_if_real<Scalar>(mu >= 0) && "mu must be positive");
348348
// EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Vector3Like, 3);
349349
assert(x.size() == 3 && "The input vector is of wrong size.");
350350
const Scalar & z = x[2];

include/pinocchio/algorithm/constraints/joint-limit-constraint.hxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ namespace pinocchio
163163
{
164164
const auto activable_idx_q = activable_idx_qs[i];
165165
bound_position_limit[bound_row_id] = lb[activable_idx_q];
166-
assert(marg[activable_idx_q] >= 0);
166+
assert(check_expression_if_real<Scalar>(marg[activable_idx_q] >= 0));
167167
bound_position_margin[bound_row_id] = marg[activable_idx_q];
168168
bound_row_id++;
169169
}
@@ -172,7 +172,7 @@ namespace pinocchio
172172
{
173173
const auto activable_idx_q = activable_idx_qs[i];
174174
bound_position_limit[bound_row_id] = ub[activable_idx_q];
175-
assert(marg[activable_idx_q] >= 0);
175+
assert(check_expression_if_real<Scalar>(marg[activable_idx_q] >= 0));
176176
bound_position_margin[bound_row_id] = marg[activable_idx_q];
177177
bound_row_id++;
178178
}

include/pinocchio/math/eigenvalues-tridiagonal-matrix.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ namespace pinocchio
5353
const Eigen::DenseIndex dm = m2 - m1 + 1;
5454
const Scalar relfeh = 2 * Eigen::NumTraits<Scalar>::epsilon();
5555

56-
assert((Scalar(1) + relfeh) > Scalar(1));
56+
assert(check_expression_if_real<Scalar>((Scalar(1) + relfeh) > Scalar(1)));
5757

5858
const auto & alphas = tridiagonal_mat.diagonal();
5959
const auto & betas_ = tridiagonal_mat.subDiagonal();

include/pinocchio/math/matrix.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ namespace pinocchio
678678
tmp = 0.5 * (mat + mat.transpose());
679679
mat = tmp;
680680

681-
assert(mat == mat.transpose());
681+
assert(isSymmetric(mat));
682682
}
683683

684684
template<typename Matrix>

0 commit comments

Comments
 (0)