ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Tried Normal Distributions Transform with my own files (in correct PCD format) and it throws errors

asked 2014-05-29 11:44:07 -0500

Athoesen gravatar image

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

I've used this program with the sample PCD's given and it came out correctly. This was confirmed by experienced users on here. Now I'm trying to use my own pcd's. I didn't want to bother changing the program so I just changed the names to room_scan1 and room_scan2. When I attempt to use them, I get this error:

Loaded 307200 data points from room_scan1.pcd Loaded 307200 data points from room_scan2.pcd Filtered cloud contains 1186 data points from room_scan2.pcd normal_distributions_transform: /build/buildd/pcl-1.7-1.7.1/kdtree/include/pcl/kdtree/impl/kdtree_flann.hpp:172: int pcl::KdTreeFLANN<PointT, Dist>::radiusSearch(const PointT&, double, std::vector<int>&, std::vector<float>&, unsigned int) const [with PointT = pcl::PointXYZ, Dist = flann::L2_Simple<float>]: Assertion `point_representation_->isValid (point) && "Invalid (NaN, Inf) point coordinates given to radiusSearch!"' failed. Aborted (core dumped)

This is the program I compiled: http://robotica.unileon.es/mediawiki/...

Before you suggest it, I will let you know I already changed all of the PointXYZRGBA designations to just PointXYZ. It threw the same error before and after doing this. The thing that confuses me is that I looked at my produced PCD files and they seem to be exactly the same as the samples given for NDT.

Mine:

2320 2e50 4344 2076 302e 3720 2d20 506f
696e 7420 436c 6f75 6420 4461 7461 2066
696c 6520 666f 726d 6174 0a56 4552 5349
4f4e 2030 2e37 0a46 4945 4c44 5320 7820
7920 7a0a 5349 5a45 2034 2034 2034 0a54
5950 4520 4620 4620 460a 434f 554e 5420
3120 3120 310a 5749 4454 4820 3634 300a
4845 4947 4854 2034 3830 0a56 4945 5750
4f49 4e54 2030 2030 2030 2031 2030 2030
2030 0a50 4f49 4e54 5320 3330 3732 3030
0a44 4154 4120 6269 6e61 7279 0a00 00c0
7f00 00c0 7f00 00c0 7f00 00c0 7f00 00c0

Sample from NDT page:

2320 2e50 4344 2076 302e 3720 2d20 506f
696e 7420 436c 6f75 6420 4461 7461 2066
696c 6520 666f 726d 6174 0a56 4552 5349
4f4e 2030 2e37 0a46 4945 4c44 5320 7820
7920 7a0a 5349 5a45 2034 2034 2034 0a54
5950 4520 4620 4620 460a 434f 554e 5420
3120 3120 310a 5749 4454 4820 3131 3235
3836 0a48 4549 4748 5420 310a 5649 4557
504f 494e 5420 3020 3020 3020 3120 3020
3020 300a 504f 494e 5453 2031 3132 3538

Does anyone have any ideas?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-05-29 20:42:56 -0500

sai gravatar image

I am not sure why, but i am not able to access pointclouds.org or either their tutorials...As far as I remember the tutorial..I ll try to get this solved for you.

It can be seen that you are trying to give kinect point clouds. In the PCL tutorial , the inputs are filtered/sampled so that less number of points can be processed to reduce the computational time. They use a voxel grid/approximate filter with a leaf size of 0.1 meter, i guess. This wont be meaningful for Kinect point clouds. A leaf size of 0.01 meter is the best you can keep for kinect point clouds.

This should leave you with enough points for other modules to work. Next, the Kdtree is using a radius search and not able to find any neighbor in that radius and I think thats the cause of the error. If there is any parameter for normal estimation or nearest neighbor, try to give it as 0.05 m.

You have to go through the PCL tutorial carefully to change the parameters according to the point clouds you give as the input.

There is also an initial guess given to NDT in the PCL tutorial. They get the guess from odometry which is a good estimate. In your case, first I would ask you capture a first point cloud, translate the kinect by 15 cm and then capture another point cloud. GIven an initial estimate as some value in 10 - 20 cm range and see if it works. Then, see if it works with out initial guess at all. Without any guess, it can estimate small transformations only i guess (I am not sure)

Hope this helps!

Good day!

edit flag offensive delete link more

Comments

1

I think they use 0.2 by 0.2 by 0.2. That's what the tutorial says. So I should change each to 0.01. I also changed the initial guess to a 0 angle for rotation and 0.2, 0, 0 for translation. Other people have pointed out the NAN error is there for the kdtree so I'm going to resolve that as well.

Athoesen gravatar image Athoesen  ( 2014-05-30 12:06:52 -0500 )edit

give 0.2,0,0 as a guess if the actual transformation between the clouds is around that value or else do not do that.

sai gravatar image sai  ( 2014-05-30 17:35:43 -0500 )edit

It looks like it can use ASCII format PCD files but it doesn't converge to a solution. I'm assuming this is because it is taking too long. Should I convert to that binary format as displayed above? If so, how? Tried Googling, very few good answers.

Athoesen gravatar image Athoesen  ( 2014-06-04 16:02:18 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-05-29 11:44:07 -0500

Seen: 1,489 times

Last updated: May 29 '14