pinocchio
4.1.0
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
Toggle main menu visibility
Loading...
Searching...
No Matches
joint-model.hpp
1
//
2
// Copyright (c) 2015-2022 CNRS INRIA
3
//
4
5
#pragma once
6
7
#include "pinocchio/multibody/joint.hpp"
8
#include "pinocchio/bindings/python/multibody/joint/joint-derived.hpp"
9
#include "pinocchio/bindings/python/multibody/joint/joints-liegroup.hpp"
10
#include "pinocchio/bindings/python/utils/printable.hpp"
11
12
namespace
pinocchio
13
{
14
namespace
python
15
{
16
namespace
bp = boost::python;
17
18
template
<
typename
Jo
int
Model>
19
struct
ExtractJointModelVariantTypeVisitor
20
{
21
typedef
typename
JointModel::JointCollection JointCollection;
22
typedef
bp::object result_type;
23
24
template
<
typename
Jo
int
ModelDerived>
25
result_type operator()(
const
JointModelBase<JointModelDerived> & jmodel)
const
26
{
27
bp::object obj(boost::ref(jmodel.derived()));
28
return
obj;
29
}
30
31
static
result_type extract(
const
JointModel & jmodel)
32
{
33
return
boost::apply_visitor(
ExtractJointModelVariantTypeVisitor
(), jmodel);
34
}
35
};
36
37
template
<
typename
Jo
int
Model>
38
struct
JointModelPythonVisitor
39
{
40
41
static
void
expose()
42
{
43
bp::class_<JointModel>(
"JointModel"
,
"Generic Joint Model"
, bp::no_init)
44
.def(bp::init<>(bp::arg(
"self"
),
"Default constructor"
))
45
.def(bp::init<const JointModel &>(bp::args(
"self"
,
"other"
),
"Copy constructor"
))
46
.def(
JointModelBasePythonVisitor<JointModel>
())
47
.def(
PrintableVisitor<JointModel>
())
48
.def(
JointModelLieGroupPythonVisitor<JointModel>
())
49
.def(
50
"extract"
, ExtractJointModelVariantTypeVisitor<JointModel>::extract, bp::arg(
"self"
),
51
"Returns a reference of the internal joint managed by the JointModel"
,
52
bp::with_custodian_and_ward_postcall<0, 1>());
53
}
54
};
55
56
}
// namespace python
57
}
// namespace pinocchio
pinocchio
Main pinocchio namespace.
Definition
treeview.dox:11
pinocchio::python::ExtractJointModelVariantTypeVisitor
Definition
joint-model.hpp:20
pinocchio::python::JointModelBasePythonVisitor
Definition
joint-derived.hpp:22
pinocchio::python::JointModelLieGroupPythonVisitor
Definition
joints-liegroup.hpp:22
pinocchio::python::JointModelPythonVisitor
Definition
joint-model.hpp:39
pinocchio::python::PrintableVisitor
Set the Python method str and repr to use the overloading operator<<.
Definition
printable.hpp:21
include
pinocchio
bindings
python
multibody
joint
joint-model.hpp
Generated by
1.17.0