cartographer-project / point_cloud_viewer

View billions of points in your browser.
Apache License 2.0
339 stars 98 forks source link

Camera of SDL Viewer works with ECEF #252

Closed catevita closed 5 years ago

catevita commented 5 years ago

by adding the input parameter --ecef it is possible to start the viewing hovering over palo alto and by pressing G it realigns the point of view with the earth center ("gravity")

the camera structure had redundant member variables for expressing the angles and this has been cleaned up with an eye on backward compatibility.

catevita commented 5 years ago

PTAL @nnmm fyi @SirVer

nnmm commented 5 years ago

Summarizing what we talked about offline: It would be great if the point cloud couldn't tilt in weird ways, like the local point clouds. That is, have only two degrees of freedoms (pitch and yaw) wrt. the ground plane.

At a high level, I see two possible approaches:

It seems to me that the first is simpler and more flexible. What do you think?

catevita commented 5 years ago

I'd stick with quaternions, I just needed to pick the correct axis to apply the rotations. The solution is more general and does neither require casing nor additional redundancy information to be stored.

nnmm commented 5 years ago

Is this ready to be reviewed, i.e. is the constrained camera movement already included?

catevita commented 5 years ago

yes, the camera is now constrained

nnmm commented 5 years ago

I'm sorry for the large delay. I finally tested it and it seems that on this branch, the camera now tilts in weird ways even when not using ECEF at all. I also can't see anything when using my test ECEF octree.

This brings me back to my worries that this approach is too complex and hard to get right – just lots of fiddly math. I think we should look at just adding an extra transform to the camera again. I'd like to hear what you think about this, and to give you a better idea of what I mean, I set up a proof-of-concept here: https://github.com/googlecartographer/point_cloud_viewer/compare/nnmm/ecef_camera

I think the benefits of that would be:

You were worried about introducing redundancy, but I don't think we'd incur meaningful redundancy here (where different representations can get out of sync) – the local transform is set once and never modified.

feuerste commented 5 years ago

I like @nnmm's approach. The only thing I would change is not to rely on the proto, but automatically determine the transformation, similar to how it is done in https://github.com/lyft/avmapping-geometry/blob/master/xray_extensions/src/bin/build_xray_quadtree.rs, which would just require minor refactorings for extensions.

catevita commented 5 years ago

I had a quick look and it makes a lot of sense to change in these suggested directions!

feuerste commented 5 years ago

See https://github.com/googlecartographer/point_cloud_viewer/pull/274 and https://github.com/lyft/avmapping-geometry/pull/398 for my proposed changes