ros-perception / pointcloud_to_laserscan

Converts a 3D Point Cloud into a 2D laser scan.
http://wiki.ros.org/pointcloud_to_laserscan
BSD 3-Clause "New" or "Revised" License
405 stars 277 forks source link

high cpu usage #9

Closed zhengzh closed 7 years ago

zhengzh commented 7 years ago

tf2_->transform(cloud_msg, cloud, targetframe, ros::Duration(tolerance)); high cpu usage --

jonbinney commented 7 years ago

How many points are in the point cloud you are transforming? How often are you transforming it? What CPU are you on? What ROS distro are you on?

zhengzh commented 7 years ago

@jonbinney 640*480 points, ubuntu 16.04, kinect v1 (30fps), thinkpad t440p (i7 cpu) the fps drop down to about 0.6 fps When executing this line of code 30(fps) when i comment it out. I don't know why tf2_->transform is so slow

paulbovbel commented 7 years ago

Tf2 will transform every single point in the cloud. I've found it helpful to run the point cloud through a PCL voxel filter first.

Transforming the point cloud is an expensive operation. If you don't need the transform, don't provide a target frame, or better yet, use depthimage_to_laserscan.

zhengzh commented 7 years ago

@paulbovbel thanks! I need to transform the point cloud from kinect_link to base_link, i will try pcl library,