Ask Your Question

transformLaserScanToPointCloud usage problem.

asked 2012-07-27 02:34:19 -0500

Hyon Lim gravatar image

updated 2014-07-15 19:21:23 -0500

Angus gravatar image

Hi. I'm trying to de-rotate (project) LaserScan message using IMU. p_base_frame_ is a string "base_stabilized". scan is scan message. const sensor_msgs::LaserScan& scan. sensor_msgs::PointCloud laser_point_cloud_; tf::TransformListener tf_;

Following is successful.

tf::StampedTransform laserTransform; tf_.lookupTransform(p_base_frame_,scan.header.frame_id, scan.header.stamp , laserTransform);

But, following is not successful.

transformLaserScanToPointCloud(p_base_frame_ , scan, laser_point_cloud_, tf_);

I don't know why. It basically find same transformation which is "base_stabilize" to "laser". It exist. I confirmed by "rosrun tf view_frame".

edit retag flag offensive close merge delete



Saying just '.. is not successful' makes it hard to infer what's going wrong. Please always post the complete error message and make sure you have a look at the support guidelines:

Lorenz gravatar image Lorenz  ( 2012-07-27 02:39:13 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-07-15 16:30:35 -0500

Angus gravatar image

updated 2014-07-15 16:31:07 -0500

It appears that in the transformLaserScanToPointCloud function a lookupTransform is called at time:

scan_in.header.stamp + ros::Duration ().fromSec (scan_in.ranges.size () * scan_in.time_increment)

My quick-fix solution was to call waitForTransform and include that added time before calling transformLaserScanToPointCloud.


edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools


Asked: 2012-07-27 02:34:19 -0500

Seen: 1,112 times

Last updated: Jul 15 '14