Closed markusgft closed 5 years ago
Hi @markusgft. Good to see you here.
I think your bug is coming from the fact that you did not compile the code with the right flags.
Mainly, the definition of additional macro to use the correct of URDF pointers according to the version of urdfdom
.
You can get these flags through the line:
pkg-config --cflags pinocchio
Hope this answer will be helpful.
Dear @jcarpent, thanks a lot for your quick reply, I really appreciate it! Adding the definition URDFDOM_TYPEDEF_SHARED_PTR actually resolved the problem and the example now builds successfully. Thanks again!
@markusgft You're welcome. It was a pleasure!
Dear all, I installed the package-version of Pinocchio on a standard Ubuntu 16.04 alongside ROS kinetic. When trying to build code which uses pinocchio's URDF parser, I obtain the error shown below. I can confirm that this error occurs on multiple independent machines (tested on 3 Ubuntu installations). It seems that you already fixed it in the devel version by introducing a PINOCCHIO_ prefix, but is there any way to resolve this using the current packaged version, i.e. without re-building pinocchio devel from source? Thanks!
Errors << mg_pinocchio_test:make /home/catkin_ws/logs/mg_pinocchio_test/build.make.000.log
In file included from /opt/openrobots/include/pinocchio/parsers/urdf.hpp:25:0, from /home/catkin_ws/src/mg_pinocchio_test/src/pinocchio_test.cpp:11: /opt/openrobots/include/pinocchio/parsers/urdf/types.hpp:37:0: warning: "URDF_TYPEDEF_CLASS_POINTER" redefined
define URDF_TYPEDEF_CLASS_POINTER(Class) \
^ In file included from /usr/include/urdf_model/joint.h:44:0, from /usr/include/urdf_model/link.h:44, from /usr/include/urdf_model/model.h:42, from /opt/openrobots/include/pinocchio/parsers/urdf/types.hpp:21, from /opt/openrobots/include/pinocchio/parsers/urdf.hpp:25, from /home/catkin_ws/src/mg_pinocchio_test/src/pinocchio_test.cpp:11: /usr/include/urdf_model/types.h:44:0: note: this is the location of the previous definition
define URDF_TYPEDEF_CLASS_POINTER(Class) \
^ In file included from /opt/openrobots/include/pinocchio/parsers/urdf.hpp:25:0, from /home/catkin_ws/src/mg_pinocchio_test/src/pinocchio_test.cpp:11: /opt/openrobots/include/pinocchio/parsers/urdf/types.hpp:58:22: error: redefinition of ‘template<class T, class U> boost::shared_ptr urdf::const_pointer_cast(const boost::shared_ptr&)’
URDF_SHARED_PTR(T) const_pointer_cast(URDF_SHARED_PTR(U) const & r)
^
In file included from /usr/include/urdf_model/joint.h:44:0,
from /usr/include/urdf_model/link.h:44,
from /usr/include/urdf_model/model.h:42,
from /opt/openrobots/include/pinocchio/parsers/urdf/types.hpp:21,
from /opt/openrobots/include/pinocchio/parsers/urdf.hpp:25,
from /home/catkin_ws/src/mg_pinocchio_test/src/pinocchio_test.cpp:11:
/usr/include/urdf_model/types.h:74:22: note: ‘template<class T, class U> boost::shared_ptr urdf::const_pointer_cast(const boost::shared_ptr&)’ previously declared here
boost::shared_ptr const_pointer_cast(boost::shared_ptr const & r)
^
In file included from /opt/openrobots/include/pinocchio/parsers/urdf.hpp:25:0,
from /home/catkin_ws/src/mg_pinocchio_test/src/pinocchio_test.cpp:11:
/opt/openrobots/include/pinocchio/parsers/urdf/types.hpp:68:22: error: redefinition of ‘template<class T, class U> boost::shared_ptr urdf::dynamic_pointer_cast(const boost::shared_ptr&)’
URDF_SHARED_PTR(T) dynamic_pointer_cast(URDF_SHARED_PTR(U) const & r)
^
In file included from /usr/include/urdf_model/joint.h:44:0,
from /usr/include/urdf_model/link.h:44,
from /usr/include/urdf_model/model.h:42,
from /opt/openrobots/include/pinocchio/parsers/urdf/types.hpp:21,
from /opt/openrobots/include/pinocchio/parsers/urdf.hpp:25,
from /home/catkin_ws/src/mg_pinocchio_test/src/pinocchio_test.cpp:11:
/usr/include/urdf_model/types.h:80:22: note: ‘template<class T, class U> boost::shared_ptr urdf::dynamic_pointer_cast(const boost::shared_ptr&)’ previously declared here
boost::shared_ptr dynamic_pointer_cast(boost::shared_ptr const & r)
^
In file included from /opt/openrobots/include/pinocchio/parsers/urdf.hpp:25:0,
from /home/catkin_ws/src/mg_pinocchio_test/src/pinocchio_test.cpp:11:
/opt/openrobots/include/pinocchio/parsers/urdf/types.hpp:78:22: error: redefinition of ‘template<class T, class U> boost::shared_ptr urdf::static_pointer_cast(const boost::shared_ptr&)’
URDF_SHARED_PTR(T) static_pointer_cast(URDF_SHARED_PTR(U) const & r)
^
In file included from /usr/include/urdf_model/joint.h:44:0,
from /usr/include/urdf_model/link.h:44,
from /usr/include/urdf_model/model.h:42,
from /opt/openrobots/include/pinocchio/parsers/urdf/types.hpp:21,
from /opt/openrobots/include/pinocchio/parsers/urdf.hpp:25,
from /home/catkin_ws/src/mg_pinocchio_test/src/pinocchio_test.cpp:11:
/usr/include/urdf_model/types.h:86:22: note: ‘template<class T, class U> boost::shared_ptr urdf::static_pointer_cast(const boost::shared_ptr&)’ previously declared here
boost::shared_ptr static_pointer_cast(boost::shared_ptr const & r)
^
make[2]: [CMakeFiles/pinocchio_test.dir/src/pinocchio_test.cpp.o] Error 1
make[1]: [CMakeFiles/pinocchio_test.dir/all] Error 2
make: *** [all] Error 2
cd /home/catkin_ws/build/mg_pinocchio_test; catkin build --get-env mg_pinocchio_test | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j; cd -
And here is the original code: