Skip to content

Commit

Permalink
spatial: Add expr and const_expr method in SE3Tpl
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisv committed Jan 9, 2025
1 parent 8a2641d commit c680da2
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/pinocchio/multibody/joint/joint-helical.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ namespace pinocchio
typedef const typename Vector3::ConstantReturnType ConstLinearRef;
typedef typename traits<PlainType>::ActionMatrixType ActionMatrixType;
typedef typename traits<PlainType>::HomogeneousMatrixType HomogeneousMatrixType;
typedef typename traits<PlainType>::ExprType ExprType;
typedef typename traits<PlainType>::ConstExprType ConstExprType;
}; // traits TransformHelicalTpl

template<typename Scalar, int Options, int axis>
Expand Down
2 changes: 2 additions & 0 deletions include/pinocchio/multibody/joint/joint-prismatic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ namespace pinocchio
typedef const Vector3 ConstLinearRef;
typedef typename traits<PlainType>::ActionMatrixType ActionMatrixType;
typedef typename traits<PlainType>::HomogeneousMatrixType HomogeneousMatrixType;
typedef typename traits<PlainType>::ExprType ExprType;
typedef typename traits<PlainType>::ConstExprType ConstExprType;
}; // traits TransformPrismaticTpl

template<typename Scalar, int Options, int axis>
Expand Down
2 changes: 2 additions & 0 deletions include/pinocchio/multibody/joint/joint-revolute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ namespace pinocchio
typedef const typename Vector3::ConstantReturnType ConstLinearRef;
typedef typename traits<PlainType>::ActionMatrixType ActionMatrixType;
typedef typename traits<PlainType>::HomogeneousMatrixType HomogeneousMatrixType;
typedef typename traits<PlainType>::ExprType ExprType;
typedef typename traits<PlainType>::ConstExprType ConstExprType;
}; // traits TransformRevoluteTpl

template<typename Scalar, int Options, int axis>
Expand Down
2 changes: 2 additions & 0 deletions include/pinocchio/multibody/joint/joint-translation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ namespace pinocchio
typedef const LinearType & ConstLinearRef;
typedef typename traits<PlainType>::ActionMatrixType ActionMatrixType;
typedef typename traits<PlainType>::HomogeneousMatrixType HomogeneousMatrixType;
typedef typename traits<PlainType>::ExprType ExprType;
typedef typename traits<PlainType>::ConstExprType ConstExprType;
}; // traits TransformTranslationTpl

template<typename Scalar, int Options>
Expand Down
10 changes: 10 additions & 0 deletions include/pinocchio/spatial/se3-base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,16 @@ namespace pinocchio
derived().normalized();
}

ExprType expr()
{
return derived().expr_impl();
}

ConstExprType const_expr() const
{
return derived().const_expr_impl();
}

}; // struct SE3Base

} // namespace pinocchio
Expand Down
12 changes: 12 additions & 0 deletions include/pinocchio/spatial/se3-tpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ namespace pinocchio
typedef Matrix6 ActionMatrixType;
typedef Matrix4 HomogeneousMatrixType;
typedef SE3Tpl<Scalar, Options> PlainType;
typedef SE3TplExpr<Scalar, Options> ExprType;
typedef SE3TplConstExpr<Scalar, Options> ConstExprType;
}; // traits SE3Tpl

template<typename _Scalar, int _Options>
Expand Down Expand Up @@ -404,6 +406,16 @@ namespace pinocchio
return res;
}

ExprType expr_impl()
{
return ExprType(*this);
}

ConstExprType const_expr_impl() const
{
return ConstExprType(*this);
}

///
/// \brief Linear interpolation on the SE3 manifold.
///
Expand Down
2 changes: 2 additions & 0 deletions include/pinocchio/spatial/se3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
typedef TYPENAME traits<Derived>::ActionMatrixType ActionMatrixType; \
typedef TYPENAME traits<Derived>::HomogeneousMatrixType HomogeneousMatrixType; \
typedef TYPENAME traits<Derived>::PlainType PlainType; \
typedef TYPENAME traits<Derived>::ExprType ExprType; \
typedef TYPENAME traits<Derived>::ConstExprType ConstExprType; \
enum \
{ \
Options = traits<Derived>::Options, \
Expand Down

0 comments on commit c680da2

Please sign in to comment.