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

Visualize science data as points #88

Merged
merged 32 commits into from
Dec 23, 2021
Merged

Visualize science data as points #88

merged 32 commits into from
Dec 23, 2021

Conversation

chapulina
Copy link
Contributor

@chapulina chapulina commented Nov 20, 2021

Part of

Builds on top of

Requires

Nice to have


This PR changes the science data visualization from boxes to points, which brings these advantages:

  • No need for performance hacks or hiding part of the data, since points are very efficient
  • Therefore, we can see all data at once
  • Points are scaled the same no matter how far they are. This allows us to see data that's kilometers away. It can be hidden adjusting the camera clipping distance as needed.

Tasks

  • Remove all performance hacks - I'm debugging against all the data we have to see if we can get rid of all hacks. May need to bring some of them back if performance can't be improved without them. No hacks are needed 😄
  • Use multiple points in one marker instead of multiple markers, each with one box
  • Configure point size
  • Set an initial camera clip that visualizes data far away, and add ViewAngle to the world so we can easily change the clip at runtime
  • Set color per-point
  • The coordinates seem swapped, look into what's happening (edit: those were screenshots from an old branch, the latest branch looks right.

Future

  • Visualize currents

Nice-to-have:

  • Better mouse control at far distances
  • Camera clipping for orthographic
  • Ogre 1 per-point coloring
  • Look into using a color palette with more colors

pc_viz1

100kpts_colors

Here's the data with the axes added in #104 , left is ENU, right is NED:

data_with_axes

minmaxcolor

@chapulina chapulina self-assigned this Nov 23, 2021
This was referenced Nov 24, 2021
@chapulina chapulina changed the base branch from main to mabelzhang/science_viz November 24, 2021 22:47
@chapulina chapulina force-pushed the chapulina/marker_debug branch 2 times, most recently from e1eecdd to 6a353c1 Compare November 30, 2021 04:57
@chapulina chapulina changed the base branch from mabelzhang/science_viz to chapulina/science_latlon November 30, 2021 04:57
@chapulina chapulina changed the title Improvements to science data visualization Visualize science data as points Nov 30, 2021
@chapulina chapulina marked this pull request as ready for review November 30, 2021 20:27
Base automatically changed from chapulina/science_latlon to main December 3, 2021 19:37
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
…nce, grid improvements

Signed-off-by: Louise Poubel <louise@openrobotics.org>
@chapulina chapulina changed the base branch from main to chapulina/garden December 7, 2021 23:06
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Base automatically changed from chapulina/garden to main December 18, 2021 04:39
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Copy link
Collaborator

@mabelzhang mabelzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The visualization works.

There is, however, a black dot at exactly the origin for all the topics. I see it in your animation too. Is it by design, to help find the origin?

It overlaps with the actual marker at the origin, so the color of the actual marker (see below) isn't visible.

In case it's not by design, I looked in the following places and couldn't find where it comes from.

There isn't a marker with any of RGB components <= 0:

    if ((color.R() < 1e-6) &&
      (color.G() < 1e-6) &&
      (color.B() < 1e-6))
    { 
      ignerr << color << std::endl;
    }

The marker at the origin is not black:

    if ((fabs(*iterX) < 1e-6) &&
      (fabs(*iterY) < 1e-6) &&
      (fabs(*iterZ) < 1e-6))
    { 
      ignerr << color << std::endl;
    }
[GUI] [Err] [VisualizePointCloud.cc:396] 0.530241 0.469759 0 1

If I skip the origin, the black dot is still there:

    if ((fabs(*iterX) < 1e-6) &&
      (fabs(*iterY) < 1e-6) &&
      (fabs(*iterZ) < 1e-6))
      continue;

I looked at whether it has anything to do with marker ID 0 (the DELETE_ALL) one. It doesn't seem to be, in that if I use the same ID for both the marker array and the delete marker, it didn't make any difference.

I tried adding isinf() to the existing isnan() clause, but that didn't get rid of the black dot.

lrauv_ignition_plugins/worlds/buoyant_tethys.sdf Outdated Show resolved Hide resolved
@chapulina
Copy link
Contributor Author

There is, however, a black dot at exactly the origin for all the topics. I see it in your animation too. Is it by design, to help find the origin?

Ha, glad that you found a use for it. And thanks for the debugging! It was a bug, fixed in gazebosim/gz-rendering#519

Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
@chapulina chapulina changed the base branch from main to chapulina/grid December 21, 2021 21:54
@chapulina
Copy link
Contributor Author

Base automatically changed from chapulina/grid to main December 22, 2021 04:53
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
@chapulina
Copy link
Contributor Author

I look into why CI is hanging on this branch

Signed-off-by: Louise Poubel <louise@openrobotics.org>
@chapulina chapulina changed the base branch from main to chapulina/barycentric_segfault December 22, 2021 05:37
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Copy link
Collaborator

@mabelzhang mabelzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bye 2021

Base automatically changed from chapulina/barycentric_segfault to main December 23, 2021 04:36
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
@chapulina chapulina merged commit d3d77b0 into main Dec 23, 2021
@chapulina chapulina deleted the chapulina/marker_debug branch December 23, 2021 05:34
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

Successfully merging this pull request may close these issues.

2 participants