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

Advice on human_anticipation code #1

Open
rojas70 opened this issue Jan 3, 2018 · 0 comments
Open

Advice on human_anticipation code #1

rojas70 opened this issue Jan 3, 2018 · 0 comments

Comments

@rojas70
Copy link

rojas70 commented Jan 3, 2018

@juntuck, saw your post on:
hemakoppula/human_activity_anticipation#1

CMakeLists.txt

I am trying to use pcl-1.7 to compile the code instead of the original pcl-1.6. The CMakeLists.txt file reflects this:

find_package(PCL 1.7 REQUIRED COMPONENTS common io search)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

Undefined References

Getting a series of undefined references with what I think is an unrecognized typedef, namely: pcl::PointXYZRGBCamSL.

For example, when running cmake.. and then make using v. 1.7. I get these errors:

>>$ grep pcl::PointXYZRGBCamSL compile.out 
CMakeFiles/frameFeats.dir/src/featureGenerationForFramesSampled.cpp.o: In function `getClusters(pcl::PointCloud<pcl::PointXYZRGBCamSL>&, std::vector<pcl::PointCloud<pcl::PointXYZRGB>, std::allocator<pcl::PointCloud<pcl::PointXYZRGB> > >&, std::vector<pcl::PointIndices, std::allocator<pcl::PointIndices> >&, bool)':
featureGenerationForFramesSampled.cpp:(.text+0x2602): undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBCamSL>::KdTree(bool)'
featureGenerationForFramesSampled.cpp:(.text+0x26e9): undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBCamSL>::KdTree(bool)'
CMakeFiles/frameFeats.dir/src/featureGenerationForFramesSampled.cpp.o: In function `pcl::Feature<pcl::PointXYZRGBCamSL, pcl::Normal>::Feature()':
featureGenerationForFramesSampled.cpp:(.text._ZN3pcl7FeatureINS_16PointXYZRGBCamSLENS_6NormalEEC2Ev[_ZN3pcl7FeatureINS_16PointXYZRGBCamSLENS_6NormalEEC5Ev]+0x15): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBCamSL>::PCLBase()'
CMakeFiles/frameFeats.dir/src/featureGenerationForFramesSampled.cpp.o: In function `pcl::Feature<pcl::PointXYZRGBCamSL, pcl::Normal>::initCompute()':
featureGenerationForFramesSampled.cpp:(.text._ZN3pcl7FeatureINS_16PointXYZRGBCamSLENS_6NormalEE11initComputeEv[_ZN3pcl7FeatureINS_16PointXYZRGBCamSLENS_6NormalEE11initComputeEv]+0x20): undefined reference to `pcl::PCLBase<pcl::PointXYZRGBCamSL>::initCompute()'
featureGenerationForFramesSampled.cpp:(.text._ZN3pcl7FeatureINS_16PointXYZRGBCamSLENS_6NormalEE11initComputeEv[_ZN3pcl7FeatureINS_16PointXYZRGBCamSLENS_6NormalEE11initComputeEv]+0x1b8): undefined reference to `pcl::search::KdTree<pcl::PointXYZRGBCamSL>::KdTree(bool)'
CMakeFiles/frameFeats.dir/src/featureGenerationForFramesSampled.cpp.o: In function `pcl::search::OrganizedNeighbor<pcl::PointXYZRGBCamSL>::OrganizedNeighbor(bool, float, unsigned int)':
featureGenerationForFramesSampled.cpp:(.text._ZN3pcl6search17OrganizedNeighborINS_16PointXYZRGBCamSLEEC2Ebfj[_ZN3pcl6search17OrganizedNeighborINS_16PointXYZRGBCamSLEEC5Ebfj]+0x50): undefined reference to `pcl::search::Search<pcl::PointXYZRGBCamSL>::Search(std::string const&, bool)'

The structore of the code is as follows:
src:

  • .cpp (uses typedef, has @include .h files)
  • pointClustering.h // includes the typedefed
    includes:
  • point_types.h // includes the namespaced new type (i.e. pcl::PointXYZRGBCamSL)

PCL 1.6 and PCL 1.7 API shoudl have no conflict

I checked the api and the methods are exactly the same. So, that leads me to believe that all the errors have to do with the fact that we are using a specific type:
pcl::PointXYZRGBCamSL

pcl::PointXYZRGBCamSL is defined in src/includes/point_types.h

    struct PointXYZRGBCamSL
    {
        PCL_ADD_POINT4D;
 		union
  		{
    		struct
    		{
      			float rgb;
    		};
    		float data_c[4];
  		};
        uint32_t cameraIndex;
        float distance;
        uint32_t segment;
        uint32_t label;
        EIGEN_MAKE_ALIGNED_OPERATOR_NEW
	} EIGEN_ALIGN16;
}

That type is then typedef'd in src/pointClustering.h
My main .cpp includes another file called frame.cpp, frame.cpp include pointClustering.h.

typedef pcl::PointXYZRGBCamSL PointOutT;

If you look back at the undefined reference errors, for example this one:

`pcl::search::KdTree<pcl::PointXYZRGBCamSL>::KdTree(bool)'

It seems it's not the KdTree definition that is the problem, but the type:
http://docs.pointclouds.org/1.7.0/classpcl_1_1search_1_1_kd_tree.html#a70e9612857ee78a62c1b14c7f05a8945

Any advice on why this might be is appreciated.
Sincerely.

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

1 participant