Ask Your Question

How to visualize surface normals as Marker::Arrow for each point in rviz?

asked 2011-02-16 03:13:22 -0500

updated 2011-02-16 03:13:41 -0500


I would like to show the surface normals of a point cloud in rviz. Below is what I was trying:

  • Create a MarkerArray and corresponding publisher
  • Resize the MarkerArray with the size of the point cloud to be visualized (25344 points in this case) at the very first
  • Assign frame_id, ns, id, type, action, color for each marker just once
  • update position of the arrows with the point cloud at each iteration
  • update markers scales with the point cloud normal data at each iteration
  • publish the markerarray

Whenever it publishes the markerarray, RAM blows up and swap is heavily used and PC stalls there.

What do you think I am doing very badly wrong here? Or isn't it possible to visualize that many arrows (25344 of them) in the rviz? If so, should I use other tools coming with PCL?

Thanks a lot...


edit retag flag offensive close merge delete



Hi Kadir, we did it with MarkerArray message but it also choked up rviz a bit. You can have a look at our code here: D.

dejanpan gravatar image dejanpan  ( 2011-02-17 04:00:30 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2011-02-16 13:00:21 -0500

It is very likely that rviz chokes up because of the amount of markers. I think each arrow is a separate 3D object. I would recommend using the pcl visualization tool:

You can use the existing PointNormal data type, defined here:

Since you already have the algorithm to calculate the normals, all you have to do is build a pcl cloud and fill out the fields. Here's the nice part about using pcl - you can set how many normals you want to display - for example, one every 10 or 20 points. This should make it much quicker.

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

1 follower


Asked: 2011-02-16 03:13:22 -0500

Seen: 4,830 times

Last updated: Feb 17 '11