g2o
Public Member Functions | Protected Attributes | List of all members
SlamParser::SlamContextInterface Class Reference

#include <slam_context_interface.h>

Inheritance diagram for SlamParser::SlamContextInterface:
Inheritance graph
[legend]
Collaboration diagram for SlamParser::SlamContextInterface:
Collaboration graph
[legend]

Public Member Functions

 SlamContextInterface (AbstractSlamInterface *slam)
 
 ~SlamContextInterface ()
 
bool process (CommandNode *commandNode)
 
- Public Member Functions inherited from SlamParser::SlamContext
 SlamContext ()
 
virtual ~SlamContext ()
 

Protected Attributes

AbstractSlamInterface_slam
 

Detailed Description

Definition at line 36 of file slam_context_interface.h.

Constructor & Destructor Documentation

SlamParser::SlamContextInterface::SlamContextInterface ( AbstractSlamInterface slam)

Definition at line 37 of file slam_context_interface.cpp.

37  :
38  SlamContext(),
39  _slam(slam)
40  {
41  }
SlamParser::SlamContextInterface::~SlamContextInterface ( )

Definition at line 43 of file slam_context_interface.cpp.

44  {
45  }

Member Function Documentation

bool SlamParser::SlamContextInterface::process ( CommandNode commandNode)
virtual

Reimplemented from SlamParser::SlamContext.

Definition at line 47 of file slam_context_interface.cpp.

References _slam, SlamParser::AbstractSlamInterface::addEdge(), SlamParser::AbstractSlamInterface::addNode(), SlamParser::CommandNode::commandType(), SlamParser::CT_ADD_EDGE, SlamParser::CT_ADD_NODE, SlamParser::CT_FIX, SlamParser::CT_QUERY_STATE, SlamParser::CT_SOLVE_STATE, SlamParser::AddNode::dimension(), SlamParser::AddEdge::dimension(), SlamParser::AbstractSlamInterface::fixNode(), SlamParser::AddNode::id(), SlamParser::AddEdge::id(), SlamParser::AddEdge::id1(), SlamParser::AddEdge::id2(), SlamParser::QueryState::ids(), SlamParser::FixNode::ids(), SlamParser::AddEdge::information(), SlamParser::AbstractSlamInterface::queryState(), SlamParser::AbstractSlamInterface::solveState(), SlamParser::CommandNode::tag(), SlamParser::AddNode::values(), and SlamParser::AddEdge::values().

48  {
49  if (! _slam) {
50  return true;
51  }
52  switch (commandNode->commandType()) {
53  case CT_ADD_NODE:
54  {
55  AddNode* c = static_cast<AddNode*>(commandNode);
56  return _slam->addNode(c->tag(), c->id(), c->dimension(), c->values());
57  }
58  case CT_ADD_EDGE:
59  {
60  AddEdge* c = static_cast<AddEdge*>(commandNode);
61  return _slam->addEdge(c->tag(), c->id(), c->dimension(), c->id1(), c->id2(), c->values(), c->information());
62  }
63  case CT_SOLVE_STATE:
64  {
65  //SolveState* c = static_cast<SolveState*>(commandNode);
66  return _slam->solveState();
67  }
68  case CT_QUERY_STATE:
69  {
70  QueryState* c = static_cast<QueryState*>(commandNode);
71  return _slam->queryState(c->ids());
72  }
73  case CT_FIX:
74  {
75  FixNode* c = static_cast<FixNode*>(commandNode);
76  return _slam->fixNode(c->ids());
77  }
78  }
79  cerr << "SlamContextInterface::process: Unknown command type" << endl;
80  return false;
81  }
virtual bool fixNode(const std::vector< int > &nodes)=0
virtual bool queryState(const std::vector< int > &nodes)=0
virtual bool addNode(const std::string &tag, int id, int dimension, const std::vector< double > &values)=0
virtual bool addEdge(const std::string &tag, int id, int dimension, int v1, int v2, const std::vector< double > &measurement, const std::vector< double > &information)=0

Member Data Documentation

AbstractSlamInterface* SlamParser::SlamContextInterface::_slam
protected

Definition at line 45 of file slam_context_interface.h.

Referenced by process().


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