Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
x
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
f
g
i
j
l
m
n
p
q
r
s
t
u
v
x
y
z
Enumerations
Enumerator
a
b
c
e
f
g
j
l
m
o
p
r
s
u
v
w
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
p
q
r
s
t
u
v
z
Enumerations
Enumerator
a
b
c
d
f
i
l
m
n
o
r
s
u
v
Related Functions
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Functions
a
b
c
d
e
f
g
i
j
l
m
n
o
p
q
r
s
t
u
w
Variables
a
b
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
u
v
Typedefs
a
c
d
g
j
m
p
r
s
t
v
Enumerator
Macros
_
a
b
d
e
f
h
i
j
k
m
o
p
q
r
s
v
Examples
unittest
casadi
casadi-utils.hpp
Go to the documentation of this file.
1
//
2
// Copyright (c) 2021 Inria
3
//
4
// Utils for tests, e.g. conversion between Eigen matrix
5
// and DM without copy.
6
#include "
pinocchio/autodiff/casadi.hpp
"
7
#include "
pinocchio/autodiff/casadi-algo.hpp
"
8
10
template
<
typename
Derived>
11
casadi::DM
eigenToDM
(
const
Eigen::MatrixBase<Derived> & x)
12
{
13
typedef
Eigen::Map<Derived> Map_t;
14
std::vector<double> x_vec((
size_t
)
x
.size());
15
Map_t(x_vec.data(),
x
.rows(),
x
.cols()) =
x
;
16
casadi::DM out(x_vec);
17
return
reshape(out,
x
.rows(),
x
.cols());
18
}
19
20
template
<
typename
Derived>
21
casadi::DM
SE3toCasadiDM
(
const
pinocchio::SE3Base<Derived>
& M)
22
{
23
typedef
pinocchio::SE3Base<Derived>
SE3
;
24
typedef
typename
Derived::Scalar
Scalar
;
25
typename
SE3::HomogeneousMatrixType M_mat =
M
.toHomogeneousMatrix();
26
std::vector<Scalar> flat_M_vec(M_mat.data(), M_mat.data() + M_mat.size());
27
casadi::DM out{flat_M_vec};
28
return
reshape(out, 4, 4);
29
}
casadi-algo.hpp
x
x
M
M
pinocchio::SE3Base
Base class for rigid transformation.
Definition:
se3-base.hpp:30
casadi.hpp
pinocchio::python::context::SE3
SE3Tpl< Scalar, Options > SE3
Definition:
bindings/python/context/generic.hpp:53
Scalar
double Scalar
Definition:
timings-cppad-jit.cpp:37
SE3toCasadiDM
casadi::DM SE3toCasadiDM(const pinocchio::SE3Base< Derived > &M)
Definition:
casadi-utils.hpp:21
eigenToDM
casadi::DM eigenToDM(const Eigen::MatrixBase< Derived > &x)
Without copy.
Definition:
casadi-utils.hpp:11
pinocchio
Author(s):
autogenerated on Thu Apr 10 2025 02:42:15