iKrishneel / octomap_server2

ROS2 stack for mapping with OctoMap, contains octomap_server package
85 stars 33 forks source link

Unable to build octomap_server2 #16

Open PenghuySrean opened 1 year ago

PenghuySrean commented 1 year ago

I got this error, while trying to build octomap_sever2, Any solution please let me know. I am using forxy on ubuntu 20.04 and so the pcl version is 1.10, but I saw on cmakelist that pcl 1.7 is required. below is the error I have got

Starting >>> octomap_server2
[0.491s] WARNING:colcon.colcon_core.shell:The following packages are in the workspace but haven't been built:
- pcl_msgs
- pcl_conversions
They are being used from the following locations instead:
- /opt/ros/foxy
- /opt/ros/foxy
To suppress this warning ignore these packages in the workspace:
--packages-ignore pcl_msgs pcl_conversions
--- stderr: octomap_server2
In file included from /home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp:2:
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/include/octomap_server2/octomap_server.hpp: In member function ‘virtual void octomap_server::OctomapServer::handleNode(const iterator&)’:
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/include/octomap_server2/octomap_server.hpp:210:58: warning: unused parameter ‘it’ [-Wunused-parameter]
  210 |         virtual void handleNode(const OcTreeT::iterator& it) {};
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/include/octomap_server2/octomap_server.hpp: In member function ‘virtual void octomap_server::OctomapServer::handleNodeInBBX(const iterator&)’:
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/include/octomap_server2/octomap_server.hpp:211:63: warning: unused parameter ‘it’ [-Wunused-parameter]
  211 |         virtual void handleNodeInBBX(const OcTreeT::iterator& it) {};
      |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/include/octomap_server2/octomap_server.hpp: In constructor ‘octomap_server::OctomapServer::OctomapServer(const rclcpp::NodeOptions&, std::string)’:
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/include/octomap_server2/octomap_server.hpp:148:14: warning: ‘octomap_server::OctomapServer::m_useColoredMap’ will be initialized after [-Wreorder]
  148 |         bool m_useColoredMap;
      |              ^~~~~~~~~~~~~~~
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/include/octomap_server2/octomap_server.hpp:118:16: warning:   ‘double octomap_server::OctomapServer::m_colorFactor’ [-Wreorder]
  118 |         double m_colorFactor;
      |                ^~~~~~~~~~~~~
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp:5:5: warning:   when initialized here [-Wreorder]
    5 |     OctomapServer::OctomapServer(
      |     ^~~~~~~~~~~~~
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp: In member function ‘virtual void octomap_server::OctomapServer::publishAll(const rclcpp::Time&)’:
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp:595:28: warning: unused variable ‘size’ [-Wunused-variable]
  595 |                     double size = it.getSize();
      |                            ^~~~
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp: In member function ‘virtual bool octomap_server::OctomapServer::octomapBinarySrv(std::shared_ptr<octomap_msgs::srv::GetOctomap_Request_<std::allocator<void> > >, std::shared_ptr<octomap_msgs::srv::GetOctomap_Response_<std::allocator<void> > >)’:
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp:783:52: warning: unused parameter ‘req’ [-Wunused-parameter]
  783 |         const std::shared_ptr<OctomapSrv::Request> req,
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp: In member function ‘virtual bool octomap_server::OctomapServer::octomapFullSrv(std::shared_ptr<octomap_msgs::srv::GetOctomap_Request_<std::allocator<void> > >, std::shared_ptr<octomap_msgs::srv::GetOctomap_Response_<std::allocator<void> > >)’:
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp:802:52: warning: unused parameter ‘req’ [-Wunused-parameter]
  802 |         const std::shared_ptr<OctomapSrv::Request> req,
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp: In member function ‘bool octomap_server::OctomapServer::clearBBXSrv(std::shared_ptr<octomap_msgs::srv::BoundingBoxQuery_Request_<std::allocator<void> > >, std::shared_ptr<octomap_msgs::srv::BoundingBoxQuery_Response_<std::allocator<void> > >)’:
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp:817:43: warning: unused parameter ‘resp’ [-Wunused-parameter]
  817 |         std::shared_ptr<BBXSrv::Response> resp) {
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp: In member function ‘bool octomap_server::OctomapServer::resetSrv(std::shared_ptr<std_srvs::srv::Empty_Request_<std::allocator<void> > >, std::shared_ptr<std_srvs::srv::Empty_Response_<std::allocator<void> > >)’:
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp:855:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<visualization_msgs::msg::Marker_<std::allocator<void> >, std::allocator<visualization_msgs::msg::Marker_<std::allocator<void> > > >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
  855 |         for (auto i = 0; i < occupiedNodesVis.markers.size(); ++i){
      |                          ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp:871:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<visualization_msgs::msg::Marker_<std::allocator<void> >, std::allocator<visualization_msgs::msg::Marker_<std::allocator<void> > > >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
  871 |         for (auto i = 0; i < freeNodesVis.markers.size(); ++i) {
      |                          ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp:835:62: warning: unused parameter ‘req’ [-Wunused-parameter]
  835 |         const std::shared_ptr<std_srvs::srv::Empty::Request> req,
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp:836:57: warning: unused parameter ‘resp’ [-Wunused-parameter]
  836 |         std::shared_ptr<std_srvs::srv::Empty::Response> resp) {
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp: In member function ‘void octomap_server::OctomapServer::filterGroundPlane(const PCLPointCloud&, PCLPointCloud&, PCLPointCloud&) const’:
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp:1019:29: error: ‘class pcl::PassThrough<pcl::PointXYZ>’ has no member named ‘setFilterLimitsNegative’; did you mean ‘getFilterLimitsNegative’?
 1019 |                 second_pass.setFilterLimitsNegative (true);
      |                             ^~~~~~~~~~~~~~~~~~~~~~~
      |                             getFilterLimitsNegative
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp: In member function ‘virtual void octomap_server::OctomapServer::handlePreNodeTraversal(const rclcpp::Time&)’:
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp:1163:59: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]
 1163 |                 for (unsigned int j = mapUpdateBBXMinY; j <= mapUpdateBBXMaxY; ++j) {
      |                                                         ~~^~~~~~~~~~~~~~~~~~~
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp: In member function ‘virtual void octomap_server::OctomapServer::handlePostNodeTraversal(const rclcpp::Time&)’:
/home/ubuntu20/Dev/rover_ws/src/octomap_server2/src/octomap_server.cpp:1173:29: warning: unused parameter ‘rostime’ [-Wunused-parameter]
 1173 |         const rclcpp::Time& rostime){
      |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~
make[2]: *** [CMakeFiles/octomap_server2.dir/build.make:63: CMakeFiles/octomap_server2.dir/src/octomap_server.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:107: CMakeFiles/octomap_server2.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed   <<< octomap_server2 [7.68s, exited with code 2]

Summary: 0 packages finished [7.82s]
  1 package failed: octomap_server2
  1 package had stderr output: octomap_server2
macnack commented 1 year ago

Issue fixed in #17