0
$\begingroup$

Rosanswers logo

I am working with a 3d lidar 360 degrees lidar. On the robot there are some other sensors and accessories. The sensor scans these objects as well and ros navigation stack treats these objects as an obstacle and never works. I was wondering is there any of filtering the point cloud to some given angles like 0 to 270 as the similar option is available here for pointcloud to laserscan?

I have checked the pcl_ros package and its example filter but I am not able understand which one solves my current problem or which one to use for this issue?

Any leads on the issue are highly appreciated.


Originally posted by Tahir M. on ROS Answers with karma: 213 on 2021-08-18

Post score: 0


Original comments

Comment by gvdhoorn on 2021-08-19:\

I was wondering is there any of filtering the point cloud to some given angles like 0 to 270 as the similar option is available here for pointcloud to laserscan?

what are you using now if not something which converts pointclouds to a LaserScan message? Afaik the navigation stack cannot directly consume pointclouds.

Comment by Tahir M. on 2021-08-19:
At the moment laserscan after filtering. I used pointclouds directly with Navigation Stack and it takes the pole on the robot as an obstacle and never moves. That's the reason I want to filter pointcloud.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I think you can implement this just by iterating through the points and checking points direction with atan2.

Let’s say that you will like to filter points in between theta1 and theta2. Then simply iterate through each point and perform a check;

If(theta1 <= atan2(point.y, point.x) <= theta2) {
  //  Skip this point } else { 
  Filteredcloud.points.push_back(point) } 

Note that this code has not been tested and is provided only for illustrating an possible solution


Originally posted by Fetullah Atas with karma: 819 on 2021-08-18

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Tahir M. on 2021-08-20:
Thank you this lead solve my issue.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.