procedural generation of models/geoms to visualize laser

I am trying to use Panda to visualize some data from a laser rangefinder mounted on a mobile robot. Right now, I am thinking of using the GeomTrifans primitive procedurally generate the models, but I may be misunderstanding what Geoms are supposed to be used for, and there may be a better way to do what I want to do, so I thought I would ask here.

A 2d representation of what I’d like to do is shown below. The robot (red dot) is an real environment with walls (the black lines). It uses the laser rangefinder to take radial distance measurements every degree or so and send them to my system. (These measurements are represented as the blue field around the robot in 2d.) I have models of the robots with the laser sensors mounted on them in Panda, but I do not have any prior knowledge of where the walls are, so I would like to visualize the laser data in 3d in the same sort of “halo” as in the 2d representation.

As I said above, I’m thinking of procedurally generating the “halo” with geom trifans, with the first vertex on the robot and each subsequent vertex placed so that it represents one distance reading, but I’m afraid that there is an easier/more appropriate way. Is there? Are there sections of the manual or documentation I should be reading before I start?


A permanent link to the images:

Sounds interesting. Assuming your laser ranger finder will have an accuracy to 1 degree and rotating 360 degrees in several seconds, your robot is also moving. May be it is easier to use just 360 narrow cube boxes, place them according to your range finder data, updating their positions if they are in range, hide them if out of range. Then you will have a 3D view of a rough representation.

Or you could use a shader, which will be faster, but then the results won’t be permanent (if you reposition the robot, the old stuff doesn’t count anymore)

Thanks a lot for the suggestions.

Clcheung, if I understand you correctly, I think I plan on doing what you described at some point. It certainly sounds easier than the “halo” visualization, but I’ve been given a specification, so I think I need to do it this way first.

I looked into writing my own shader, but since I’ve never done that before, it might not be worth it to learn Cg unless it would make writing the actual visualization extremely easy.

So unless anyone thinks I’m walking myself off a cliff of hopelessness here, I think I’m going to dive in with the trifans and then try the cubes if the trifans prove too difficult. Thanks again for the advice!

I am also not sure if I understand your requirement right. But if you want low level geometry drawing in panda, you can download demomaster and look into the “Geometry - Create various geometries”, there are a few samples.

Since your data will be quite dynamic, may be a shader or position the dynamic cubes are better choices ?

Wow. I just downloaded the demomaster. It’s quite incredible. I just started looking at the modules you suggested, and I will definitely study them in depth before I try to do anything more. Thanks a lot! I think this will be a huge help.