27 #ifndef G2O_PROPERTY_H_ 28 #define G2O_PROPERTY_H_ 43 const std::string&
name() {
return _name;}
44 virtual std::string toString()
const = 0;
45 virtual bool fromString(
const std::string& s) = 0;
57 const T&
value()
const {
return _value;}
60 std::stringstream sstr;
79 typedef std::map<std::string, BaseProperty*>
BaseClass;
93 bool eraseProperty(
const std::string& name_);
101 PropertyMapIterator it=find(name_);
104 return dynamic_cast<P*
>(it->second);
106 template <
typename P>
109 PropertyMapConstIterator it=find(name_);
112 return dynamic_cast<P*
>(it->second);
118 template <
typename P>
119 P*
makeProperty(
const std::string& name_,
const typename P::ValueType& v)
121 PropertyMapIterator it=find(name_);
123 P* p=
new P(name_, v);
127 return dynamic_cast<P*
>(it->second);
134 bool updatePropertyFromString(
const std::string& name,
const std::string& value);
140 bool updateMapFromString(
const std::string&
values);
142 void writeToCSV(std::ostream& os)
const;
144 using BaseClass::size;
145 using BaseClass::begin;
146 using BaseClass::end;
147 using BaseClass::iterator;
148 using BaseClass::const_iterator;
BaseClass::iterator PropertyMapIterator
BaseClass::const_iterator PropertyMapConstIterator
Protocol The SLAM executable accepts such as solving the and retrieving or vertices in the explicitly state the reprensentation poses are represented by poses by VERTEX_XYZRPY In the Quaternions and other representations could be but note that it is up to the SLAM algorithm to choose the internal representation of the angles The keyword is followed by a unique vertex ID and an optional initialization of the values
virtual std::string toString() const
Property(const std::string &name_, const T &v)
Property< double > DoubleProperty
Property(const std::string &name_)
P * makeProperty(const std::string &name_, const typename P::ValueType &v)
bool convertString(const std::string &s, T &x)
void setValue(const T &v)
std::map< std::string, BaseProperty * > BaseClass
Property< std::string > StringProperty
Property< int > IntProperty
virtual bool fromString(const std::string &s)
const P * getProperty(const std::string &name_) const
Property< float > FloatProperty
a collection of properties mapping from name to the property itself
const std::string & name()
Property< bool > BoolProperty
P * getProperty(const std::string &name_)