expose-skew.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2015-2021 CNRS INRIA
3 // Copyright (c) 2020 Wandercraft
4 //
5 
9 
10 namespace pinocchio
11 {
12  namespace python
13  {
14  namespace bp = boost::python;
15 
16  // We need to resort to another call, because it seems that Boost.Python is not aligning the
17  // Eigen::MatrixBase. TODO: fix it!
18  template<typename Vector3>
19  Eigen::Matrix<typename Vector3::Scalar, 3, 3, Vector3::Options> skew(const Vector3 & v)
20  {
21  return pinocchio::skew(v);
22  }
23 
24  // We need to resort to another call, because it seems that Boost.Python is not aligning the
25  // Eigen::MatrixBase. TODO: fix it!
26  template<typename Vector3>
27  Eigen::Matrix<typename Vector3::Scalar, 3, 3, Vector3::Options>
28  skewSquare(const Vector3 & u, const Vector3 & v)
29  {
30  return pinocchio::skewSquare(u, v);
31  }
32 
33  // We need to resort to another call, because it seems that Boost.Python is not aligning the
34  // Eigen::MatrixBase. TODO: fix it!
35  template<typename Matrix3>
36  Eigen::Matrix<typename Matrix3::Scalar, 3, 1, Matrix3::Options> unSkew(const Matrix3 & mat)
37  {
38  return pinocchio::unSkew(mat);
39  }
40 
41  void exposeSkew()
42  {
43  typedef context::SE3::Matrix3 Matrix3;
45 
46  bp::def(
47  "skew", &skew<Vector3>, bp::arg("u"),
48  "Computes the skew representation of a given 3d vector, "
49  "i.e. the antisymmetric matrix representation of the cross product operator, aka U = "
50  "[u]x.\n"
51  "Parameters:\n"
52  "\tu: the input vector of dimension 3");
53 
54  bp::def(
55  "skewSquare", &skewSquare<Vector3>, bp::args("u", "v"),
56  "Computes the skew square representation of two given 3d vectors, "
57  "i.e. the antisymmetric matrix representation of the chained cross product operator, "
58  "u x (v x w), where w is another 3d vector.\n"
59  "Parameters:\n"
60  "\tu: the first input vector of dimension 3\n"
61  "\tv: the second input vector of dimension 3");
62 
63  bp::def(
64  "unSkew", &unSkew<Matrix3>, bp::arg("U"),
65  "Inverse of skew operator. From a given skew symmetric matrix U (i.e U = -U.T)"
66  "of dimension 3x3, it extracts the supporting vector, i.e. the entries of U.\n"
67  "Mathematically speacking, it computes v such that U.dot(x) = cross(u, x).\n"
68  "Parameters:\n"
69  "\tU: the input skew symmetric matrix of dimension 3x3.");
70  }
71 
72  } // namespace python
73 } // namespace pinocchio
boost::python
pinocchio::SE3Tpl::Vector3
traits< SE3Tpl >::Vector3 Vector3
Definition: spatial/se3-tpl.hpp:55
pinocchio::u
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorIn1 > const Eigen::MatrixBase< ConfigVectorIn2 > const Scalar & u
Definition: joint-configuration.hpp:1139
pinocchio::python::skewSquare
Eigen::Matrix< typename Vector3::Scalar, 3, 3, Vector3::Options > skewSquare(const Vector3 &u, const Vector3 &v)
Definition: expose-skew.cpp:28
skew.hpp
pinocchio::SE3Tpl< Scalar, Options >::Matrix3
traits< SE3Tpl >::Matrix3 Matrix3
Definition: spatial/se3-tpl.hpp:56
pinocchio::skew
void skew(const Eigen::MatrixBase< Vector3 > &v, const Eigen::MatrixBase< Matrix3 > &M)
Computes the skew representation of a given 3d vector, i.e. the antisymmetric matrix representation o...
Definition: skew.hpp:22
python
se3.hpp
pinocchio::python::v
const Vector3Like & v
Definition: bindings/python/spatial/explog.hpp:66
mat
mat
pinocchio::context::Vector3
Eigen::Matrix< Scalar, 3, 1, Options > Vector3
Definition: context/generic.hpp:53
pinocchio::python::skew
Eigen::Matrix< typename Vector3::Scalar, 3, 3, Vector3::Options > skew(const Vector3 &v)
Definition: expose-skew.cpp:19
pinocchio::skewSquare
void skewSquare(const Eigen::MatrixBase< V1 > &u, const Eigen::MatrixBase< V2 > &v, const Eigen::MatrixBase< Matrix3 > &C)
Computes the square cross product linear operator C(u,v) such that for any vector w,...
Definition: skew.hpp:182
pinocchio::python::exposeSkew
void exposeSkew()
Definition: expose-skew.cpp:41
pinocchio::python::unSkew
Eigen::Matrix< typename Matrix3::Scalar, 3, 1, Matrix3::Options > unSkew(const Matrix3 &mat)
Definition: expose-skew.cpp:36
fwd.hpp
pinocchio::unSkew
void unSkew(const Eigen::MatrixBase< Matrix3 > &M, const Eigen::MatrixBase< Vector3 > &v)
Inverse of skew operator. From a given skew-symmetric matrix M of dimension 3x3, it extracts the supp...
Definition: skew.hpp:93
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Fri Nov 1 2024 02:41:43