Skip to content

akovalev/point_cloud_viewer

 
 

Repository files navigation

Point viewer

build status License

This is a standalone project to make viewing massive point clouds easy and convenient. It was build to serve the needs of the Cartographer project, but is useful in its own right.

Building

The project consist of a root crate that can build and read octrees on disk and viewer binaries to visualize the data. For Mac OS X, we assume below that you've installed Homebrew.

  • Install Rust: curl https://sh.rustup.rs -sSf | sh. See https://rustup.rs for details.
  • Install protobuf > 3.0. See ci/install_proto3.sh for Linux or run brew install protobuf on Mac OS X.
  • Install the rust gRPC protobuf plugin: cargo install grpcio-compiler and make sure it is in your $PATH. This has more dependencies, it requires cmake and go. On mac: brew install cmake go.

Creating Octrees

In the root of the repo, run cargo build --release. Then use target/release/build_octree to generate an octree out of a PLY file.

SDL client

This is a native client using SDL2.

  1. Install SDL2. For example, on Mac brew install sdl2.
  2. Change to the sdl viewer's directory: cd sdl_viewer/.
  3. Build with cargo build --release.
  4. Run with ../target/release/sdl_viewer <octree directory>.

In the point cloud viewer, navigate with the keyboard or with the mouse or touchpad. Dragging while pressing the left mouse button rotates, dragging while pressing the right mouse button pans the view. The following keys are bound:

Key Action
W Move forward
A Move left
S Move backwards
D Move right
Q Move up
Z Move down
Up Turn up
Left Turn left
Down Turn down
Right Move right
0 Increase points size
9 Decrease points size
8 Brighten scene
7 Darken scene
O Show octree nodes
Shift + Ctrl + 0-9 Save current camera position.
Ctrl + 0-9 Load saved camera position.

Saved camera positions are persisted in the octree directory and will therefore live through restarts of the program.

Web Viewer

The octree_web_viewer consists of TypeScript code running in the browser and a web server binary.

To build,

  1. Change into the web viewer's client directory: cd octree_web_viewer/client.
  2. Install npm. We strongly suggest using nvm. On Mac brew install nvm.
  3. Install node version 8: nvm install 8. Change to the web viewer's client directory: cd client, then set node version to 8: nvm use 8.
  4. Install javascript dependencies: npm install.
  5. Build the client: npm run build.

Then build the server: cargo build --release. Serve up the octree using ../target/release/octree_web_viewer <octree directory>, open Chrome to http:https://localhost:5433, navigate with WASD and left-click-drag on the mouse. The mouse wheel adjusts movement speed.

The client files (HTML and JavaScript) are embedded in the octree_web_viewer binary, so it is fully stand alone.

Prior art

This work was inspired through the following projects.

About

View billions of points in your browser.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 84.6%
  • TypeScript 13.5%
  • Other 1.9%