merging two different pointcloud2 with tf

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

merging two different pointcloud2 with tf

fatihx
Hi,

i followed concatenate clouds tutorial at this link and tried to merge two pointclouds with different tf.  http://pointclouds.org/documentation/tutorials/concatenate_clouds.php
pcl::PointCloud<pcl::PointXYZ> cloud_a, cloud_b, cloud_c;
cloud_c = cloud_b;
cloud_c += cloud_a;

result: TF (which in ros) of output pointcloud2 is not right. It takes one of the pointclouds..
for example i ve fixed angle input and a moving angle. and the output comes with the first addition.    
i am pleased to hear any advice/hint..

thanks in advance,
fatih
Reply | Threaded
Open this post in threaded view
|

Re: merging two different pointcloud2 with tf

Radu B. Rusu
Administrator
Solution: simply transform the clouds to be in the same coordinate system first, before applying concatenation.

Best,
Radu.

On Sep 6, 2013, at 10:36 AM, fatihx <[hidden email]> wrote:

> Hi,
>
> i followed concatenate clouds tutorial at this link and tried to merge two
> pointclouds with different tf.
> http://pointclouds.org/documentation/tutorials/concatenate_clouds.php
> pcl::PointCloud<pcl::PointXYZ> cloud_a, cloud_b, cloud_c;
> cloud_c = cloud_b;
> cloud_c += cloud_a;
>
> result: TF (which in ros) of output pointcloud2 is not right. It takes one
> of the pointclouds..
> for example i ve fixed angle input and a moving angle. and the output comes
> with the first addition.    
> i am pleased to hear any advice/hint..
>
> thanks in advance,
> fatih
>
>
>
> --
> View this message in context: http://www.pcl-users.org/merging-two-different-pointcloud2-with-tf-tp4029529.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: merging two different pointcloud2 with tf

fatihx
thx for your reply..

i created a global transform listener ;
tf::TransformListener* tf_listener = NULL;

then at each subscribe tranformed my cloud at the same axis and converted it to pcl ;
pcl_ros::transformPointCloud("/odom", *input, pcl_out1, *tf_listener);
pcl::fromROSMsg(pcl_out1, cloud_a);

pcl_ros::transformPointCloud("/odom", *input2, pcl_out2, *tf_listener);
pcl::fromROSMsg(pcl_out2, cloud_b);

then added both clouds in other function and publish;
cloud_c = cloud_b;
cloud_c += cloud_a;
pcl::toROSMsg(cloud_c,output);
pub.publish (output);

Now it compiles without problem and works also if i dont give any cloud as input..
when there is my two cloud input, my program doesnt run at all it says ;

"segmentation fault (core dumped)"

what can cause it ?

Reply | Threaded
Open this post in threaded view
|

Re: merging two different pointcloud2 with tf

Jochen Sprickerhof
Administrator
* fatihx <[hidden email]> [2013-09-10 03:40]:
> "segmentation fault (core dumped)"
>
> what can cause it ?

Usually a null pointer, use a debugger to find out ;).

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

Re: merging two different pointcloud2 with tf

fatihx
i have added following line and now it works

tf_listener->setExtrapolationLimit(ros::Duration(0.1));

but it occurs sometimes following problem;
http://i.imgur.com/8AeUup7.png

and what i get as sum cloud is very laggy and not fast enough..
http://i.imgur.com/69xwkG1.png

it seems also at this picture my kinect clouds is stable there. but some laser scanner(tilting 180 degree)clouds are always missed. if i assamble just laserscanner clouds it seems very good buth combination with kinect is terrible..

i have also tried to take not each kinect clouds, then it works as sum litle bit faster but it doesnt useful for my mapping package..

how can i make the process faster and with better resolution ?