Skip to content

Commit aab0161

Browse files
committed
JointSpline - add assert for configuration to be between 0 and 1
1 parent b5abc3a commit aab0161

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/pinocchio/multibody/joint/joint-spline.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,9 @@ namespace pinocchio
224224
template<typename ConfigVector>
225225
void calc(JointDataDerived & data, const Eigen::MatrixBase<ConfigVector> & qs) const
226226
{
227+
assert(
228+
qs[0] >= 0.0 && qs[0] <= 1.0 && "Spline joint configuration (q) must be between 0 and 1.");
227229
data.joint_q = qs.template segment<NQ>(idx_q());
228-
// assert(data.joint_q <)
229230

230231
SpanIndexes indexes = FindSpan<Scalar, Options>::run(qs, degree, nbCtrlFrames, knots);
231232

@@ -260,6 +261,9 @@ namespace pinocchio
260261
const Eigen::MatrixBase<ConfigVector> & qs,
261262
const Eigen::MatrixBase<TangentVector> & vs) const
262263
{
264+
assert(
265+
qs[0] >= 0.0 && qs[0] <= 1.0 && "Spline joint configuration (q) must be between 0 and 1.");
266+
263267
data.joint_q = qs.template segment<NQ>(idx_q());
264268
data.joint_v = vs.template segment<NV>(idx_v());
265269

0 commit comments

Comments
 (0)