Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to show Point Cloud from ROS PointCloud2 coming from "camera/depth/color/points" topic in Unity

Discussion in 'Robotics' started by GerenMeric, Jun 2, 2023.

  1. GerenMeric

    GerenMeric

    Joined:
    May 15, 2023
    Posts:
    47
    Hello there,

    This question is related to this Thread i opened: " https://forum.unity.com/threads/dis...35-in-unity-through-ros.1443448/#post-9050638 ". I want to get point clouds from a D435 camera plugged to a pc then, through ROS to send it to another computer in same local network and finally, display the point cloud in Unity.

    Now, i can publish point clouds to unity on another computer via "/camera/depth/color/points" ROS topic and subscribe to the topic from the computer where Unity is (thanks to ROS TCP Endpoint and ROS TCp Connector packages from Unity Robotics Hub). I know that the topic i have mentioned sends messages in the type "sensor_msgs/PointCloud2Msg". Also, when i run the the C# ROS subscriber code i have wrote i can see that i get points and be able to show field info for each point i get. But, i can't see any pointcloud on Scene view. So i wonder:

    How can i use ROS PointCloud2 coming from "camera/depth/color/points" topic in Unity to display point cloud?

    Thanks in advance,

    Kindest Regards.

    Update: Now, i can see the pointcloud in the Scene view. But, when i switch to Game view, i see it only renders things far from the camera and in even then, in a heavily distorted manner and it shows the colors only with UI and GUI shaders. When i try to use Standard shader with
    material.EnableKeyword("_VERTEXCOLOR");
    it shows it in single color (light pink)
     
    Last edited: Jun 6, 2023
    seifmostafa7347 likes this.
  2. Leonaliu52

    Leonaliu52

    Joined:
    Jun 7, 2023
    Posts:
    2
    I encounter the same problem. How to see the pointcloud in the Scene view? Are you making progress?