38 cerr <<
"ADDING NODE " << tag <<
" id=" <<
id <<
" dim=" << dimension;
41 for (
size_t i = 0; i < values.size(); ++i)
42 cerr <<
" " << values[i];
47 if (values.size() == 0)
48 _vertices[
id] = make_pair(tag, std::vector<double>(dimension));
50 _vertices[id] = make_pair(tag, values);
55 bool ExampleSlamInterface::addEdge(
const std::string& tag,
int id,
int dimension,
int v1,
int v2,
const std::vector<double>& measurement,
const std::vector<double>& information)
57 cerr <<
"ADDING EDGE " << tag <<
" id=" <<
id <<
" dim=" << dimension
58 <<
" (" << v1 <<
" <-> " << v2 <<
")" <<
" measurement=";
59 for (
size_t i = 0; i < measurement.size(); ++i)
60 cerr <<
" " << measurement[i];
61 cerr <<
" information=";
62 for (
size_t i = 0; i < information.size(); ++i)
63 cerr <<
" " << information[i];
70 cerr <<
"FIXING NODE";
71 for (
size_t i = 0; i < nodes.size(); ++i)
72 cerr <<
" " << nodes[i];
79 cerr <<
"QUERY STATE";
80 for (
size_t i = 0; i < nodes.size(); ++i)
81 cerr <<
" " << nodes[i];
86 if (nodes.size() == 0) {
88 for (std::map<
int, std::pair<std::string, std::vector<double> > >::const_iterator it = _vertices.begin();
89 it != _vertices.end(); ++it) {
90 cout << it->second.first <<
" " << it->first;
91 const vector<double>&
values = it->second.second;
92 for (
size_t j = 0; j < values.size(); ++j)
93 cout <<
" " << values[j];
97 for (
size_t i = 0; i < nodes.size(); ++i) {
98 std::map<int, std::pair<std::string, std::vector<double> > >::const_iterator it = _vertices.find(nodes[i]);
99 if (it != _vertices.end()) {
100 cout << it->second.first <<
" " << it->first;
101 const vector<double>&
values = it->second.second;
102 for (
size_t j = 0; j < values.size(); ++j)
103 cout <<
" " << values[j];
114 cerr <<
"SOLVE STATE" << endl;
bool addNode(const std::string &tag, int id, int dimension, const std::vector< double > &values)
bool addEdge(const std::string &tag, int id, int dimension, int v1, int v2, const std::vector< double > &measurement, const std::vector< double > &information)
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
bool queryState(const std::vector< int > &nodes)
bool fixNode(const std::vector< int > &nodes)