Cmake problem

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

Cmake problem

maxdd
Hello there, i need some help with this error... i just started coding so dont be too bad

this is what i did:

sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
sudo apt-get update
sudo apt-get install libpcl-all

then with cmake .. i noticed:

 checking for module 'openni-dev'
--   package 'openni-dev' not found
 
and lot of:

The imported target "vtkPythonCore" references the file
   "/usr/lib/libvtkPythonCore.so.5.8.0"
but this file does not exist.

then i compiled it but:

/home/ubuntu/Projects/pcdv_gfenod.cpp: In member function ‘CloudConstPtr st1::cloud_process()’:
/home/ubuntu/Projects/pcdv_gfenod.cpp:54:3: error: ‘sensor_msgs’ has not been declared
/home/ubuntu/Projects/pcdv_gfenod.cpp:54:33: error: expected ‘;’ before ‘cloud_blob’
/home/ubuntu/Projects/pcdv_gfenod.cpp:55:3: error: ‘sensor_msgs’ has not been declared
/home/ubuntu/Projects/pcdv_gfenod.cpp:55:33: error: expected ‘;’ before ‘cloud_filtered_blob’
/home/ubuntu/Projects/pcdv_gfenod.cpp:68:3: error: ‘toROSMsg’ is not a member of ‘pcl’
/home/ubuntu/Projects/pcdv_gfenod.cpp:68:29: error: ‘cloud_blob’ was not declared in this scope
/home/ubuntu/Projects/pcdv_gfenod.cpp:70:18: error: ‘sensor_msgs’ was not declared in this scope
/home/ubuntu/Projects/pcdv_gfenod.cpp:70:42: error: template argument 1 is invalid
/home/ubuntu/Projects/pcdv_gfenod.cpp:70:47: error: invalid type in declaration before ‘;’ token
/home/ubuntu/Projects/pcdv_gfenod.cpp:71:7: error: request for member ‘setInputCloud’ in ‘sor’, which is of non-class type ‘int’
/home/ubuntu/Projects/pcdv_gfenod.cpp:72:7: error: request for member ‘setLeafSize’ in ‘sor’, which is of non-class type ‘int’
/home/ubuntu/Projects/pcdv_gfenod.cpp:73:7: error: request for member ‘filter’ in ‘sor’, which is of non-class type ‘int’
/home/ubuntu/Projects/pcdv_gfenod.cpp:73:16: error: ‘cloud_filtered_blob’ was not declared in this scope
/home/ubuntu/Projects/pcdv_gfenod.cpp:76:3: error: ‘fromROSMsg’ is not a member of ‘pcl’
make[2]: *** [CMakeFiles/pcdv_gfenod.dir/pcdv_gfenod.cpp.o] Error 1
make[1]: *** [CMakeFiles/pcdv_gfenod.dir/all] Error 2
make: *** [all] Error 2

Im assuming that the error is about sensor_msgs

here's my CMAKELISTS.txt

cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(ground_floor_estim_and_obstacle_detect)
find_package(PCL 1.7 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_executable (pcdv_gfenod pcdv_gfenod.cpp)
target_link_libraries (pcdv_gfenod ${PCL_LIBRARIES})
Reply | Threaded
Open this post in threaded view
|

Re: Cmake problem

Jochen Sprickerhof
Administrator
Hi maxdd,

* maxdd <[hidden email]> [2013-11-13 14:03]:
>  checking for module 'openni-dev'
> --   package 'openni-dev' not found

Already fixed, will be part of the next release:
https://github.com/PointCloudLibrary/pcl/commit/d282b79611731813cc9035e98abd74782d45db2a

> and lot of:
>
> The imported target "vtkPythonCore" references the file
>    "/usr/lib/libvtkPythonCore.so.5.8.0"
> but this file does not exist.

That's fine, the /usr/lib/vtk-5.8/VTKTargets.cmake is just a little
verbose.

> then i compiled it but:
>
> /home/ubuntu/Projects/pcdv_gfenod.cpp: In member function ‘CloudConstPtr
> st1::cloud_process()’:
> /home/ubuntu/Projects/pcdv_gfenod.cpp:54:3: error: ‘sensor_msgs’ has not
> been declared

sensor_msgs is part of ROS, so I guess your project needs that. Please
have a look on ros.org for how to use it with PCL.

Cheers Jochen
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Cmake problem

maxdd
So "sensor_msgs" isnt in pcl lib anymore? is it true that ROS is behind 6 months with ur latest changes? i need pcl-1.7.x and that "sensor_msgs"... are there alternatives? what do you suggest?
Reply | Threaded
Open this post in threaded view
|

Re: Cmake problem

Khalid Yousif

The latest ROS hydro comes with pcl 1.7. You will be able to convert between ros msgs and pcl msgs with ease.

Regards,
Khalid

On 14/11/2013 7:32 PM, "maxdd" <[hidden email]> wrote:
So "sensor_msgs" isnt in pcl lib anymore? is it true that ROS is behind 6
months with ur latest changes? i need pcl-1.7.x and that "sensor_msgs"...
are there alternatives? what do you suggest?



--
View this message in context: http://www.pcl-users.org/Cmake-problem-tp4030743p4030753.html
Sent from the Point Cloud Library (PCL) Users mailing list mailing list archive at Nabble.com.
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Cmake problem

maxdd
Hello Khalid,
thanks for your reply.. Could you link me something more specific? when you mean convert you mean that i could change the code in order to work just with pcl or you mean that i still need ROS Hydro
Reply | Threaded
Open this post in threaded view
|

Re: Cmake problem

Jochen Sprickerhof
Administrator
Hi maxdd,

* maxdd <[hidden email]> [2013-11-14 00:55]:
> thanks for your reply.. Could you link me something more specific?

http://wiki.ros.org/hydro/Migration#PCL
https://github.com/PointCloudLibrary/pcl/wiki/Remove-ROS
http://wiki.ros.org/pcl_conversions

> when you
> mean convert you mean that i could change the code in order to work just
> with pcl or you mean that i still need ROS Hydro

Depends on your code. sensor_msgs::PointCloud2 looks like you are using
ROS stuff (as in topics and so on). If you just want to do point cloud
processing, you should be able to do it with PCL alone. If you want to
do robotics, use ROS.

Cheers Jochen
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Cmake problem

Khalid Yousif
In reply to this post by maxdd

You still need ros hydro

On 14/11/2013 7:55 PM, "maxdd" <[hidden email]> wrote:
Hello Khalid,
thanks for your reply.. Could you link me something more specific? when you
mean convert you mean that i could change the code in order to work just
with pcl or you mean that i still need ROS Hydro



--
View this message in context: http://www.pcl-users.org/Cmake-problem-tp4030743p4030757.html
Sent from the Point Cloud Library (PCL) Users mailing list mailing list archive at Nabble.com.
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Cmake problem

maxdd
This post was updated on .
In reply to this post by Jochen Sprickerhof
im using the KINECT with RANSAC algorithm in a program which i need to improve (code is not developed by myself and the developer seems not to be contactable).

What i figure out is that

Once my pointcloud node receives the sensor_msgs::PointCloud msg it uses pcl::fromROSMsg function to convert it to pcl::PointCloud<pointt> and then it can be used as input to all pcl algorithms.

So i assume that KINECT falls into ROS category right?

Basically im using the voxel grid tutorial here http://pointclouds.org/documentation/tutorials/voxel_grid.php but the code i have instead of using

pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2 ());
pcl::PCLPointCloud2::Ptr cloud_filtered (new pcl::PCLPointCloud2 ());

uses

sensor_msgs::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2 ());
sensor_msgs::PCLPointCloud2::Ptr cloud_filtered (new pcl::PCLPointCloud2 ());

If i use Hyrdo should i be able to compile it without any modification? (at least to have a point where to start)
Reply | Threaded
Open this post in threaded view
|

Re: Cmake problem

Jochen Sprickerhof
Administrator
* maxdd <[hidden email]> [2013-11-14 01:14]:
> Once my pointcloud node receives the sensor_msgs::PointCloud msg it uses
> pcl::fromROSMsg function to convert it to pcl::PointCloud<pointt> and then
> it can be used as input to all pcl algorithms.
>
> So i assume that KINECT falls into ROS category right?

Yes.
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Cmake problem

maxdd
This post was updated on .
Ok thank you, just for having different options: is there a way to directly use the equivalent of the sensor_msgs in PCL (if there exists)? in the voxel grid code there is a conversion of that variable into a pcl one , where should i look for understanding why did he use the sensor_msg class instead of directly a pcl one?

honestly is ROS really needed for KINECT? i just need a RANSAC segmentation nothing more
Reply | Threaded
Open this post in threaded view
|

Re: Cmake problem

Jochen Sprickerhof
Administrator
* maxdd <[hidden email]> [2013-11-14 02:39]:
> Ok thank you, just for having different options: is there a way to directly
> use the equivalent of the sensor_msgs in PLC (if there exists)? in the voxel
> grid code there is a conversion of that variable into a pcl one , where
> should i look for understanding why did he use the sensor_msg class instead
> of directly a plc one?
>
> honestly is ROS really needed for KINECT? i just need a RANSAC segmentation
> nothing more

Depends on your code, but if you only want to to RANSAC on the Kinect,
you don't need ROS. Have a look into our tutorials:

http://pointclouds.org/documentation/tutorials/

Cheers Jochen
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Cmake problem

maxdd
to make it shorts and faster for you here's the part that i think it's a problem

  sensor_msgs::PointCloud2::Ptr cloud_blob (new sensor_msgs::PointCloud2);
  sensor_msgs::PointCloud2::Ptr cloud_filtered_blob (new sensor_msgs::PointCloud2);
 
  CloudPtr cloud_filtered (new Cloud);
  CloudPtr cloud_p (new Cloud);
  CloudPtr cloud_f (new Cloud);

  CloudPtr cloud_rotated (new Cloud);
 
  // Clear the view window
  viewer->setBackgroundColor(0,0,0);
  viewer->removeAllPointClouds();
// ====== Downsampling ============================

  pcl::toROSMsg (*cloud_r, *cloud_blob);
  //   Create the filtering object: downsample the dataset using a leaf size of 1cm
  pcl::VoxelGrid<sensor_msgs::PointCloud2> sor;
  sor.setInputCloud (cloud_blob);
  sor.setLeafSize (0.02f, 0.02f, 0.02f);
  sor.filter (*cloud_filtered_blob);

  // Convert to the templated PointCloud
  pcl::fromROSMsg (*cloud_filtered_blob, *cloud_filtered);

CMAKE gives error at the first line of code, then on pcl documentation i found

http://docs.pointclouds.org/1.7.0/structsensor__msgs_1_1_point_cloud2.html

which says #include <sensor_msgs/PointCloud2.h> which in this old project is not included, point is that there is no such header in the libpcl-all version, am i right? can i link it somehow?

One more thing, about the openni-dev error, is there any problem if i use the current release?
 
Reply | Threaded
Open this post in threaded view
|

Re: Cmake problem

Khalid Yousif

It really depends on where you are grabbing your kinect image. If your kinect image is recieved from ROS openni, then yes u need to convert it to a pcl::Pointcloud2 instead of sensor_msgs::PointCloud2 (thats what I am doing). But im pretty sure you there is a ln openni grabber in pcl

On 14/11/2013 10:33 PM, "maxdd" <[hidden email]> wrote:
to make it shorts and faster for you here's the part that i think it's a
problem

  sensor_msgs::PointCloud2::Ptr cloud_blob (new sensor_msgs::PointCloud2);
  sensor_msgs::PointCloud2::Ptr cloud_filtered_blob (new
sensor_msgs::PointCloud2);

  CloudPtr cloud_filtered (new Cloud);
  CloudPtr cloud_p (new Cloud);
  CloudPtr cloud_f (new Cloud);

  CloudPtr cloud_rotated (new Cloud);

  // Clear the view window
  viewer->setBackgroundColor(0,0,0);
  viewer->removeAllPointClouds();
// ====== Downsampling ============================

  pcl::toROSMsg (*cloud_r, *cloud_blob);
  //   Create the filtering object: downsample the dataset using a leaf size
of 1cm
  pcl::VoxelGrid<sensor_msgs::PointCloud2> sor;
  sor.setInputCloud (cloud_blob);
  sor.setLeafSize (0.02f, 0.02f, 0.02f);
  sor.filter (*cloud_filtered_blob);

  // Convert to the templated PointCloud
  pcl::fromROSMsg (*cloud_filtered_blob, *cloud_filtered);

CMAKE gives error at the first line of code, then on pcl documentation i
found

http://docs.pointclouds.org/1.7.0/structsensor__msgs_1_1_point_cloud2.html

which says #include <sensor_msgs/PointCloud2.h> which in this old project is
not included, point is that there is no such header in the libpcl-all
version, am i right? can i link it somehow?

One more thing, about the openni-dev error, is there any problem if i use
the current release?




--
View this message in context: http://www.pcl-users.org/Cmake-problem-tp4030743p4030767.html
Sent from the Point Cloud Library (PCL) Users mailing list mailing list archive at Nabble.com.
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Cmake problem

maxdd
 pcl::toPCLPointCloud2 (*cloud_r, *cloud_blob);
  //   Create the filtering object: downsample the dataset using a leaf size of 1cm
  pcl::VoxelGrid<pcl::PCLPointCloud2> sor;
  sor.setInputCloud (cloud_blob);
  sor.setLeafSize (0.02f, 0.02f, 0.02f);
  sor.filter (*cloud_filtered_blob);
 
  // Convert to the templated PointCloud
  pcl::fromPCLPointCloud2 (*cloud_filtered_blob, *cloud_filtered);

Here is how i corrected it (see 1st and last line), hope it has a sense... ill check it out with the kinect soon.. suggestion? and btw i dont want to use ROS openni since PCL has one
Reply | Threaded
Open this post in threaded view
|

Re: Cmake problem

Khalid Yousif
Then you do not have to use ROS. And the code looks correct. Hope it works.

regards,
Khalid


On 15 November 2013 00:12, maxdd <[hidden email]> wrote:
 pcl::toPCLPointCloud2 (*cloud_r, *cloud_blob);
  //   Create the filtering object: downsample the dataset using a leaf size
of 1cm
  pcl::VoxelGrid<pcl::PCLPointCloud2> sor;
  sor.setInputCloud (cloud_blob);
  sor.setLeafSize (0.02f, 0.02f, 0.02f);
  sor.filter (*cloud_filtered_blob);

  // Convert to the templated PointCloud
  pcl::fromPCLPointCloud2 (*cloud_filtered_blob, *cloud_filtered);

Here is how i corrected it (see 1st and last line), hope it has a sense...
ill check it out with the kinect soon.. suggestion? and btw i dont want to
use ROS openni since PCL has one



--
View this message in context: http://www.pcl-users.org/Cmake-problem-tp4030743p4030771.html
Sent from the Point Cloud Library (PCL) Users mailing list mailing list archive at Nabble.com.
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users


_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users