Std::out_of_range during cluster extraction

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

Std::out_of_range during cluster extraction

Saphrosit
Hi,
I followed this tutorial for cluster extraction. I just copy-paste the code on the webpage and compiled it.
When I try to launch the executable I get as error:

 terminate called after throwing an instance of 'std::out_of_range'
   what():  vector::_M_range_check
 Aborted

The error should be at the line

  reader.read ("table_scene_lms400.pcd", *cloud);

because I don't see the "PointCloud before filtering has: ..." message. The file table_scene_lms400.pcd is the one suggested in the tutorial, placed in the same directory as the executable.

What may be the problem? I'm using Ubuntu 11.10 on VMWare, pcl 1.5.

Reply | Threaded
Open this post in threaded view
|

Re: Std::out_of_range during cluster extraction

Radu B Rusu
Administrator
Did you find a fix for your problem?

Cheers,
Radu.

On 06/17/2012 08:13 AM, Saphrosit wrote:

> Hi,
> I followed
> http://pointclouds.org/documentation/tutorials/cluster_extraction.php#cluster-extraction
> this  tutorial for cluster extraction. I just copy-paste the code on the
> webpage and compiled it.
> When I try to launch the executable I get as error:
>
>   terminate called after throwing an instance of 'std::out_of_range'
>     what():  vector::_M_range_check
>   Aborted
>
> The error should be at the line
>
>    reader.read ("table_scene_lms400.pcd", *cloud);
>
> because I don't see the "PointCloud before filtering has: ..." message. The
> file table_scene_lms400.pcd is the one suggested in the tutorial, placed in
> the same directory as the executable.
>
> What may be the problem? I'm using Ubuntu 11.10 on VMWare, pcl 1.5.
>
>
>
> --
> View this message in context: http://www.pcl-users.org/Std-out-of-range-during-cluster-extraction-tp4019382.html
> Sent from the Point Cloud Library (PCL) Users 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: Std::out_of_range during cluster extraction

Saphrosit
The only solution I found up to now is not to use at all that file.

I acquired a sensor_msgs::PointCloud2 using a simulated kinect in gazebo, then I converted it into a pcl::PointCloud<pcl::PointXYZ> and I stored it in a pcd.

Reading the saved pcd with the code at the tutorial worked fine (I had to comment all the code relative to the plane segmentation however).

It's only a workaround, but for the moment I can continue my work...
Reply | Threaded
Open this post in threaded view
|

Re: Std::out_of_range during cluster extraction

Radu B Rusu
Administrator
So you're using the tutorial code with two PCD files: lms400 (doesn't work) and yours (works). Did I understand this
correctly?

The file in question works fine on my system:

$ ./cluster_extraction table_scene_lms400.pcd
PointCloud before filtering has: 460400 data points.
PointCloud after filtering has: 41049 data points.
PointCloud representing the planar component: 20536 data points.
PointCloud representing the planar component: 12442 data points.
PointCloud representing the Cluster: 4857 data points.
PointCloud representing the Cluster: 1386 data points.
PointCloud representing the Cluster: 321 data points.
PointCloud representing the Cluster: 291 data points.
PointCloud representing the Cluster: 123 data points.


Make sure you have downloaded it from http://svn.pointclouds.org/data/tutorials/, and make sure its size is: 17492958 bytes.

Cheers,
Radu.

On 06/20/2012 08:01 AM, Saphrosit wrote:

> The only solution I found up to now is not to use at all that file.
>
> I acquired a sensor_msgs::PointCloud2 using a simulated kinect in gazebo,
> then I converted it into a pcl::PointCloud<pcl::PointXYZ>  and I stored it in
> a pcd.
>
> Reading the saved pcd with the code at the tutorial worked fine (I had to
> comment all the code relative to the plane segmentation however).
>
> It's only a workaround, but for the moment I can continue my work...
>
> --
> View this message in context: http://www.pcl-users.org/Std-out-of-range-during-cluster-extraction-tp4019382p4019485.html
> Sent from the Point Cloud Library (PCL) Users 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: Std::out_of_range during cluster extraction

Saphrosit
Ok, that was the error!

I downloaded the file doing copy-paste from the browser, didn't notice the download of the file was not complete. Using the correct file it worked.

It turned out to be a really stupid problem. Sorry for making you waste time and thank you for your patience.
Reply | Threaded
Open this post in threaded view
|

Re: Std::out_of_range during cluster extraction

Mudassir Khan
I am getting the same error when i try to run http://pointclouds.org/documentation/tutorials/correspondence_grouping.php#correspondence-grouping for my own generated model and scene pcd filesfrying_pan.pcd. attached is sample pcd file for a frying pan i generated. any suggestion ?
Reply | Threaded
Open this post in threaded view
|

Re: Std::out_of_range during cluster extraction

Mudassir Khan
ok i run the same pcd files but selected --algorithm GC instead of default Hough and it generated result without error. Although the results were not as good as I expected but at least it didn't fail with an error. Any idea what could be the problem