Skip to content
Snippets Groups Projects
Commit d37d5a28 authored by Gabor Csorvasi's avatar Gabor Csorvasi
Browse files

Algorithm section in JSON file.

parent 5ebc1f16
No related branches found
No related tags found
No related merge requests found
{ {
"type" : "environment", "type" : "scene",
"algo" : {
"dx" : 2,
"dy" : 2
},
"boundary" : { "boundary" : {
"height" : 30.0, "height" : 30.0,
"width" : 35.0 "width" : 35.0
......
...@@ -37,10 +37,6 @@ ARMBuilder::ARMBuilder(Configuration& startConfig, OccupancyGrid& og, Scene& sc) ...@@ -37,10 +37,6 @@ ARMBuilder::ARMBuilder(Configuration& startConfig, OccupancyGrid& og, Scene& sc)
} }
} }
} }
// for(unsigned i = 0; i<reachableArcs.size(); i++) {
// std::cout << reachableArcs[i] << std::endl;
// }
} }
ARM& ARMBuilder::getARM() { ARM& ARMBuilder::getARM() {
......
...@@ -45,7 +45,7 @@ void PlannerThread::run() { ...@@ -45,7 +45,7 @@ void PlannerThread::run() {
QJsonObject envObj = jsonEnv.object(); QJsonObject envObj = jsonEnv.object();
QJsonValue boundaryVal = envObj["boundary"]; QJsonValue boundaryVal = envObj["boundary"];
if (boundaryVal.isUndefined()) { if (boundaryVal.isUndefined() || boundaryVal.isNull()) {
_writeLog("No boundary section!"); _writeLog("No boundary section!");
return; return;
} }
...@@ -54,7 +54,7 @@ void PlannerThread::run() { ...@@ -54,7 +54,7 @@ void PlannerThread::run() {
_drawBoundary(env.getBoundary()); _drawBoundary(env.getBoundary());
QJsonValue obstVal = envObj["obstacles"]; QJsonValue obstVal = envObj["obstacles"];
if (obstVal.isUndefined()) { if (obstVal.isUndefined() || obstVal.isNull()) {
_writeLog("No obstacle section!"); _writeLog("No obstacle section!");
return; return;
} }
...@@ -73,7 +73,7 @@ void PlannerThread::run() { ...@@ -73,7 +73,7 @@ void PlannerThread::run() {
} }
QJsonValue robotVal = envObj["robot"]; QJsonValue robotVal = envObj["robot"];
if (obstVal.isUndefined()) { if (robotVal.isUndefined() || robotVal.isNull()) {
_writeLog("No robot section!"); _writeLog("No robot section!");
return; return;
} }
...@@ -115,7 +115,14 @@ void PlannerThread::run() { ...@@ -115,7 +115,14 @@ void PlannerThread::run() {
_drawPath(config); _drawPath(config);
_writeLog("Configuration list created."); _writeLog("Configuration list created.");
OccupancyGrid oG(env, 0.5, 0.5); QJsonValue algoVal = envObj["algo"];
if (algoVal.isUndefined() || algoVal.isNull()) {
_writeLog("No algo section!");
return;
}
QJsonObject algoObj = algoVal.toObject();
OccupancyGrid oG(env, algoObj["dx"].toDouble(), algoObj["dy"].toDouble());
_writeLog("Occupancy grid created."); _writeLog("Occupancy grid created.");
//_drawOG(oG); //_drawOG(oG);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment