@@ -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 ];
0 commit comments