Gazebo resources: Tutorials | Q&A | Documentation | Blog

Creating a labeled point cloud in gazebo

hey,

i am trying to generate point cloud messages that not only contain 3D point information but also information on the belonging object class/category(e.g. Wall, Table, Chair, Door) for each point.

I thought about creating a custom ros message that in a addition to the pc2-msg would contain an int array indexed just like the pc2. in gazebo i thought i indicate the class of an object model in the sdf file via an additional parameter “class” valued with an int. as a last step i would then need to write plugins for the models to contain this information but also a plugin for the sensor that creates this message.

the problem seems to be that i cannot handle the process of laserscan creation (the actual ray reading/interpretation) myself. which makes this “elegant” solution difficult without build gazebo from sources and adding this functionality.

am i right?

gazebo features intensity for each ray on an object and i could use this as a work around like so: https://ieeexplore.ieee.org/document/… (scientific paper)

still i don’t think it is an elegant solution to the problem… thoughts?

Hi @MaxMax ,

All the various custom code that you said you’ll need sound correct to me.

I assume you’re using Gazebo classic, right? (probably version 9 or 11) Also, assuming that you’ll be creating a rendering laser sensor (GPU ray), as opposed to one handled by physics.

I think you could store the information on the model visual using Ogre’s setUserAny.

You could write a plugin that casts several RayQuery's and gets that custom “user any” data from the intersected visuals, as well as the rest of the point cloud data.


Just some high-level ideas, hope it helps you out.