Closed olivier-roussel closed 5 years ago
They aren't compatible because the JointCollectionTpl is different. You must use the hpp::pinocchio::Data typedef.
You mean replacing:
pinocchio::Data data(robot->model());
by
hpp::pinocchio::Data data(robot->model());
?
Yes.
Same type as the device->data()̀
returns.
Already tried. Got this output:
n file included from [...]/profiles/hpp_ros_kinetic-x64-ubuntu16/install/include/pinocchio/multibody/model.hpp:17:0,
from [...]/profiles/hpp_ros_kinetic-x64-ubuntu16/src/sandbox_arm_plan/src/glviewer_objects/graphical_robot.hpp:16,
from [...]/profiles/hpp_ros_kinetic-x64-ubuntu16/src/sandbox_arm_plan/src/controller.hpp:8,
from [...]/profiles/hpp_ros_kinetic-x64-ubuntu16/src/sandbox_arm_plan/src/viewer.hpp:19,
from [...]/profiles/hpp_ros_kinetic-x64-ubuntu16/src/sandbox_arm_plan/src/main.cpp:1:
[...]/profiles/hpp_ros_kinetic-x64-ubuntu16/install/include/pinocchio/multibody/joint/joint-generic.hpp: In instantiation of ‘struct pinocchio::JointDataTpl<double, 0, hpp::pinocchio::JointCollectionTpl>’:
[...]/profiles/hpp_ros_kinetic-x64-ubuntu16/install/include/pinocchio/multibody/data.hxx:92:42: required from ‘pinocchio::DataTpl<Scalar, Options, JointCollectionTpl>::DataTpl(const Model&) [with _Scalar = double; int _Options = 0; JointCollectionTpl = hpp::pinocchio::JointCollectionTpl; pinocchio::DataTpl<Scalar, Options, JointCollectionTpl>::Model = pinocchio::ModelTpl<double, 0, hpp::pinocchio::JointCollectionTpl>]’
[...]/profiles/hpp_ros_kinetic-x64-ubuntu16/src/sandbox_arm_plan/src/main.cpp:51:43: required from here
[...]/profiles/hpp_ros_kinetic-x64-ubuntu16/install/include/pinocchio/multibody/joint/joint-generic.hpp:69:10: error: invalid use of incomplete type ‘struct hpp::pinocchio::JointCollectionTpl<double, 0>’
struct JointDataTpl
^
In file included from [...]/profiles/hpp_ros_kinetic-x64-ubuntu16/src/sandbox_arm_plan/src/glviewer_objects/graphical_robot.hpp:15:0,
from [...]/profiles/hpp_ros_kinetic-x64-ubuntu16/src/sandbox_arm_plan/src/controller.hpp:8,
from [...]/profiles/hpp_ros_kinetic-x64-ubuntu16/src/sandbox_arm_plan/src/viewer.hpp:19,
from [...]/profiles/hpp_ros_kinetic-x64-ubuntu16/src/sandbox_arm_plan/src/main.cpp:1:
[...]/profiles/hpp_ros_kinetic-x64-ubuntu16/install/include/hpp/pinocchio/fwd.hh:55:54: note: declaration of ‘struct hpp::pinocchio::JointCollectionTpl<double, 0>’
template <typename _Scalar, int _Options> struct JointCollectionTpl;
^
In file included from [...]/profiles/hpp_ros_kinetic-x64-ubuntu16/install/include/pinocchio/multibody/model.hpp:17:0,
from [...]/profiles/hpp_ros_kinetic-x64-ubuntu16/src/sandbox_arm_plan/src/glviewer_objects/graphical_robot.hpp:16,
from [...]/profiles/hpp_ros_kinetic-x64-ubuntu16/src/sandbox_arm_plan/src/controller.hpp:8,
from [...]/profiles/hpp_ros_kinetic-x64-ubuntu16/src/sandbox_arm_plan/src/viewer.hpp:19,
from [...]/profiles/hpp_ros_kinetic-x64-ubuntu16/src/sandbox_arm_plan/src/main.cpp:1:
[...]/profiles/hpp_ros_kinetic-x64-ubuntu16/install/include/pinocchio/multibody/joint/joint-generic.hpp:81:56: error: invalid use of incomplete type ‘pinocchio::JointDataTpl<double, 0, hpp::pinocchio::JointCollectionTpl>::JointCollection {aka struct hpp::pinocchio::JointCollectionTpl<double, 0>}’
typedef typename JointCollection::JointDataVariant JointDataVariant;
^
In file included from [...]/profiles/hpp_ros_kinetic-x64-ubuntu16/src/sandbox_arm_plan/src/glviewer_objects/graphical_robot.hpp:15:0,
from [...]/profiles/hpp_ros_kinetic-x64-ubuntu16/src/sandbox_arm_plan/src/controller.hpp:8,
from [...]/profiles/hpp_ros_kinetic-x64-ubuntu16/src/sandbox_arm_plan/src/viewer.hpp:19,
from [...]/profiles/hpp_ros_kinetic-x64-ubuntu16/src/sandbox_arm_plan/src/main.cpp:1:
[...]/profiles/hpp_ros_kinetic-x64-ubuntu16/install/include/hpp/pinocchio/fwd.hh:55:54: note: declaration of ‘pinocchio::JointDataTpl<double, 0, hpp::pinocchio::JointCollectionTpl>::JointCollection {aka struct hpp::pinocchio::JointCollectionTpl<double, 0>}’
template <typename _Scalar, int _Options> struct JointCollectionTpl;
Add this:
#include <hpp/pinocchio/joint-collection.hh>
I admit that it isn't easy to find the fix given the error message...
Yes, templates...
The missing header #include <hpp/pinocchio/joint-collection.hh>
was guilty. Thanks. Wouldn't it be better to hide this to the user ? Looks like more an implementation detail rather than an API change.
I think I didn't do it in order to reduce header dependencies and make re-compilation time shorter.
This header includes many stuff from Pinocchio. Pinocchio being a header only library, a single change in it would trigger a recompilation of almost the whole HPP. But that's only for developers convenience.
Ok, I guess this makes sense with respect to the expected audience of the software. Thanks again for the quick fix.
While updating hpp-pinocchio from v4.2.0 to v4.4.0 and pinocchio v1.3.1 to v2.1.0, the following minimalist example does not compile anymore:
From the output, it seems that could not cast hpp::pinocchio::Model to pinocchio::Model anymore, but may be I am missing something:
I am using pinocchio v2.1.0 (commit db8fe0ad ) and hpp-pinocchio v4.4.0 (commit d9cc0294 ), same commits than the one used in last hpp_benchmark ( https://github.com/humanoid-path-planner/hpp_benchmark/blob/master/2019-03-13/commit )