Ask Your Question
0

pcl library linking problem

asked 2016-04-28 02:59:46 -0600

horczech gravatar image

Hi, I am facing a linking problem between pcl and ROS. I am using Ubuntu 14.04 and QtCreator. I am trying to convert the laser data to OpenCV image, now I have the pointcoud2 so I need to convert it to ros image and afterwards to OpenCV image. I am getting this error message:

/home/horczech/robohockey/src/player/src/playnode.cpp:91: error: 'toROSMsg' is not a member of 'pcl'
       pcl::toROSMsg (cloud, pclImage); //convert the cloud
       ^

And the row where I am including necessary library is underscored and when I hover obove it with my mouse it is saying that "pcl/io/pcd_io.h : No such file or directory "

When I run catkin make I am getting this message:

horczech@Ubuntu:~/robohockey$ catkin_make
Base path: /home/horczech/robohockey
Source space: /home/horczech/robohockey/src
Build space: /home/horczech/robohockey/build
Devel space: /home/horczech/robohockey/devel
Install space: /home/horczech/robohockey/install
####
#### Running command: "make cmake_check_build_system" in "/home/horczech/robohockey/build"
####
####
#### Running command: "make -j4 -l4" in "/home/horczech/robohockey/build"
####
[  0%] [  0%] [  0%] [  0%] Built target roscpp_generate_messages_cpp
Built target topic_tools_generate_messages_lisp
Built target geometry_msgs_generate_messages_py
Built target sensor_msgs_generate_messages_py
[  0%] [  0%] Built target roscpp_generate_messages_lisp
[  0%] Built target roscpp_generate_messages_eus
Built target roscpp_generate_messages_py
[  0%] Built target tf_generate_messages_py
[  0%] [  0%] [  0%] Built target rosgraph_msgs_generate_messages_cpp
Built target geometry_msgs_generate_messages_cpp
Built target sensor_msgs_generate_messages_lisp
[  0%] Built target sensor_msgs_generate_messages_cpp
[  0%] Built target tf_generate_messages_eus
[  0%] Built target std_msgs_generate_messages_lisp
[  0%] Built target std_msgs_generate_messages_eus
[  0%] Built target sensor_msgs_generate_messages_eus
[  0%] Built target std_msgs_generate_messages_cpp
[  0%] [  0%] Built target rosgraph_msgs_generate_messages_py
Built target dynamic_reconfigure_generate_messages_eus
[  0%] Built target geometry_msgs_generate_messages_lisp
[  0%] Built target geometry_msgs_generate_messages_eus
[  0%] [  0%] Built target rosgraph_msgs_generate_messages_eus
Built target std_msgs_generate_messages_py
[  0%] Built target rosgraph_msgs_generate_messages_lisp
[  0%] [  0%] Built target tf_generate_messages_lisp
Built target dynamic_reconfigure_generate_messages_py
[  0%] Built target tf_generate_messages_cpp
[  0%] Built target nodelet_generate_messages_lisp
[  0%] [  0%] Built target actionlib_generate_messages_eus
Built target actionlib_generate_messages_lisp
[  0%] [  0%] Built target actionlib_generate_messages_cpp
Built target pcl_msgs_generate_messages_py
[  0%] Built target actionlib_generate_messages_py
[  0%] Built target actionlib_msgs_generate_messages_eus
[  0%] [  0%] Built target actionlib_msgs_generate_messages_cpp
Built target nodelet_generate_messages_eus
[  0%] [  0%] Built target actionlib_msgs_generate_messages_lisp
Built target tf2_msgs_generate_messages_eus
[  0%] [  0%] Built target tf2_msgs_generate_messages_lisp
Built target dynamic_reconfigure_generate_messages_lisp
[  0%] Built target pcl_ros_gencfg
[  0%] [  0%] [  0%] Built target actionlib_msgs_generate_messages_py
Built target topic_tools_generate_messages_cpp
Built target pcl_msgs_generate_messages_eus
[  0%] Built target dynamic_reconfigure_generate_messages_cpp
[  0%] [  0%] Built target nodelet_generate_messages_cpp
Built target tf2_msgs_generate_messages_cpp
[  0%] Built target nodelet_generate_messages_py
[  0%] Built target bond_generate_messages_eus
[  0%] [  0%] Built target bond_generate_messages_lisp
Built target tf2_msgs_generate_messages_py
[  0%] Built target dynamic_reconfigure_gencfg
[  0%] Built target pcl_msgs_generate_messages_lisp
[  0%] Built target bond_generate_messages_cpp
[  0%] [  0%] Built target pcl_msgs_generate_messages_cpp
[  0%] Built target topic_tools_generate_messages_eus
Built target bond_generate_messages_py
[  0%] Built target topic_tools_generate_messages_py
[  3%] Automoc for target referee_node
[  3%] Built target referee_node_automoc
[  3%] [  3%] Built target _referee_generate_messages_check_deps_TeamReady
Built target _referee_generate_messages_check_deps_SendColor
[  3%] [  3%] Built target gazebo_msgs_generate_messages_cpp
Built target _referee_generate_messages_check_deps_SendDimensions
[  3%] Built target gazebo_msgs_generate_messages_py
[  3%] Built target trajectory_msgs_generate_messages_py
[  3%] Built target gazebo_msgs_generate_messages_eus
[  3%] Built target std_srvs_generate_messages_lisp
[  3%] [  3%] Built target trajectory_msgs_generate_messages_cpp
Built target trajectory_msgs_generate_messages_eus
[  3%] [  3%] Built target std_srvs_generate_messages_py
Built target trajectory_msgs_generate_messages_lisp
[  3%] [  3%] Built target std_srvs_generate_messages_cpp
Built target std_srvs_generate_messages_eus
[  3%] [ 15%] Built target referee_generate_messages_eus
Built target gazebo_msgs_generate_messages_lisp
[ 31%] [ 31%] [ 40%] Built target referee_generate_messages_cpp
Built target referee_generate_messages_lisp
Built target tuw_gazebo_ros_utils
[ 43%] Building CXX object player/CMakeFiles/player_node.dir/src ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-04-28 06:52:20 -0600

mgruhler gravatar image

This is not a linker error, but a build error. The error tells you that it does not find a specific header file.

Afaik, pcl::toRosMsg is defined in the pcl_conversions package. Add this to the CMakeLists.txt, and include pcl_conversions.h in the file where you use the toRosMsg call.

Also, please clean the CMakeLists.txt up, before posting here ;-) i.e. remove all the commented parts. I'd also recomend to have all the stuff at the end in the respective calls where it belongs, e.g. uncomment the PCL part here:

target_link_libraries(player_node
  ${catkin_LIBRARIES}
  ${OpenCV_LIBRARIES}
  #${PCL_LIBRARIES} #ADDED BY MARTIN
)

instead of having this below again...

edit flag offensive delete link more

Comments

thank you very much !

horczech gravatar imagehorczech ( 2016-04-28 15:36:02 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-04-28 02:59:46 -0600

Seen: 670 times

Last updated: Apr 28 '16