Pcx icon indicating copy to clipboard operation
Pcx copied to clipboard

Added properties to access point and disk shader

Open nicolapiccinelli opened this issue 6 years ago • 2 comments

I've extended your project to render a point cloud received in realtime from ROS. During the creation of that point cloud the point and disk shaders need to be set programmatically. To do so, two public properties are added to the PointCloudRenderer.

nicolapiccinelli avatar May 16 '18 18:05 nicolapiccinelli

I've extended your project to render a point cloud received in realtime from ROS. During the creation of that point cloud the point and disk shaders need to be set programmatically. To do so, two public properties are added to the PointCloudRenderer.

Hi @nicolapiccinelli , could you please elaborate on the process for visualizing point clouds in realtime from ROS?

akashcastelino avatar Mar 24 '19 19:03 akashcastelino

Hi @akashcastelino, basically the visualization process mainly relies on ROS# and rosbridge_suite in order to stream the ROS messages PointCloud2 inside Unity3D.

To do so I've written a class PointCloudReceiver which implements the ROS# MessageReceiver base class and at each new message callback the point cloud was converted from the ROS PointCloud data structure to your PointCloudData class. The converted data fills the sourceData property of your renderer.

It's no more than an experiment, I'm attaching the main files that you need to try to run the example. The main issue that i founded was that the conversion between the PoinCloud2 data structure and the arrays used inside PointCloudData which is really time taking.

Should be interesting to write a specific shader in order to copy directly the plain raw data from the ros message on the GPU and see how much the performaces will increase.

I'm attaching the Assets of the project, the involved files are:

  1. PointCloudData: I've added a overloading method for the initialization
  2. PointCloudReceiver: The point cloud receiver extension for ROS#
  3. PointCloudManager: The manager which instantiate the PointCloudRenderer and load the data
  4. PCloud: Which actually a mod of the PointCloud2 class but it's useless right now

The Unity scene is called PoinCloudViewer. Sorry if there are some missing information but I've no more work on it :). Anyway if you need any further information let me know!

Assets.zip

nicolapiccinelli avatar Mar 25 '19 16:03 nicolapiccinelli