Closed fabinsch closed 4 months ago
The problem of calling the Python bindings of contactInverseDynamics
with a list of RigidConstraintData
objects described above is fixed with https://github.com/stack-of-tasks/pinocchio/pull/2263/commits/5dc80d65e714890bc6c78ea52d54c844cf90532a.
The problem of calling the Python bindings of
contactInverseDynamics
with a list ofRigidConstraintData
objects described above is fixed with 5dc80d6.
I wasn't aware this list.hpp header even existed. I don't even know if it's actually useful.
This is a super-subtle bug, great investigation job @fabinsch !
I don't even know if it's actually useful.
I checked and we use it here in bindings/python/parsers/urdf/geometry.cpp
. However, I am not sure why we also include it in expose-model.cpp
and expose-rnea.cpp
. This should probably be removed there.
I don't even know if it's actually useful.
I checked and we use it here in
bindings/python/parsers/urdf/geometry.cpp
. However, I am not sure why we also include it inexpose-model.cpp
andexpose-rnea.cpp
. This should probably be removed there.
We use in rnea because of fext
arg, we might be a list.
yes, you are right that the external forces can be passed as a list from python to the rnea
bindings.
I checked why our unittest for this case is still working (see CI) without the list.hpp
header in expose-rnea
. The reason is, that the StdAlignedVectorPythonVisitor
for Force
, called here to expose StdVec_Force
, implements a FromPythonListConverter
here. I also verified this on my machine with a quick test.
In a similar way to the cpp test for the
contactInverseDynamics
function, I propose to add a python test and check if this function is usable from Python.the c++ function requires for the contact models, data and cones
and this works well when constructing them as
StdVec_RigidConstraintData()
and then appending contact data here (see test1). However, if you try to pass a list of contact data, it does not work (see test3). This is not the case for contact models and cones, they work both as list of model/cones and aspin.StdVec
(see test2).The different is, that models/cones are
const std::vectors
while data is not const.