pcl_tracking in perception_pcl_electric_unstable gives nodelet error

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

pcl_tracking in perception_pcl_electric_unstable gives nodelet error

pusnik
Hey,

I'm trying to implement tracking using pcl::tracking library. Everything builds normaly, but when I try to run nodelet I get an error:

     Failed to load nodelet [/Detection_Tracking] of type [Detector/Detection_Tracking]:
Failed to load library /home/grega/ros_workspace/diploma/Detector/lib/libDetector.so.
Make sure that you are calling the PLUGINLIB_REGISTER_CLASS macro in the library code,
and that names are consistent between this macro and your XML.
Error string: Cannot load library: /home/grega/ros_workspace/diploma/Detector/lib/libDetector.so:
undefined symbol: _ZN3pcl8tracking21ParticleFilterTrackerINS_12PointXYZRGBAENS0_14ParticleXYZRPYEE11initComputeEv
[FATAL] [1342859395.359533594]: Service call failed!
Do I have to link somehow libpcl_tracking.so in CMakeList.txt? Shouldn't be that done automatically when I add pcl dependency in manifest.xml?

I'm using Ubuntu and ROS Electric.

Thank's for your help.
Reply | Threaded
Open this post in threaded view
|

Re: pcl_tracking in perception_pcl_electric_unstable gives nodelet error

pusnik
This post was updated on .
I found out that this is a pcl linking problem, because I'm getting undefined reference to...
I'm using perception_pcl_electric_unstable. Does anybody know how to fix it?
Reply | Threaded
Open this post in threaded view
|

Re: pcl_tracking in perception_pcl_electric_unstable gives nodelet error

Sergey
Administrator
Hi pusnik,

pusnik wrote
Do I have to link somehow libpcl_tracking.so in CMakeList.txt? Shouldn't be that done automatically when I add pcl dependency in manifest.xml?
No you don't, adding a dependency in manifest should suffice.

It seems like you have created your own library libDetector and then try to reuse its functions in some other place. I think if you post your CMakeLists.txt it will be easier to debug your problem.

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

Re: pcl_tracking in perception_pcl_electric_unstable gives nodelet error

pusnik
Hey,

Thank you for your answer.

I just found a solution. I added the following lines to CMakeList.txt

link_directories (/home/grega/ros_workspace/perception_pcl_electric_unstable/pcl/lib)
rosbuild_add_library(Detector src/preprocessing_tracking.cpp)
include_directories(/home/grega/ros_workspace/perception_pcl_electric_unstable/pcl/include)
target_link_libraries(Detector pcl_tracking)

Now it builds successfully.
Reply | Threaded
Open this post in threaded view
|

Re: pcl_tracking in perception_pcl_electric_unstable gives nodelet error

Sergey
Administrator
pusnik,

pusnik wrote
link_directories (/home/grega/ros_workspace/perception_pcl_electric_unstable/pcl/lib)

include_directories(/home/grega/ros_workspace/perception_pcl_electric_unstable/pcl/include)
These two lines are superfluous, because rosmake should add appropriate lib/ and include/ directories automatically when it encounters the dependency in the manifest file. Does it work without them? If no, then my guess would be that perception_pcl_electric_unstable stack does not overlay the stable perception stack from ROS distribution. That means that in  your $ROS_PACKAGE_PATH variable "/opt/ros/electric" comes before "~/ros_workspace", while it should be the other way round if you want to use unstable stack.

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

Re: pcl_tracking in perception_pcl_electric_unstable gives nodelet error

pusnik
Hey,

I checked my path:

echo $ROS_PACKAGE_PATH
/home/grega/ros_workspace:/home/grega/ros_workspace/diploma/Detector:/home/grega/ros_workspace/people:/opt/ros/electric/stacks:/opt/ros/electric/ros

Best regards.