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

How do detect the point cloud is in front of you?

asked 2021-09-28 11:40:01 -0500

jjb1220 gravatar image

I can get the point cloud from velodyne.
but I need to get the point cloud that near velodyne or that infront of. so I watched the msg site but i don't still know.
Which message field indicates which point cloud is in front?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-09-28 15:25:08 -0500

chives_onion gravatar image

The pointcloud message doesn't encode a concept of 'in front'. The message header has a frame_id field that should correspond to a link element that exists within your robot description. If your robot is properly set up, you should be able to translate points from the stated reference frame (usually velodyne) to a frame that helps define the orientation of your whole robot (usually called base_link and defined with the convention REP 103).

You may want to check out this answer that has a bit of discussion and (potentially old) links for converting point clouds to x,y,z arrays.

To directly answer your question, you should check out VoxelGrid filtering. Given the REP 103 convention, you would want to use the filter to only output points that originated from in front (+x) of the robot. But this gets tricky if by 'in front' you mean (eg) the column of space from +x that's limited in the y dimension by the wheel dimensions: here you could do a pipeline of filters cutting off the x and then y dimensions. If 'in front' means a cone of space originating from the robot (say, to match the view of an on-board camera) then this simple filter won't be adequate.

You could also convert your pointcloud to one of the many mapping modules provided by the community. For instance, octomap encodes pointcloud packets into positioned voxels that are more easily queried for occupancy. This really depends on what your overall application is and what you actually need to do with your pointcloud.

edit flag offensive delete link more

Comments

This answer may help #q230680

osilva gravatar image osilva  ( 2021-09-28 15:30:20 -0500 )edit

at fist, I'll start with links for converting point clouds to x,y,z arrays. Thanks so much for the detailed explanation :)

jjb1220 gravatar image jjb1220  ( 2021-09-28 19:22:09 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-09-28 11:40:01 -0500

Seen: 124 times

Last updated: Sep 28 '21