error: no matching function for call to ‘getMinMax3D(pcl::PointCloud<pcl::PointXYZ>::Ptr&, pcl::PointXYZ&, pcl::PointXYZ&)’

asked 2020-12-23 08:40:56 -0500

pink_heelz gravatar image

updated 2020-12-23 11:10:11 -0500

Hi I am running UBuntu 16.04 as a virtual machine, using ROS Kinetic and ROS1. I wrote some unit tests for packages writing with C++ and get the above error when I try to run "catkin_make run_tests". Here is the details.

[ 90%] Building CXX object anti_shin_buster/CMakeFiles/test_anti_shin_buster_node.dir/test/test_anti_shin_buster_node.cpp.o
/home/iris/catkin_ws/src/anti_shin_buster/test/test_anti_shin_buster_node.cpp: In member function ‘virtual void AntiShinBusterTest_testTransformAndFilter_Test::TestBody()’:
/home/iris/catkin_ws/src/anti_shin_buster/test/test_anti_shin_buster_node.cpp:63:56: error: no matching function for call to ‘getMinMax3D(pcl::PointCloud<pcl::PointXYZ>::Ptr&, pcl::PointXYZ&, pcl::PointXYZ&)’
 pcl::getMinMax3D(transformed_and_filtered, minPt, maxPt);
                                                        ^
In file included from /home/iris/catkin_ws/src/anti_shin_buster/include/anti_shin_buster/anti_shin_buster_node.hpp:11:0,
                 from /home/iris/catkin_ws/src/anti_shin_buster/test/test_anti_shin_buster_node.cpp:3:
/usr/include/pcl-1.7/pcl/filters/voxel_grid.h:58:3: note: candidate: void pcl::getMinMax3D(const PCLPointCloud2ConstPtr&, int, int, int, Eigen::Vector4f&, Eigen::Vector4f&)
   getMinMax3D (const pcl::PCLPointCloud2ConstPtr &cloud, int x_idx, int y_idx, int z_idx,
   ^
/usr/include/pcl-1.7/pcl/filters/voxel_grid.h:58:3: note:   candidate expects 6 arguments, 3 provided
/usr/include/pcl-1.7/pcl/filters/voxel_grid.h:76:3: note: candidate: void pcl::getMinMax3D(const PCLPointCloud2ConstPtr&, int, int, int, const string&, float, float, Eigen::Vector4f&, Eigen::Vector4f&, bool)
   getMinMax3D (const pcl::PCLPointCloud2ConstPtr &cloud, int x_idx, int y_idx, int z_idx,
   ^
/usr/include/pcl-1.7/pcl/filters/voxel_grid.h:76:3: note:   candidate expects 10 arguments, 3 provided
In file included from /home/iris/catkin_ws/src/anti_shin_buster/include/anti_shin_buster/anti_shin_buster_node.hpp:11:0,
                 from /home/iris/catkin_ws/src/anti_shin_buster/test/test_anti_shin_buster_node.cpp:3:
/usr/include/pcl-1.7/pcl/filters/voxel_grid.h:143:3: note: candidate: template<class PointT> void pcl::getMinMax3D(const typename pcl::PointCloud<PointT>::ConstPtr&, const string&, float, float, Eigen::Vector4f&, Eigen::Vector4f&, bool)
   getMinMax3D (const typename pcl::PointCloud<PointT>::ConstPtr &cloud, 
   ^
/usr/include/pcl-1.7/pcl/filters/voxel_grid.h:143:3: note:   template argument deduction/substitution failed:
/home/iris/catkin_ws/src/anti_shin_buster/test/test_anti_shin_buster_node.cpp:63:56: note:   cannot convert ‘minPt’ (type ‘pcl::PointXYZ’) to type ‘const string& {aka const std::__cxx11::basic_string<char>&}’
 pcl::getMinMax3D(transformed_and_filtered, minPt, maxPt);
                                                        ^
In file included from /home/iris/catkin_ws/src/anti_shin_buster/include/anti_shin_buster/anti_shin_buster_node.hpp:11:0,
                 from /home/iris/catkin_ws/src/anti_shin_buster/test/test_anti_shin_buster_node.cpp:3:
/usr/include/pcl-1.7/pcl/filters/voxel_grid.h:160:3: note: candidate: template<class PointT> void pcl::getMinMax3D(const typename pcl::PointCloud<PointT>::ConstPtr&, const std::vector<int>&, const string&, float, float, Eigen::Vector4f&, Eigen::Vector4f&, bool)
   getMinMax3D (const typename pcl::PointCloud<PointT>::ConstPtr &cloud, 
   ^
/usr/include/pcl-1.7/pcl/filters/voxel_grid.h:160:3: note:   template argument deduction/substitution failed:
/home/iris/catkin_ws/src/anti_shin_buster/test/test_anti_shin_buster_node.cpp:63:56: note:   cannot convert ‘minPt’ (type ‘pcl::PointXYZ’) to type ‘const std::vector<int>&’
 pcl::getMinMax3D(transformed_and_filtered, minPt, maxPt);
                                                        ^
anti_shin_buster/CMakeFiles/test_anti_shin_buster_node.dir/build.make:62: recipe for target 'anti_shin_buster/CMakeFiles/test_anti_shin_buster_node.dir/test/test_anti_shin_buster_node.cpp.o' failed
make[3]: *** [anti_shin_buster/CMakeFiles/test_anti_shin_buster_node.dir/test/test_anti_shin_buster_node.cpp.o] Error 1
CMakeFiles/Makefile2:3451: recipe for target 'anti_shin_buster/CMakeFiles/test_anti_shin_buster_node.dir/all' failed
make[2]: *** [anti_shin_buster/CMakeFiles ...
(more)
edit retag flag offensive close merge delete

Comments

Please use the 101010 button to format code snippets. I've edited your question to make it a bit more readable.

jarvisschultz gravatar image jarvisschultz  ( 2020-12-23 11:11:49 -0500 )edit

Thank you jarvisschultz! Sorry I am a beginner in ROS :P

pink_heelz gravatar image pink_heelz  ( 2020-12-24 22:55:36 -0500 )edit