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

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

Hi,

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...

-Kadir-

edit retag flag offensive close merge delete

Comments

1

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: http://code.cs.tum.edu/indefero/index.php//p/mapping/source/tree/master/pcl_cloud_tools/src/pcl_normal_visualization.cpp D.

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

The above link doesn't work. Any chance you still have this somewhere?

chinmay_sujir gravatar image chinmay_sujir  ( 2023-01-11 08:51:35 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

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:

http://www.ros.org/wiki/pcl_visualization

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

http://www.ros.org/doc/api/pcl/html/point__types_8h_source.html

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

Question Tools

1 follower

Stats

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

Seen: 5,526 times

Last updated: Feb 17 '11