To compile:
cargo build
To run examples:
cargo run --example pose_optimization
g2o/
has the g2o code, including:g2o/CMakeLists.txt
-- used to compile the g2o library. You can compile g2o on its own withmkdir build; cd build; cmake ..; make
. The rust crate uses the CMakeLists file to build the library as part of the rust crate compilation and bindings generation.g2o/rust/rust_helper.cc
andg2o/rust/rust_helper.h
-- declare the C++ targets that Rust should have bindings to. If making a change here, need to also change the corresponding functions insrc/lib.rs
.
src/lib.rs
-- the Rust code that declares the C++ targets for which there are bindings. Should matchg2o/rust/rust_helper.cc
andg2o/rust/rust_helper.h
.build.rs
-- the compilation instructions to compile g2o, generate bindings, and link. Used automatically by cargo when you runcargo build
.examples/
has examples for how to use the g2orust crate.