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.
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
.
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.
This is a native client using SDL2.
- Install SDL2. For example, on Mac
brew install sdl2
. - Change to the sdl viewer's directory:
cd sdl_viewer/
. - Build with
cargo build --release
. - 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.
The octree_web_viewer
consists of TypeScript code running in the browser and a web server binary.
To build,
- Change into the web viewer's client directory:
cd octree_web_viewer/client
. - Install npm. We strongly suggest using nvm. On Mac
brew install nvm
. - 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
. - Install javascript dependencies:
npm install
. - 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://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.
This work was inspired through the following projects.