Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with ROS melodic #23

Closed
mehditlili opened this issue Nov 20, 2019 · 3 comments
Closed

Compatibility with ROS melodic #23

mehditlili opened this issue Nov 20, 2019 · 3 comments

Comments

@mehditlili
Copy link
Contributor

mehditlili commented Nov 20, 2019

Currently this package does not compile with ROS melodic on Ubuntu 18.04
The first issue was in CMakeLists.txt ${catkin_INCLUDE_DIR} shoud be ${catkin_INCLUDE_DIRS} with an S at the end.
Also the include folder from the package itselt has to be manually included.
eg.
include_directories(include ${catkin_INCLUDE_DIRS})

Then some nodes compile but it fails at urdf_renderer

[ 42%] Building CXX object CMakeFiles/urdf_filter.dir/src/urdf_renderer.cpp.o
/home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp: In member function ‘void realtime_urdf_filter::URDFRenderer::loadURDFModel(urdf::Model&)’:
/home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:83:25: error: no matching function for call to ‘urdf::Model::getLinks(V_Link&)’
model.getLinks(links);
^
In file included from /opt/ros/melodic/include/urdf/model.h:42:0,
from /home/tlili/catkin_ws/src/realtime_urdf_filter/include/realtime_urdf_filter/urdf_renderer.h:34,
from /home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:40:
/usr/include/urdf_model/model.h:74:8: note: candidate: void urdf::ModelInterface::getLinks(std::vector<std::shared_ptrurdf::Link >&) const
void getLinks(std::vector& links) const
^~~~~~~~
/usr/include/urdf_model/model.h:74:8: note: no known conversion for argument 1 from ‘V_Link {aka std::vector<boost::shared_ptrurdf::Link >}’ to ‘std::vector<std::shared_ptrurdf::Link >&’
/home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp: In member function ‘void realtime_urdf_filter::URDFRenderer::process_link(boost::shared_ptrurdf::Link)’:
/home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:102:104: error: no matching function for call to ‘dynamic_pointer_casturdf::Box(urdf::GeometrySharedPtr&)’
boost::shared_ptrurdf::Box box = boost::dynamic_pointer_casturdf::Box (link->visual->geometry);
^
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
from /opt/ros/melodic/include/ros/forwards.h:37,
from /opt/ros/melodic/include/ros/node_handle.h:31,
from /home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:38:
/usr/include/boost/smart_ptr/shared_ptr.hpp:898:42: note: candidate: template<class T, class U> boost::shared_ptr boost::dynamic_pointer_cast(const boost::shared_ptr&)
template<class T, class U> shared_ptr dynamic_pointer_cast( shared_ptr const & r ) BOOST_SP_NOEXCEPT
^~~~~~~~~~~~~~~~~~~~
/usr/include/boost/smart_ptr/shared_ptr.hpp:898:42: note: template argument deduction/substitution failed:
/home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:102:104: note: ‘urdf::GeometrySharedPtr {aka std::shared_ptrurdf::Geometry}’ is not derived from ‘const boost::shared_ptr’
boost::shared_ptrurdf::Box box = boost::dynamic_pointer_casturdf::Box (link->visual->geometry);
^
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
from /opt/ros/melodic/include/ros/forwards.h:37,
from /opt/ros/melodic/include/ros/node_handle.h:31,
from /home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:38:
/usr/include/boost/smart_ptr/shared_ptr.hpp:940:42: note: candidate: template<class T, class U> boost::shared_ptr boost::dynamic_pointer_cast(boost::shared_ptr&&)
template<class T, class U> shared_ptr dynamic_pointer_cast( shared_ptr && r ) BOOST_SP_NOEXCEPT
^~~~~~~~~~~~~~~~~~~~
/usr/include/boost/smart_ptr/shared_ptr.hpp:940:42: note: template argument deduction/substitution failed:
/home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:102:104: note: ‘urdf::GeometrySharedPtr {aka std::shared_ptrurdf::Geometry}’ is not derived from ‘boost::shared_ptr’
boost::shared_ptrurdf::Box box = boost::dynamic_pointer_casturdf::Box (link->visual->geometry);
^
/home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:107:119: error: no matching function for call to ‘dynamic_pointer_casturdf::Cylinder(urdf::GeometrySharedPtr&)’
boost::shared_ptrurdf::Cylinder cylinder = boost::dynamic_pointer_casturdf::Cylinder (link->visual->geometry);
^
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
from /opt/ros/melodic/include/ros/forwards.h:37,
from /opt/ros/melodic/include/ros/node_handle.h:31,
from /home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:38:
/usr/include/boost/smart_ptr/shared_ptr.hpp:898:42: note: candidate: template<class T, class U> boost::shared_ptr boost::dynamic_pointer_cast(const boost::shared_ptr&)
template<class T, class U> shared_ptr dynamic_pointer_cast( shared_ptr const & r ) BOOST_SP_NOEXCEPT
^~~~~~~~~~~~~~~~~~~~
/usr/include/boost/smart_ptr/shared_ptr.hpp:898:42: note: template argument deduction/substitution failed:
/home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:107:119: note: ‘urdf::GeometrySharedPtr {aka std::shared_ptrurdf::Geometry}’ is not derived from ‘const boost::shared_ptr’
boost::shared_ptrurdf::Cylinder cylinder = boost::dynamic_pointer_casturdf::Cylinder (link->visual->geometry);
^
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
from /opt/ros/melodic/include/ros/forwards.h:37,
from /opt/ros/melodic/include/ros/node_handle.h:31,
from /home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:38:
/usr/include/boost/smart_ptr/shared_ptr.hpp:940:42: note: candidate: template<class T, class U> boost::shared_ptr boost::dynamic_pointer_cast(boost::shared_ptr&&)
template<class T, class U> shared_ptr dynamic_pointer_cast( shared_ptr && r ) BOOST_SP_NOEXCEPT
^~~~~~~~~~~~~~~~~~~~
/usr/include/boost/smart_ptr/shared_ptr.hpp:940:42: note: template argument deduction/substitution failed:
/home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:107:119: note: ‘urdf::GeometrySharedPtr {aka std::shared_ptrurdf::Geometry}’ is not derived from ‘boost::shared_ptr’
boost::shared_ptrurdf::Cylinder cylinder = boost::dynamic_pointer_casturdf::Cylinder (link->visual->geometry);
^
/home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:112:113: error: no matching function for call to ‘dynamic_pointer_casturdf::Sphere(urdf::GeometrySharedPtr&)’
boost::shared_ptrurdf::Sphere sphere = boost::dynamic_pointer_casturdf::Sphere (link->visual->geometry);
^
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
from /opt/ros/melodic/include/ros/forwards.h:37,
from /opt/ros/melodic/include/ros/node_handle.h:31,
from /home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:38:
/usr/include/boost/smart_ptr/shared_ptr.hpp:898:42: note: candidate: template<class T, class U> boost::shared_ptr boost::dynamic_pointer_cast(const boost::shared_ptr&)
template<class T, class U> shared_ptr dynamic_pointer_cast( shared_ptr const & r ) BOOST_SP_NOEXCEPT
^~~~~~~~~~~~~~~~~~~~
/usr/include/boost/smart_ptr/shared_ptr.hpp:898:42: note: template argument deduction/substitution failed:
/home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:112:113: note: ‘urdf::GeometrySharedPtr {aka std::shared_ptrurdf::Geometry}’ is not derived from ‘const boost::shared_ptr’
boost::shared_ptrurdf::Sphere sphere = boost::dynamic_pointer_casturdf::Sphere (link->visual->geometry);
^
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
from /opt/ros/melodic/include/ros/forwards.h:37,
from /opt/ros/melodic/include/ros/node_handle.h:31,
from /home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:38:
/usr/include/boost/smart_ptr/shared_ptr.hpp:940:42: note: candidate: template<class T, class U> boost::shared_ptr boost::dynamic_pointer_cast(boost::shared_ptr&&)
template<class T, class U> shared_ptr dynamic_pointer_cast( shared_ptr && r ) BOOST_SP_NOEXCEPT
^~~~~~~~~~~~~~~~~~~~
/usr/include/boost/smart_ptr/shared_ptr.hpp:940:42: note: template argument deduction/substitution failed:
/home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:112:113: note: ‘urdf::GeometrySharedPtr {aka std::shared_ptrurdf::Geometry}’ is not derived from ‘boost::shared_ptr’
boost::shared_ptrurdf::Sphere sphere = boost::dynamic_pointer_casturdf::Sphere (link->visual->geometry);
^
/home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:117:107: error: no matching function for call to ‘dynamic_pointer_casturdf::Mesh(urdf::GeometrySharedPtr&)’
boost::shared_ptrurdf::Mesh mesh = boost::dynamic_pointer_casturdf::Mesh (link->visual->geometry);
^
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
from /opt/ros/melodic/include/ros/forwards.h:37,
from /opt/ros/melodic/include/ros/node_handle.h:31,
from /home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:38:
/usr/include/boost/smart_ptr/shared_ptr.hpp:898:42: note: candidate: template<class T, class U> boost::shared_ptr boost::dynamic_pointer_cast(const boost::shared_ptr&)
template<class T, class U> shared_ptr dynamic_pointer_cast( shared_ptr const & r ) BOOST_SP_NOEXCEPT
^~~~~~~~~~~~~~~~~~~~
/usr/include/boost/smart_ptr/shared_ptr.hpp:898:42: note: template argument deduction/substitution failed:
/home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:117:107: note: ‘urdf::GeometrySharedPtr {aka std::shared_ptrurdf::Geometry}’ is not derived from ‘const boost::shared_ptr’
boost::shared_ptrurdf::Mesh mesh = boost::dynamic_pointer_casturdf::Mesh (link->visual->geometry);
^
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
from /opt/ros/melodic/include/ros/forwards.h:37,
from /opt/ros/melodic/include/ros/node_handle.h:31,
from /home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:38:
/usr/include/boost/smart_ptr/shared_ptr.hpp:940:42: note: candidate: template<class T, class U> boost::shared_ptr boost::dynamic_pointer_cast(boost::shared_ptr&&)
template<class T, class U> shared_ptr dynamic_pointer_cast( shared_ptr && r ) BOOST_SP_NOEXCEPT
^~~~~~~~~~~~~~~~~~~~
/usr/include/boost/smart_ptr/shared_ptr.hpp:940:42: note: template argument deduction/substitution failed:
/home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:117:107: note: ‘urdf::GeometrySharedPtr {aka std::shared_ptrurdf::Geometry}’ is not derived from ‘boost::shared_ptr’
boost::shared_ptrurdf::Mesh mesh = boost::dynamic_pointer_casturdf::Mesh (link->visual->geometry);
^
CMakeFiles/urdf_filter.dir/build.make:75: recipe for target 'CMakeFiles/urdf_filter.dir/src/urdf_renderer.cpp.o' failed
make[2]: *** [CMakeFiles/urdf_filter.dir/src/urdf_renderer.cpp.o] Error 1
CMakeFiles/Makefile2:112: recipe for target 'CMakeFiles/urdf_filter.dir/all' failed
make[1]: *** [CMakeFiles/urdf_filter.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

Any idea on what has to change?

@JimmyDaSilva
Copy link
Contributor

JimmyDaSilva commented Nov 20, 2019

Sorry I don't have time for this now.
But it seems @kingjin94 has been forking this package and correcting the issues.

The main issue here is moving from boost to std I think. Which is really a problem of moving from kinetic to melodic.
Check his correction here:
kingjin94@5b2e976

Please once you have something working on melodic, make a pull request and share your improvements with the community.

Cheers !

@mehditlili
Copy link
Contributor Author

Hi Jimmy, thanks for the fast response. I did some changes and got it to compile on Ubuntu 18.04 with ROS melodic. As you said it was basically the transition from boost to std along with an adaptation in the nodelet API (same as here)
Also, there was some error from urdf_model side where ParseError was not defined. Defining ParseError as an alias to std::runtime_error is a hack that fixes it.

I will check if the code works as it is supposed to and create a PR.

@mehditlili
Copy link
Contributor Author

mehditlili commented Nov 21, 2019

Fixed on #27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants