bindings
python
multibody
expose-liegroups.cpp
Go to the documentation of this file.
1
//
2
// Copyright (c) 2015-2020 CNRS INRIA
3
//
4
5
#include "
pinocchio/bindings/python/fwd.hpp
"
6
#include "
pinocchio/bindings/python/multibody/liegroups.hpp
"
7
#include "
pinocchio/bindings/python/utils/namespace.hpp
"
8
9
#include <
eigenpy/memory.hpp
>
10
11
namespace
pinocchio
12
{
13
namespace
python
14
{
15
16
namespace
bp
=
boost::python
;
17
18
template
<
typename
LgType>
19
CartesianProductOperationVariantTpl<
20
context::Scalar
,
21
context::Options
,
22
LieGroupCollectionDefaultTpl>
23
makeLieGroup
()
24
{
25
return
CartesianProductOperationVariantTpl
<
26
context::Scalar
,
context::Options
,
LieGroupCollectionDefaultTpl
>(LgType());
27
}
28
29
CartesianProductOperationVariantTpl
<
30
context::Scalar
,
31
context::Options
,
32
LieGroupCollectionDefaultTpl
>
33
makeRn
(
int
n
)
34
{
35
return
CartesianProductOperationVariantTpl
<
36
context::Scalar
,
context::Options
,
LieGroupCollectionDefaultTpl
>(
37
VectorSpaceOperationTpl<Eigen::Dynamic, context::Scalar, context::Options>
(
n
));
38
}
39
40
/* --- Expose --------------------------------------------------------- */
41
void
exposeLieGroups
()
42
{
43
LieGroupPythonVisitor
<
CartesianProductOperationVariantTpl
<
44
context::Scalar
,
context::Options
,
LieGroupCollectionDefaultTpl
>>::expose(
"LieGroup"
);
45
46
{
47
// Switch the scope to the submodule, add methods and classes.
48
bp::scope submoduleScope =
getOrCreatePythonNamespace
(
"liegroups"
);
49
50
bp::def(
"R1"
,
makeLieGroup
<
VectorSpaceOperationTpl<1, context::Scalar, context::Options>
>);
51
bp::def(
"R2"
,
makeLieGroup
<
VectorSpaceOperationTpl<2, context::Scalar, context::Options>
>);
52
bp::def(
"R3"
,
makeLieGroup
<
VectorSpaceOperationTpl<3, context::Scalar, context::Options>
>);
53
bp::def(
"Rn"
,
makeRn
);
54
bp::def(
55
"SO2"
,
makeLieGroup
<
SpecialOrthogonalOperationTpl<2, context::Scalar, context::Options>
>);
56
bp::def(
57
"SO3"
,
makeLieGroup
<
SpecialOrthogonalOperationTpl<3, context::Scalar, context::Options>
>);
58
bp::def(
59
"SE2"
,
makeLieGroup
<
SpecialEuclideanOperationTpl<2, context::Scalar, context::Options>
>);
60
bp::def(
61
"SE3"
,
makeLieGroup
<
SpecialEuclideanOperationTpl<3, context::Scalar, context::Options>
>);
62
}
63
}
64
}
// namespace python
65
}
// namespace pinocchio
liegroups.hpp
pinocchio::SpecialEuclideanOperationTpl
Definition:
special-euclidean.hpp:25
boost::python
pinocchio::python::makeLieGroup
CartesianProductOperationVariantTpl< context::Scalar, context::Options, LieGroupCollectionDefaultTpl > makeLieGroup()
Definition:
expose-liegroups.cpp:23
pinocchio::LieGroupCollectionDefaultTpl
Definition:
liegroup-collection.hpp:18
pinocchio::CartesianProductOperationVariantTpl
Dynamic Cartesian product composed of elementary Lie groups defined in LieGroupVariant.
Definition:
cartesian-product-variant.hpp:20
pinocchio::python::makeRn
CartesianProductOperationVariantTpl< context::Scalar, context::Options, LieGroupCollectionDefaultTpl > makeRn(int n)
Definition:
expose-liegroups.cpp:33
pinocchio::python::getOrCreatePythonNamespace
boost::python::object getOrCreatePythonNamespace(const std::string &submodule_name)
Helper to create or simply return an existing namespace in Python.
Definition:
namespace.hpp:34
python
pinocchio::SpecialOrthogonalOperationTpl
Definition:
special-orthogonal.hpp:18
pinocchio::python::LieGroupPythonVisitor
Definition:
liegroups.hpp:195
pinocchio::python::context::Options
@ Options
Definition:
bindings/python/context/generic.hpp:40
pinocchio::python::exposeLieGroups
void exposeLieGroups()
Definition:
expose-liegroups.cpp:41
memory.hpp
fwd.hpp
pinocchio::VectorSpaceOperationTpl
Definition:
vector-space.hpp:16
pinocchio::python::context::Scalar
PINOCCHIO_PYTHON_SCALAR_TYPE Scalar
Definition:
bindings/python/context/generic.hpp:37
n
Vec3f n
pinocchio
Main pinocchio namespace.
Definition:
timings.cpp:27
namespace.hpp
pinocchio
Author(s):
autogenerated on Thu Dec 19 2024 03:41:29