Merge pull request #1655 from borglab/variable-keyformatter
commit
5a3706c6bb
|
@ -10,7 +10,7 @@
|
||||||
* -------------------------------------------------------------------------- */
|
* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file Key.h
|
* @file Key.cpp
|
||||||
* @brief
|
* @brief
|
||||||
* @author Richard Roberts
|
* @author Richard Roberts
|
||||||
* @author Alex Cunningham
|
* @author Alex Cunningham
|
||||||
|
@ -26,6 +26,9 @@ using namespace std;
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
||||||
|
/// Assign default key formatter
|
||||||
|
KeyFormatter DefaultKeyFormatter = &_defaultKeyFormatter;
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
string _defaultKeyFormatter(Key key) {
|
string _defaultKeyFormatter(Key key) {
|
||||||
const Symbol asSymbol(key);
|
const Symbol asSymbol(key);
|
||||||
|
|
|
@ -37,10 +37,16 @@ using KeyFormatter = std::function<std::string(Key)>;
|
||||||
// Helper function for DefaultKeyFormatter
|
// Helper function for DefaultKeyFormatter
|
||||||
GTSAM_EXPORT std::string _defaultKeyFormatter(Key key);
|
GTSAM_EXPORT std::string _defaultKeyFormatter(Key key);
|
||||||
|
|
||||||
/// The default KeyFormatter, which is used if no KeyFormatter is passed to
|
/**
|
||||||
/// a nonlinear 'print' function. Automatically detects plain integer keys
|
* The default KeyFormatter, which is used if no KeyFormatter is passed
|
||||||
/// and Symbol keys.
|
* to a 'print' function.
|
||||||
static const KeyFormatter DefaultKeyFormatter = &_defaultKeyFormatter;
|
*
|
||||||
|
* Automatically detects plain integer keys and Symbol keys.
|
||||||
|
*
|
||||||
|
* Marked as `extern` so that it can be updated by external libraries.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
extern GTSAM_EXPORT KeyFormatter DefaultKeyFormatter;
|
||||||
|
|
||||||
// Helper function for Multi-robot Key Formatter
|
// Helper function for Multi-robot Key Formatter
|
||||||
GTSAM_EXPORT std::string _multirobotKeyFormatter(gtsam::Key key);
|
GTSAM_EXPORT std::string _multirobotKeyFormatter(gtsam::Key key);
|
||||||
|
@ -124,7 +130,3 @@ struct traits<Key> {
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace gtsam
|
} // namespace gtsam
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue