Commit 8d54d98a authored by Erik Andresen's avatar Erik Andresen

New feature: Manipulate CognitiveMapRouter using the ini-file (hopefully correct merge)

parent 5f922d5a
......@@ -778,6 +778,11 @@ bool ArgumentParser::ParseRoutingStrategies(TiXmlNode *routingNode)
pRoutingStrategies.push_back(make_pair(id, ROUTING_COGNITIVEMAP));
Router *r = new CognitiveMapRouter(id, ROUTING_COGNITIVEMAP);
Log->Write("\nINFO: \tUsing CognitiveMapRouter");
///Parsing additional options
if (!ParseCogMapOpts(e))
return false;
else {
Log->Write("ERROR: \twrong value for routing strategy [%s]!!!\n",
......@@ -788,6 +793,50 @@ bool ArgumentParser::ParseRoutingStrategies(TiXmlNode *routingNode)
return true;
bool ArgumentParser::ParseCogMapOpts(TiXmlNode *routerNode)
TiXmlNode* sensorNode=routerNode->FirstChild();
if (!sensorNode)
Log->Write("ERROR:\tNo sensors found.\n");
return false;
std::vector<std::string> sensorVec;
for (TiXmlElement* e = sensorNode->FirstChildElement("sensor"); e;
e = e->NextSiblingElement("sensor"))
string sensor = e->Attribute("description");
Log->Write("INFO: \tSensor "+ sensor + " added");
/// static_cast to get access to the method 'addOption' of the CognitiveMapRouter
CognitiveMapRouter* r = static_cast<CognitiveMapRouter*>(p_routingengine->GetAvailableRouters().back());
TiXmlElement* cogMap=routerNode->FirstChildElement("cognitive_map");
if (!cogMap)
Log->Write("ERROR:\tCognitive Map not specified.\n");
return false;
std::vector<std::string> cogMapStatus;
Log->Write("INFO: \tAll pedestrian starting with a(n) "+cogMapStatus[0]+" cognitive map\n");
return true;
bool ArgumentParser::ParseStrategyNodeToObject(const TiXmlNode &strategyNode)
string query="exit_crossing_strategy";
......@@ -136,6 +136,13 @@ private:
bool ParseRoutingStrategies(TiXmlNode* routingNode);
* @brief ParseCogMapOpts (parsing additional options for the cognitiveMapRouter)
* @param routingNode. First Child is sensorNode
* @return false if sensor node and/or cognitiveMapElement doesn't exist
bool ParseCogMapOpts(TiXmlNode* routingNode);
bool ParseLinkedCells(const TiXmlNode &linkedCellNode);
bool ParseStepSize(TiXmlNode &stepNode);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment