Commit 7d7b8fad authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[Minor] Address PR comment

parent 6e6bbfb9
......@@ -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()
bp::scope current;
std::string submoduleName(bp::extract<const char*>(current.attr("__name__")));
// 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> >);
......@@ -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)
......@@ -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);
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):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment