From 9e4a6e61675b69c6c2f0b88f069d01070b0f668e Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Tue, 9 Jun 2020 17:53:03 -0500 Subject: [PATCH] Wrapper updates for IMU data - Wrapped Values to allow for using NavState - Wrapped the symbol shorthands e.g. gtsam.X(0) --- gtsam.h | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/gtsam.h b/gtsam.h index 94e8baee4..e5bcb300e 100644 --- a/gtsam.h +++ b/gtsam.h @@ -120,6 +120,12 @@ namespace gtsam { +// Include Key typedef +#include +class Key { + Key(); +}; + // Actually a FastList #include class KeyList { @@ -1977,6 +1983,35 @@ size_t symbol(char chr, size_t index); char symbolChr(size_t key); size_t symbolIndex(size_t key); +namespace symbol_shorthand { + size_t A(size_t j); + size_t B(size_t j); + size_t C(size_t j); + size_t D(size_t j); + size_t E(size_t j); + size_t F(size_t j); + size_t G(size_t j); + size_t H(size_t j); + size_t I(size_t j); + size_t J(size_t j); + size_t K(size_t j); + size_t L(size_t j); + size_t M(size_t j); + size_t N(size_t j); + size_t O(size_t j); + size_t P(size_t j); + size_t Q(size_t j); + size_t R(size_t j); + size_t S(size_t j); + size_t T(size_t j); + size_t U(size_t j); + size_t V(size_t j); + size_t W(size_t j); + size_t X(size_t j); + size_t Y(size_t j); + size_t Z(size_t j); +} + // Default keyformatter void PrintKeyList (const gtsam::KeyList& keys); void PrintKeyList (const gtsam::KeyList& keys, string s); @@ -2141,6 +2176,7 @@ class Values { void insert(size_t j, const gtsam::EssentialMatrix& essential_matrix); void insert(size_t j, const gtsam::PinholeCameraCal3_S2& simple_camera); void insert(size_t j, const gtsam::imuBias::ConstantBias& constant_bias); + void insert(size_t j, const gtsam::NavState& nav_state); void insert(size_t j, Vector vector); void insert(size_t j, Matrix matrix); @@ -2158,10 +2194,11 @@ class Values { void update(size_t j, const gtsam::Cal3Bundler& cal3bundler); void update(size_t j, const gtsam::EssentialMatrix& essential_matrix); void update(size_t j, const gtsam::imuBias::ConstantBias& constant_bias); + void update(size_t j, const gtsam::NavState& nav_state); void update(size_t j, Vector vector); void update(size_t j, Matrix matrix); - template + template T at(size_t j); /// version for double