Skip to content

Commit c680da2

Browse files
committed
spatial: Add expr and const_expr method in SE3Tpl
1 parent 8a2641d commit c680da2

File tree

7 files changed

+32
-0
lines changed

7 files changed

+32
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ namespace pinocchio
8484
typedef const typename Vector3::ConstantReturnType ConstLinearRef;
8585
typedef typename traits<PlainType>::ActionMatrixType ActionMatrixType;
8686
typedef typename traits<PlainType>::HomogeneousMatrixType HomogeneousMatrixType;
87+
typedef typename traits<PlainType>::ExprType ExprType;
88+
typedef typename traits<PlainType>::ConstExprType ConstExprType;
8789
}; // traits TransformHelicalTpl
8890

8991
template<typename Scalar, int Options, int axis>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ namespace pinocchio
220220
typedef const Vector3 ConstLinearRef;
221221
typedef typename traits<PlainType>::ActionMatrixType ActionMatrixType;
222222
typedef typename traits<PlainType>::HomogeneousMatrixType HomogeneousMatrixType;
223+
typedef typename traits<PlainType>::ExprType ExprType;
224+
typedef typename traits<PlainType>::ConstExprType ConstExprType;
223225
}; // traits TransformPrismaticTpl
224226

225227
template<typename Scalar, int Options, int axis>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ namespace pinocchio
8585
typedef const typename Vector3::ConstantReturnType ConstLinearRef;
8686
typedef typename traits<PlainType>::ActionMatrixType ActionMatrixType;
8787
typedef typename traits<PlainType>::HomogeneousMatrixType HomogeneousMatrixType;
88+
typedef typename traits<PlainType>::ExprType ExprType;
89+
typedef typename traits<PlainType>::ConstExprType ConstExprType;
8890
}; // traits TransformRevoluteTpl
8991

9092
template<typename Scalar, int Options, int axis>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ namespace pinocchio
216216
typedef const LinearType & ConstLinearRef;
217217
typedef typename traits<PlainType>::ActionMatrixType ActionMatrixType;
218218
typedef typename traits<PlainType>::HomogeneousMatrixType HomogeneousMatrixType;
219+
typedef typename traits<PlainType>::ExprType ExprType;
220+
typedef typename traits<PlainType>::ConstExprType ConstExprType;
219221
}; // traits TransformTranslationTpl
220222

221223
template<typename Scalar, int Options>

include/pinocchio/spatial/se3-base.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,16 @@ namespace pinocchio
214214
derived().normalized();
215215
}
216216

217+
ExprType expr()
218+
{
219+
return derived().expr_impl();
220+
}
221+
222+
ConstExprType const_expr() const
223+
{
224+
return derived().const_expr_impl();
225+
}
226+
217227
}; // struct SE3Base
218228

219229
} // namespace pinocchio

include/pinocchio/spatial/se3-tpl.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ namespace pinocchio
4242
typedef Matrix6 ActionMatrixType;
4343
typedef Matrix4 HomogeneousMatrixType;
4444
typedef SE3Tpl<Scalar, Options> PlainType;
45+
typedef SE3TplExpr<Scalar, Options> ExprType;
46+
typedef SE3TplConstExpr<Scalar, Options> ConstExprType;
4547
}; // traits SE3Tpl
4648

4749
template<typename _Scalar, int _Options>
@@ -404,6 +406,16 @@ namespace pinocchio
404406
return res;
405407
}
406408

409+
ExprType expr_impl()
410+
{
411+
return ExprType(*this);
412+
}
413+
414+
ConstExprType const_expr_impl() const
415+
{
416+
return ConstExprType(*this);
417+
}
418+
407419
///
408420
/// \brief Linear interpolation on the SE3 manifold.
409421
///

include/pinocchio/spatial/se3.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
typedef TYPENAME traits<Derived>::ActionMatrixType ActionMatrixType; \
2020
typedef TYPENAME traits<Derived>::HomogeneousMatrixType HomogeneousMatrixType; \
2121
typedef TYPENAME traits<Derived>::PlainType PlainType; \
22+
typedef TYPENAME traits<Derived>::ExprType ExprType; \
23+
typedef TYPENAME traits<Derived>::ConstExprType ConstExprType; \
2224
enum \
2325
{ \
2426
Options = traits<Derived>::Options, \

0 commit comments

Comments
 (0)