37 unsigned char c_, label_;
48 LabeledSymbol(
unsigned char c,
unsigned char label, std::uint64_t j);
57 void print(
const std::string& s =
"")
const;
60 return (*
this) == expected;
67 inline unsigned char label()
const {
return label_; }
70 inline unsigned char chr()
const {
return c_; }
73 inline size_t index()
const {
return j_; }
76 operator std::string()
const;
92 static std::function<bool(
gtsam::Key)> TypeTest(
unsigned char c);
95 static std::function<bool(
gtsam::Key)> LabelTest(
unsigned char label);
98 static std::function<bool(
gtsam::Key)> TypeLabelTest(
unsigned char c,
unsigned char label);
102 LabeledSymbol lower()
const {
return LabeledSymbol(c_, tolower(label_), j_); }
105 LabeledSymbol newChr(
unsigned char c)
const {
return LabeledSymbol(c, label_, j_); }
108 LabeledSymbol newLabel(
unsigned char label)
const {
return LabeledSymbol(c_, label, j_); }
111 friend GTSAM_EXPORT std::ostream &operator<<(std::ostream &,
const LabeledSymbol &);
116 friend class boost::serialization::access;
117 template<
class ARCHIVE>
118 void serialize(ARCHIVE & ar,
const unsigned int ) {
119 ar & BOOST_SERIALIZATION_NVP(c_);
120 ar & BOOST_SERIALIZATION_NVP(label_);
121 ar & BOOST_SERIALIZATION_NVP(j_);
126inline Key mrsymbol(
unsigned char c,
unsigned char label,
size_t j) {
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
std::string serialize(const T &input)
serializes to a string
Definition: serialization.h:112
unsigned char mrsymbolChr(Key key)
Return the character portion of a symbol key.
Definition: LabeledSymbol.h:131
size_t mrsymbolIndex(Key key)
Return the index portion of a symbol key.
Definition: LabeledSymbol.h:137
unsigned char mrsymbolLabel(Key key)
Return the label portion of a symbol key.
Definition: LabeledSymbol.h:134
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:155
bool operator!=(const Matrix &A, const Matrix &B)
inequality
Definition: Matrix.h:110
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:69
Key mrsymbol(unsigned char c, unsigned char label, size_t j)
Create a symbol key from a character, label and index, i.e.
Definition: LabeledSymbol.h:126
bool operator==(const Matrix &A, const Matrix &B)
equality is just equal_with_abs_tol 1e-9
Definition: Matrix.h:103
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
Template to create a binary predicate.
Definition: Testable.h:111
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:151
Customized version of gtsam::Symbol for multi-robot use.
Definition: LabeledSymbol.h:35
unsigned char chr() const
Retrieve key character.
Definition: LabeledSymbol.h:70
gtsam::Key key() const
return the integer version
Definition: LabeledSymbol.h:64
size_t index() const
Retrieve key index.
Definition: LabeledSymbol.h:73
unsigned char label() const
Retrieve label character.
Definition: LabeledSymbol.h:67