From 68c9da8c4e7b3c333dfe394e5b58a38e4bd1d9b5 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Thu, 24 Oct 2024 13:21:29 -0700 Subject: [PATCH] More cleanup --- gtsam/inference/LabeledSymbol.h | 26 ++++++++++++++------------ gtsam/sfm/TranslationFactor.h | 4 ++-- gtsam/sfm/TranslationRecovery.h | 4 ++-- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/gtsam/inference/LabeledSymbol.h b/gtsam/inference/LabeledSymbol.h index eb663ef9b..927fb7669 100644 --- a/gtsam/inference/LabeledSymbol.h +++ b/gtsam/inference/LabeledSymbol.h @@ -68,7 +68,7 @@ class GTSAM_EXPORT LabeledSymbol { } /// @} - /// @name API + /// @name Standard API /// @{ /// Cast to Key @@ -103,15 +103,13 @@ class GTSAM_EXPORT LabeledSymbol { bool operator!=(const LabeledSymbol& comp) const; bool operator!=(Key comp) const; - /** Return a filter function that returns true when evaluated on a Key whose - * character (when converted to a LabeledSymbol) matches \c c. Use this with - * the Values::filter() function to retrieve all key-value pairs with the - * requested character. - */ - /// @} - /// @name Advanced API + /// @name Filtering /// @{ + /// Return a filter function that returns true when evaluated on a Key whose + /// character (when converted to a LabeledSymbol) matches \c c. Use this with + /// the Values::filter() function to retrieve all key-value pairs with the + /// requested character. /// Checks only the type static std::function TypeTest(unsigned char c); @@ -123,6 +121,10 @@ class GTSAM_EXPORT LabeledSymbol { static std::function TypeLabelTest(unsigned char c, unsigned char label); + /// @} + /// @name Advanced API + /// @{ + /// Converts to upper/lower versions of labels LabeledSymbol upper() const { return LabeledSymbol(c_, toupper(label_), j_); } LabeledSymbol lower() const { return LabeledSymbol(c_, tolower(label_), j_); } @@ -152,20 +154,20 @@ class GTSAM_EXPORT LabeledSymbol { #endif }; // \class LabeledSymbol -/** Create a symbol key from a character, label and index, i.e. xA5. */ +/// Create a symbol key from a character, label and index, i.e. xA5. inline Key mrsymbol(unsigned char c, unsigned char label, size_t j) { return (Key)LabeledSymbol(c, label, j); } -/** Return the character portion of a symbol key. */ +/// Return the character portion of a symbol key. inline unsigned char mrsymbolChr(Key key) { return LabeledSymbol(key).chr(); } -/** Return the label portion of a symbol key. */ +/// Return the label portion of a symbol key. inline unsigned char mrsymbolLabel(Key key) { return LabeledSymbol(key).label(); } -/** Return the index portion of a symbol key. */ +/// Return the index portion of a symbol key. inline size_t mrsymbolIndex(Key key) { return LabeledSymbol(key).index(); } /// traits diff --git a/gtsam/sfm/TranslationFactor.h b/gtsam/sfm/TranslationFactor.h index 33bc82f5a..cfb9cff20 100644 --- a/gtsam/sfm/TranslationFactor.h +++ b/gtsam/sfm/TranslationFactor.h @@ -55,7 +55,7 @@ class TranslationFactor : public NoiseModelFactorN { : Base(noiseModel, a, b), measured_w_aZb_(w_aZb.point3()) {} /** - * @brief Caclulate error: (norm(Tb - Ta) - measurement) + * @brief Calculate error: (norm(Tb - Ta) - measurement) * where Tb and Ta are Point3 translations and measurement is * the Unit3 translation direction from a to b. * @@ -120,7 +120,7 @@ class BilinearAngleTranslationFactor using NoiseModelFactor2::evaluateError; /** - * @brief Caclulate error: (scale * (Tb - Ta) - measurement) + * @brief Calculate error: (scale * (Tb - Ta) - measurement) * where Tb and Ta are Point3 translations and measurement is * the Unit3 translation direction from a to b. * diff --git a/gtsam/sfm/TranslationRecovery.h b/gtsam/sfm/TranslationRecovery.h index a91ef01f9..f821da975 100644 --- a/gtsam/sfm/TranslationRecovery.h +++ b/gtsam/sfm/TranslationRecovery.h @@ -119,7 +119,7 @@ class GTSAM_EXPORT TranslationRecovery { * @param betweenTranslations relative translations (with scale) between 2 * points in world coordinate frame known a priori. * @param rng random number generator - * @param intialValues (optional) initial values from a prior + * @param initialValues (optional) initial values from a prior * @return Values */ Values initializeRandomly( @@ -156,7 +156,7 @@ class GTSAM_EXPORT TranslationRecovery { * points in world coordinate frame known a priori. Unlike * relativeTranslations, zero-magnitude betweenTranslations are not treated as * hard constraints. - * @param initialValues intial values for optimization. Initializes randomly + * @param initialValues initial values for optimization. Initializes randomly * if not provided. * @return Values */