GTSAM  4.0.2
C++ library for smoothing and mapping (SAM)
Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
gtsam::LabeledSymbol Class Reference

#include <LabeledSymbol.h>

Public Member Functions

 LabeledSymbol ()
 
 LabeledSymbol (const LabeledSymbol &key)
 
 LabeledSymbol (unsigned char c, unsigned char label, std::uint64_t j)
 
 LabeledSymbol (gtsam::Key key)
 
 operator gtsam::Key () const
 
void print (const std::string &s="") const
 
bool equals (const LabeledSymbol &expected, double tol=0.0) const
 
gtsam::Key key () const
 
unsigned char label () const
 
unsigned char chr () const
 
size_t index () const
 
 operator std::string () const
 
bool operator< (const LabeledSymbol &comp) const
 
bool operator== (const LabeledSymbol &comp) const
 
bool operator== (gtsam::Key comp) const
 
bool operator!= (const LabeledSymbol &comp) const
 
bool operator!= (gtsam::Key comp) const
 
LabeledSymbol upper () const
 
LabeledSymbol lower () const
 
LabeledSymbol newChr (unsigned char c) const
 
LabeledSymbol newLabel (unsigned char label) const
 

Static Public Member Functions

static std::function< bool(gtsam::Key)> TypeTest (unsigned char c)
 
static std::function< bool(gtsam::Key)> LabelTest (unsigned char label)
 
static std::function< bool(gtsam::Key)> TypeLabelTest (unsigned char c, unsigned char label)
 

Protected Attributes

unsigned char c_
 
unsigned char label_
 
std::uint64_t j_
 

Friends

GTSAM_EXPORT std::ostream & operator<< (std::ostream &, const LabeledSymbol &)
 Output stream operator that can be used with key_formatter (see Key.h).
 

Detailed Description

Customized version of gtsam::Symbol for multi-robot use.

This variation of Symbol stores two char values in addition to an integer key, which is useful for encoding a group for a variable. This was originally designed for multi-robot systems, which allows expressing "Pose 7 from robot B" as "xB7".

Constructor & Destructor Documentation

◆ LabeledSymbol() [1/4]

gtsam::LabeledSymbol::LabeledSymbol ( )

Default constructor

◆ LabeledSymbol() [2/4]

gtsam::LabeledSymbol::LabeledSymbol ( const LabeledSymbol key)

Copy constructor

◆ LabeledSymbol() [3/4]

gtsam::LabeledSymbol::LabeledSymbol ( unsigned char  c,
unsigned char  label,
std::uint64_t  j 
)

Constructor

◆ LabeledSymbol() [4/4]

gtsam::LabeledSymbol::LabeledSymbol ( gtsam::Key  key)

Constructor that decodes an integer gtsam::Key

Member Function Documentation

◆ chr()

unsigned char gtsam::LabeledSymbol::chr ( ) const
inline

Retrieve key character

◆ index()

size_t gtsam::LabeledSymbol::index ( ) const
inline

Retrieve key index

◆ key()

gtsam::Key gtsam::LabeledSymbol::key ( ) const
inline

return the integer version

◆ label()

unsigned char gtsam::LabeledSymbol::label ( ) const
inline

Retrieve label character

◆ operator gtsam::Key()

gtsam::LabeledSymbol::operator gtsam::Key ( ) const

Cast to integer

◆ operator std::string()

gtsam::LabeledSymbol::operator std::string ( ) const

Create a string from the key

◆ operator<()

bool gtsam::LabeledSymbol::operator< ( const LabeledSymbol comp) const

Comparison for use in maps

◆ TypeTest()

static std::function<bool(gtsam::Key)> gtsam::LabeledSymbol::TypeTest ( unsigned char  c)
static

Return a filter function that returns true when evaluated on a gtsam::Key whose character (when converted to a LabeledSymbol) matches c. Use this with the Values::filter() function to retrieve all key-value pairs with the requested character.


The documentation for this class was generated from the following file: