blodow / realtime_urdf_filter

ROS package that can filter geometry defined in URDF models from Kinect depth images. Can also preprocess data for the OpenNI tracker, to remove backgrounds, robots etc.
Other
89 stars 46 forks source link

Compatibility with ROS melodic #23

Closed mehditlili closed 4 years ago

mehditlili commented 4 years ago

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_ptr >&) 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_ptr >}’ to ‘std::vector<std::shared_ptr >&’ /home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp: In member function ‘void realtime_urdf_filter::URDFRenderer::process_link(boost::shared_ptr)’: /home/tlili/catkin_ws/src/realtime_urdf_filter/src/urdf_renderer.cpp:102:104: error: no matching function for call to ‘dynamic_pointer_cast(urdf::GeometrySharedPtr&)’ boost::shared_ptr box = boost::dynamic_pointer_cast (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_ptr}’ is not derived from ‘const boost::shared_ptr’ boost::shared_ptr box = boost::dynamic_pointer_cast (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_ptr}’ is not derived from ‘boost::shared_ptr’ boost::shared_ptr box = boost::dynamic_pointer_cast (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_cast(urdf::GeometrySharedPtr&)’ boost::shared_ptr cylinder = boost::dynamic_pointer_cast (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_ptr}’ is not derived from ‘const boost::shared_ptr’ boost::shared_ptr cylinder = boost::dynamic_pointer_cast (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_ptr}’ is not derived from ‘boost::shared_ptr’ boost::shared_ptr cylinder = boost::dynamic_pointer_cast (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_cast(urdf::GeometrySharedPtr&)’ boost::shared_ptr sphere = boost::dynamic_pointer_cast (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_ptr}’ is not derived from ‘const boost::shared_ptr’ boost::shared_ptr sphere = boost::dynamic_pointer_cast (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_ptr}’ is not derived from ‘boost::shared_ptr’ boost::shared_ptr sphere = boost::dynamic_pointer_cast (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_cast(urdf::GeometrySharedPtr&)’ boost::shared_ptr mesh = boost::dynamic_pointer_cast (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_ptr}’ is not derived from ‘const boost::shared_ptr’ boost::shared_ptr mesh = boost::dynamic_pointer_cast (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_ptr}’ is not derived from ‘boost::shared_ptr’ boost::shared_ptr mesh = boost::dynamic_pointer_cast (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 commented 4 years ago

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: https://github.com/kingjin94/realtime_urdf_filter/commit/5b2e976c0c1712a29744cd8ea5718476f1833a2d

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

Cheers !

mehditlili commented 4 years ago

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.