bindings
python
pinocchio
bindings/python/pinocchio/explog.py
Go to the documentation of this file.
1
#
2
# Copyright (c) 2015-2018 CNRS INRIA
3
# Copyright (c) 2015 Wandercraft, 86 rue de Paris 91400 Orsay, France.
4
#
5
6
import
math
7
8
import
numpy
as
np
9
10
from
.
import
pinocchio_pywrap_default
as
pin
11
12
13
def
exp
(x):
14
if
isinstance(x,
pin.Motion
):
15
return
pin.exp6
(x)
16
if
np.isscalar(x):
17
return
math.exp(x)
18
if
isinstance(x, np.ndarray):
19
if
x.shape == (6, 1)
or
x.shape == (6,):
20
return
pin.exp6
(
pin.Motion
(x))
21
if
x.shape == (3, 1)
or
x.shape == (3,):
22
return
pin.exp3
(x)
23
raise
ValueError(
"Error only 3 and 6 vectors are allowed."
)
24
raise
ValueError(
25
"Error exp is only defined for real, vector3, vector6 and pin.Motion objects."
26
)
27
28
29
def
log
(x):
30
if
isinstance(x, pin.SE3):
31
return
pin.log6
(x)
32
if
np.isscalar(x):
33
return
math.log(x)
34
if
isinstance(x, np.ndarray):
35
if
x.shape == (4, 4):
36
return
pin.log6
(x)
37
if
x.shape == (3, 3):
38
return
pin.log3
(x)
39
raise
ValueError(
"Error only 3 and 4 matrices are allowed."
)
40
raise
ValueError(
41
"Error log is only defined for real, matrix3, matrix4 and pin.SE3 objects."
42
)
43
44
45
__all__ = [
"exp"
,
"log"
]
pinocchio.explog.exp
def exp(x)
Definition:
bindings/python/pinocchio/explog.py:13
pinocchio::exp6
SE3Tpl< typename Vector6Like::Scalar, PINOCCHIO_EIGEN_PLAIN_TYPE(Vector6Like)::Options > exp6(const Eigen::MatrixBase< Vector6Like > &v)
Exp: se3 -> SE3.
Definition:
spatial/explog.hpp:417
pinocchio::exp3
Eigen::Matrix< typename Vector3Like::Scalar, 3, 3, PINOCCHIO_EIGEN_PLAIN_TYPE(Vector3Like)::Options > exp3(const Eigen::MatrixBase< Vector3Like > &v)
Exp: so3 -> SO3.
Definition:
spatial/explog.hpp:36
pinocchio::log3
Eigen::Matrix< typename Matrix3Like::Scalar, 3, 1, PINOCCHIO_EIGEN_PLAIN_TYPE(Matrix3Like)::Options > log3(const Eigen::MatrixBase< Matrix3Like > &R)
Log: SO(3)-> so(3).
Definition:
spatial/explog.hpp:103
pinocchio.explog.log
def log(x)
Definition:
bindings/python/pinocchio/explog.py:29
pinocchio::MotionTpl
Definition:
context/casadi.hpp:22
pinocchio::log6
MotionTpl< typename Matrix4Like::Scalar, Eigen::internal::traits< Matrix4Like >::Options > log6(const Eigen::MatrixBase< Matrix4Like > &M)
Log: SE3 -> se3.
Definition:
spatial/explog.hpp:475
pinocchio
Author(s):
autogenerated on Wed May 28 2025 02:41:18