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

Filtering Pointcloud with min and max angles

asked 2021-08-18 11:39:51 -0600

Tahir M. gravatar image

updated 2021-08-18 11:41:51 -0600

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.

edit retag flag offensive close merge delete

Comments

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.

gvdhoorn gravatar image gvdhoorn  ( 2021-08-19 02:15:12 -0600 )edit

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.

Tahir M. gravatar image Tahir M.  ( 2021-08-19 02:55:44 -0600 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2021-08-18 16:29:42 -0600

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

edit flag offensive delete link more

Comments

Thank you this lead solve my issue.

Tahir M. gravatar image Tahir M.  ( 2021-08-20 01:43:01 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2021-08-18 11:39:51 -0600

Seen: 525 times

Last updated: Aug 18 '21