3D Object Recognition based on Correspondence Grouping

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

3D Object Recognition based on Correspondence Grouping

MartinW
This post has NOT been accepted by the mailing list yet.
Hello all,

I am working with the PCL tutorial on 3D Object Recognition and get quite a few errors when I try to compile. I've looked through the forums and see that other people had errors where the compiler couldn't find the header files. They were told to install the experimental PCL 1.6 version. I followed some steps online and I think I installed it correctly, as well as change my CMakeLists.txt to use PCL 1.6. However, I still get these errors:

/root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp:122:70: error: no matching function for call to ‘parse_argument(int&, char**&, const char [12], float&)’
  /root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp:122:70: note: candidates are:
  /opt/ros/fuerte/include/pcl-1.5/pcl/console/parse.h:108:5: note: int pcl::console::parse_argument(int, char**, const char*, std::string&)
  /opt/ros/fuerte/include/pcl-1.5/pcl/console/parse.h:108:5: note:   no known conversion for argument 4 from ‘float’ to ‘std::string& {aka std::basic_string<char>&}’
  /opt/ros/fuerte/include/pcl-1.5/pcl/console/parse.h:118:5: note: int pcl::console::parse_argument(int, char**, const char*, bool&)
  /opt/ros/fuerte/include/pcl-1.5/pcl/console/parse.h:118:5: note:   no known conversion for argument 4 from ‘float’ to ‘bool&’
  /opt/ros/fuerte/include/pcl-1.5/pcl/console/parse.h:128:5: note: int pcl::console::parse_argument(int, char**, const char*, double&)
  /opt/ros/fuerte/include/pcl-1.5/pcl/console/parse.h:128:5: note:   no known conversion for argument 4 from ‘float’ to ‘double&’
  /opt/ros/fuerte/include/pcl-1.5/pcl/console/parse.h:138:5: note: int pcl::console::parse_argument(int, char**, const char*, int&)
  /opt/ros/fuerte/include/pcl-1.5/pcl/console/parse.h:138:5: note:   no known conversion for argument 4 from ‘float’ to ‘int&’
  /opt/ros/fuerte/include/pcl-1.5/pcl/console/parse.h:148:5: note: int pcl::console::parse_argument(int, char**, const char*, unsigned int&)
  /opt/ros/fuerte/include/pcl-1.5/pcl/console/parse.h:148:5: note:   no known conversion for argument 4 from ‘float’ to ‘unsigned int&’
  /opt/ros/fuerte/include/pcl-1.5/pcl/console/parse.h:158:5: note: int pcl::console::parse_argument(int, char**, const char*, char&)
  /opt/ros/fuerte/include/pcl-1.5/pcl/console/parse.h:158:5: note:   no known conversion for argument 4 from ‘float’ to ‘char&’
  /root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp: In function ‘int main(int, char**)’:
  /root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp:168:19: error: ‘DescriptorType’ was not declared in this scope
  /root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp:168:33: error: template argument 1 is invalid
  /root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp:168:40: error: expected initializer before ‘model_descriptors’
  /root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp:169:33: error: type/value mismatch at argument 1 in template parameter list for ‘template<class PointT> class pcl::PointCloud’
  /root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp:169:33: error:   expected a type, got ‘DescriptorType’
  /root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp:169:40: error: expected initializer before ‘scene_descriptors’
  /root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp:243:3: error: ‘SHOTColorEstimationOMP’ is not a member of ‘pcl’
  /root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp:243:40: error: expected primary-expression before ‘,’ token
  /root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp:243:52: error: expected primary-expression before ‘,’ token
  /root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp:243:70: error: ‘descr_est’ was not declared in this scope
  /root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp:249:23: error: ‘model_descriptors’ was not declared in this scope
  /root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp:254:23: error: ‘scene_descriptors’ was not declared in this scope
  /root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp:261:34: error: type/value mismatch at argument 1 in template parameter list for ‘template<class PointT, class Dist> class pcl::KdTreeFLANN’
  /root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp:261:34: error:   expected a type, got ‘DescriptorType’
  /root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp:261:48: error: invalid type in declaration before ‘;’ token
  /root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp:262:16: error: request for member ‘setInputCloud’ in ‘match_search’, which is of non-class type ‘int’
  /root/ros_workspace/my_pcl_tutorial/src/corr_match.cpp:273:37: error: request for member ‘nearestKSearch’ in ‘match_search’, which is of non-class type ‘int’



All I've done is copy and paste the code from the PCL Tutorials . Have I installed PCL 1.6 correctly? Or is there something else I am missing.

Thanks in advance to whomever can help me out!


Regards,
Martin
Reply | Threaded
Open this post in threaded view
|

Re: 3D Object Recognition based on Correspondence Grouping

Sergey
Administrator
Hi Martin,

It is hard to say whether you have installed 1.6 properly, but cmake finds and tries to use the older version (1.5, which comes with your ROS installation). This could be seen from the error messages, which refer to the file  /opt/ros/fuerte/include/pcl-1.5/pcl/console/parse.h.

What exactly you did to install PCL? How does your CMakeLists.txt look?

Regards,
Sergey
Reply | Threaded
Open this post in threaded view
|

Re: 3D Object Recognition based on Correspondence Grouping

MartinW
Hey Sergey,

I installed the ros-fuerte-perception-pcl-fuerte-unstable package from some help I received in the Ros Answers online forum, link. From that I just used rosmake and assumed it was installed correctly.

My CMakeLists.txt looks like:

cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

rosbuild_init()

#set the default path f or built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

include_directories(/usr/include/vtk-5.8)

find_package(PCL 1.6 REQUIRED)

include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

rosbuild_add_executable (corr_match src/corr_match.cpp)


In the Ros Answers forum Mac told me to change all the namespacing, filenames, and everything else from pcl to pcl16. Which I haven't yet tried with the Object Recognition example program.

Thanks for the reply!

Regards,
Martin



Sergey wrote
Hi Martin,

It is hard to say whether you have installed 1.6 properly, but cmake finds and tries to use the older version (1.5, which comes with your ROS installation). This could be seen from the error messages, which refer to the file  /opt/ros/fuerte/include/pcl-1.5/pcl/console/parse.h.

What exactly you did to install PCL? How does your CMakeLists.txt look?

Regards,
Sergey
Reply | Threaded
Open this post in threaded view
|

Re: 3D Object Recognition based on Correspondence Grouping

Sergey
Administrator
Martin,

First let me note that if you are using PCL within ROS ecosystem, then the dependency has to be specified only through the package manifest file (i.e. by writing <depend package="pcl16"/>). This part of your CMakeLists is therefore superfluous (and perhaps even harmful, though I am not sure):

find_package(PCL 1.6 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})


Second, I do not have experience with this unstable package for fuerte, but what Mac advises makes perfect sense for me. I would suggest trying that.

Regards,
Sergey
Reply | Threaded
Open this post in threaded view
|

Re: 3D Object Recognition based on Correspondence Grouping

MartinW
This post was updated on .
Hey Sergey,

Yea, I am trying to do some research integrating ROS on a robot we have here in the lab at my school. I've been having little-to-no trouble testing the PCL tutorials in ROS environment up until now. Although, all I've been doing was writing simple subscribers to the Kinect Openni.launch and publishing the interesting outputs of these tutorials. Fun stuff I must say, but I am still green to all of this stuff :) So all my CMakeLists.txt are hideous, poorly planned offspring of previous tutorials lol!

EDIT*
I have the line <depend package="pcl16"/> in my manifest.xml already.



I will try make these changes and post updates, many thanks!


Regards,
Martin
Reply | Threaded
Open this post in threaded view
|

Re: 3D Object Recognition based on Correspondence Grouping

MartinW
Hello again,

So I have changed the namespaces, filenames, and such from pcl to pcl16 and now I have some new compiling warnings and error.

  [ 13%] Building CXX object CMakeFiles/corr_match2.dir/src/corr_match2.o
  In file included from /opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/point_representation.h:42:0,
                   from /opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/kdtree/kdtree.h:46,
                   from /opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/search/kdtree.h:43,
                   from /opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/search/pcl_search.h:44,
                   from /opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/features/impl/feature.hpp:43,
                   from /opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/features/feature.h:502,
                   from /opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/features/normal_3d.h:43,
                   from /opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/features/normal_3d_omp.h:43,
                   from /root/ros_workspace/my_pcl_tutorial/src/corr_match2.cpp:4:
  /opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/point_types.h:56:0: warning: ignoring #pragma warning  [-Wunknown-pragmas]
  In file included from /opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/point_representation.h:42:0,
                   from /opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/kdtree/kdtree.h:46,
                   from /opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/search/kdtree.h:43,
                   from /opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/search/pcl_search.h:44,
                   from /opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/features/impl/feature.hpp:43,
                   from /opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/features/feature.h:502,
                   from /opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/features/normal_3d.h:43,
                   from /opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/features/normal_3d_omp.h:43,
                   from /root/ros_workspace/my_pcl_tutorial/src/corr_match2.cpp:4:
  /opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/point_types.h:583:0: warning: ignoring #pragma warning  [-Wunknown-pragmas]
  /root/ros_workspace/my_pcl_tutorial/src/corr_match2.cpp:10:48: fatal error: pcl16/visualization/pcl_visualizer.h: No such file or directory
  compilation terminated.


The warnings I assume aren't that troublesome but the fatal error "pcl16/visualization/pcl_visualizer.h: No such file or directory" got me thinking, that there probably isn't a different pcl16 visualizer. So I switched it back from a pcl16 include to the pcl include and got a whole bunch of new errors :S Do you know what the problem is here?



Regards,
Martin


Reply | Threaded
Open this post in threaded view
|

Re: 3D Object Recognition based on Correspondence Grouping

Sergey
Administrator
Natural question then is whether you have this file at all:

/opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/visualization/pcl_visualizer.h

If not, then do you have the containing folder(s)?
Reply | Threaded
Open this post in threaded view
|

Re: 3D Object Recognition based on Correspondence Grouping

MartinW

My visualization/pcl_visualizer file is found:

/opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/visualization/include/pcl/visualization/pcl_visualizer.h

All that is in the /opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/visualization/ folder is a pcl_visualization-1.6.pc and visualization.doxy apart from makefiles.
 
Reply | Threaded
Open this post in threaded view
|

Re: 3D Object Recognition based on Correspondence Grouping

Sergey
Administrator
Hi Martin,

Seems like something is wrong with your installation of "perception_pcl_fuerte_unstable".

I tried installing this package myself, and I do have the file

/opt/ros/fuerte/stacks/perception_pcl_fuerte_unstable/pcl16/include/pcl-1.6/pcl16/visualization/pcl_visualizer.h

Regards,
Sergey
Reply | Threaded
Open this post in threaded view
|

Re: 3D Object Recognition based on Correspondence Grouping

MartinW
This post was updated on .
Hey Sergey,

I reinstalled the "perception_pcl_fuerte_unstable" package and I have that file now, strange that I didn't have it before but nevertheless it is there now. Unfortunately I've swapped one missing file error with another. Now it seems I do not have the board.h file in my features directory.

/root/ros_workspace/my_pcl_tutorial/src/corr_match2.cpp:6:34: fatal error: pcl16/features/board.h: No such file or directory

But I found the board.h file in my pcl 1.5 folder. Is it naive to think I can just copy and modify the namespaces, filenames, etc. from pcl to pcl16 in this board.h and add it to my unstable package directory?


EDIT** I tried that and it seemed to work fine, but then I'm still missing an entire folder on recognition in the pcl16 directory.
#include <pcl16/features/board.h>
#include <pcl16/recognition/cg/hough_3d.h>
#include <pcl16/recognition/cg/geometric_consistency.h>
These are the 3 files that I can't seem to locate in within the 1.6 version of pcl.


Many thanks and regards,
Martin
Reply | Threaded
Open this post in threaded view
|

Re: 3D Object Recognition based on Correspondence Grouping

Sergey
Administrator
Martin,

Perhaps you could contact the maintainer of the package and ask him why all these files are missing.

As I have noted before, I didn't use (unstable) PCL with Fuerte. But for Electric there was an option to check out "perception_pcl_electric_unstable" repository, get the trunk of PCL together with it, and then compile it. In the end one got a compiled-from-source PCL trunk, which "behaved" like perception_pcl package and therefore was compatible with ROS.

I don't see a similar repo for Fuerte, yet there is simply "perception_pcl_unstable" (check here). It's likely that it is the one that is supposed to work with Fuerte.

Regards,
Sergey
Reply | Threaded
Open this post in threaded view
|

Re: 3D Object Recognition based on Correspondence Grouping

MartinW
Hey Sergey,

I was tinkering with some of the pcl1.5 files in the recognition directory and tried to change the namespaces over. My program recognizes where to find the files but generate a lot more errors. I think I might give up the tutorial on "3D Object Recognition based on Correspondence Grouping" for now, at least until I gain a better understanding of which PCL I should be using with Fuerte.

Thanks again for all the help!

Regards,
Martin
Reply | Threaded
Open this post in threaded view
|

Re: 3D Object Recognition based on Correspondence Grouping

Sergey
Administrator
Hi Martin,

Yeah, moving around header files rarely solves an issue because these are just "front-ends" of the libraries, which themselves are supposed to be somewhere in the form of .so objects.

Well... you could always try these tutorials without ROS.

Regards,
Sergey
Reply | Threaded
Open this post in threaded view
|

Re: 3D Object Recognition based on Correspondence Grouping

MartinW
Hey Sergey,

Yea I suppose that would be easier to just use PCL without ROS but I was hoping to use some additional ROS packages like arm_navigation on my robot. That way I could unify my system with ROS message passing :)

Regards,
Martin