Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
pinocchio
Commits
7d7b8fad
Commit
7d7b8fad
authored
Jun 17, 2020
by
Joseph Mirabel
Browse files
[Minor] Address PR comment
parent
6e6bbfb9
Changes
4
Hide whitespace changes
Inline
Side-by-side
bindings/python/multibody/expose-liegroups.cpp
View file @
7d7b8fad
...
...
@@ -4,6 +4,7 @@
#include
"pinocchio/bindings/python/fwd.hpp"
#include
"pinocchio/bindings/python/multibody/liegroups.hpp"
#include
"pinocchio/bindings/python/utils/namespace.hpp"
#include
<eigenpy/memory.hpp>
...
...
@@ -36,17 +37,9 @@ void exposeLieGroups()
CartesianProductOperationVariantTpl
<
double
,
0
,
LieGroupCollectionDefaultTpl
>
>::
expose
(
"LieGroup"
);
bp
::
scope
current
;
std
::
string
submoduleName
(
bp
::
extract
<
const
char
*>
(
current
.
attr
(
"__name__"
)));
submoduleName
.
append
(
".liegroups"
);
// Create the submodule, and attach it to the current scope.
bp
::
object
submodule
(
bp
::
borrowed
(
PyImport_AddModule
(
submoduleName
.
c_str
())));
current
.
attr
(
"liegroups"
)
=
submodule
;
{
// Switch the scope to the submodule, add methods and classes.
bp
::
scope
submoduleScope
=
submodule
;
bp
::
scope
submoduleScope
=
getOrCreatePythonNamespace
(
"liegroups"
)
;
bp
::
def
(
"R1"
,
makeLieGroup
<
VectorSpaceOperationTpl
<
1
,
double
,
0
>
>
);
bp
::
def
(
"R2"
,
makeLieGroup
<
VectorSpaceOperationTpl
<
2
,
double
,
0
>
>
);
...
...
src/multibody/liegroup/cartesian-product-variant.hpp
View file @
7d7b8fad
...
...
@@ -53,7 +53,7 @@ namespace pinocchio
///
/// \param[in] lg Lie group variant to insert inside the Cartesian product
///
CartesianProductOperationVariantTpl
(
const
LieGroupGeneric
&
lg
)
explicit
CartesianProductOperationVariantTpl
(
const
LieGroupGeneric
&
lg
)
:
m_nq
(
0
),
m_nv
(
0
)
,
lg_nqs
(
0
),
lg_nvs
(
0
)
,
m_neutral
(
0
)
...
...
src/multibody/liegroup/liegroup-variant-visitors.hxx
View file @
7d7b8fad
...
...
@@ -452,7 +452,7 @@ namespace pinocchio
const
ArgumentPosition
arg
,
const
AssignmentOperatorType
op
)
{
assert
(
(
arg
==
ARG0
||
arg
==
ARG1
)
&&
"arg should be either ARG0 or ARG1"
);
PINOCCHIO_CHECK_INPUT_ARGUMENT
(
arg
==
ARG0
||
arg
==
ARG1
,
"arg should be either ARG0 or ARG1"
);
switch
(
arg
)
{
case
ARG0
:
if
(
dIntegrateOnTheLeft
)
lg
.
dIntegrate_dq
(
q
,
v
,
SELF
,
J_in
,
J_out
,
op
);
...
...
unittest/python/bindings_liegroups.py
View file @
7d7b8fad
import
unittest
import
pinocchio
as
pin
import
numpy
as
np
from
pinocchio.utils
import
eye
,
zero
,
rand
ones
=
lambda
n
:
np
.
ones
([
n
,
1
]
if
isinstance
(
n
,
int
)
else
n
)
class
TestLiegroupBindings
(
unittest
.
TestCase
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment