Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PointCloud2 is not displayed correctly #249

Open
cmperezg opened this issue Jan 24, 2019 · 5 comments
Open

PointCloud2 is not displayed correctly #249

cmperezg opened this issue Jan 24, 2019 · 5 comments

Comments

@cmperezg
Copy link

Hello
I've built an app to display sensor data from a robot, but I can't get PointClouds to display correctly. LaserScans work without issue, so I'm quite sure the structure of my code is fine. This is the configuration I am trying to display:

{
        "type" : "Grid",  
        "config" : {
            "size" : 2,
            "color" : "#707070",
            "lineWidth" : 0.01
        }
    },
    {
        "type" : "PointCloud2",  
        "config" : {
            "topic" : "/camera_left/depth/points",
            "material" : { "size": 0.3, "color": "#e8a010" }
        }
    },
    {
        "type" : "PointCloud2",  
        "config" : {
            "topic" : "/camera_right/depth/points",
            "material" : {"size": 0.3, "color": "#e87c10" }
        }
    }

The tfClient is added later, and the config is handled by a parser.

However, the point cloud is displayed very weirdly. here is a screenshot:

ros3d_pointcloud

Here is an rviz screenshot of the same rosbag playing, subscribing to the exact same topics:
rviz_pintcloud

Why is it being flattened out this way? Am I missing something in the configuration? Is it even possible to display more than one point cloud at once? I had no issues displaying several laser scans.
After a few seconds this starts to lag like crazy too, but that is a separate issue and I see there is a ticket for it already.

Any help with this issue would be greatly appreciated.

@mvollrath
Copy link
Contributor

Can you paste the contents of the "fields" (PointField list) for a frame of this cloud? We've seen issues with some non-standard field layouts.

@cmperezg
Copy link
Author

Hi @mvollrath , thanks for your reply.

Here are the fields for a frame:

- 
  name: "x"
  offset: 0
  datatype: 7
  count: 1
- 
  name: "y"
  offset: 4
  datatype: 7
  count: 1
- 
  name: "z"
  offset: 8
  datatype: 7
  count: 1
---

@cmperezg
Copy link
Author

This was not a bug. The problem was that I was not aware that a point limit was being set by default. setting max_pts to 200000 fixed the problem for me.

@Kad91
Copy link

Kad91 commented Jul 30, 2019

Another question About PointCloud2. It looks like that when max_pts (name it N) is selected, only the N first points are displayed. Is there a way to display N points choosing them ( for example every 2 points ) ?

@mvollrath
Copy link
Contributor

@Kad91 Use pointRatio for that kind of subsampling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants