增加了任务管理程序路径参数配置文件及功能
This commit is contained in:
@@ -359,13 +359,13 @@ bool TaskManger::Iterate()
|
||||
readSafetyRules();
|
||||
setSafetyRules(maxTime, maxDepth, minAltitude, safePolygon);
|
||||
// setMaxDepth(maxDepth);
|
||||
setMaxDepth("2");
|
||||
setMaxDepth(maxDepth);
|
||||
st = 49;
|
||||
break;
|
||||
}
|
||||
case 41: //路径参数配置
|
||||
{
|
||||
readWayConfig("a");
|
||||
readWayConfig();
|
||||
setWayConfig(lead,lead_damper,capture_line,capture_radius,slip_radius);
|
||||
st = 49;
|
||||
//setWayConfig();
|
||||
@@ -444,14 +444,21 @@ bool TaskManger::OnStartUp()
|
||||
if(param == "SAFETYRULESPATH")
|
||||
{
|
||||
safetyRulesPath = value;
|
||||
RepList["RulesPath"] = safetyRulesPath;
|
||||
}
|
||||
//RepList["RulesPath"] = safetyRulesPath;
|
||||
}
|
||||
if(param == "WAYCONFIGPARAMPATH")
|
||||
{
|
||||
wayParamPath = value;
|
||||
RepList["WayConfigPath"] = wayParamPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(planConfigPath == "")
|
||||
reportConfigWarning("NO TASK FILE PATH");
|
||||
if(planConfigPath == "")
|
||||
reportConfigWarning("NO TASK SAFETY RULES CONFIG");
|
||||
if(wayParamPath == "")
|
||||
reportConfigWarning("NO WAY PARAM CONFIG");
|
||||
RegisterVariables();
|
||||
return(true);
|
||||
}
|
||||
@@ -748,15 +755,32 @@ int TaskManger::readSafetyRules()
|
||||
|
||||
}
|
||||
|
||||
int TaskManger::readWayConfig(string filename)
|
||||
int TaskManger::readWayConfig()
|
||||
{
|
||||
lead = "8";
|
||||
lead_damper = "1";
|
||||
lead_to_start = "false";
|
||||
capture_line = "true";
|
||||
capture_radius = "5";
|
||||
slip_radius = "15";
|
||||
efficiency_measure = "all";
|
||||
ifstream ifs;
|
||||
ifs.open(wayParamPath, ios::in);
|
||||
Json::Reader reader;
|
||||
Json::Value inputJsonValue;
|
||||
reader.parse(ifs, inputJsonValue);
|
||||
ifs.close();
|
||||
if(!inputJsonValue.isMember("lead")
|
||||
|| !inputJsonValue.isMember("lead_damper")
|
||||
|| !inputJsonValue.isMember("lead_to_start")
|
||||
|| !inputJsonValue.isMember("capture_line")
|
||||
|| !inputJsonValue.isMember("capture_radius")
|
||||
|| !inputJsonValue.isMember("efficiency_measure")
|
||||
|| !inputJsonValue.isMember("slip_radius"))
|
||||
return 1;
|
||||
if(!inputJsonValue["points"].isArray())
|
||||
return 2;
|
||||
lead = doubleToString(inputJsonValue["lead"].asDouble());
|
||||
lead_damper = doubleToString(inputJsonValue["lead_damper"].asDouble());
|
||||
lead_to_start = boolToString(inputJsonValue["lead_to_start"].asBool());
|
||||
capture_line = boolToString(inputJsonValue["capture_line"].asBool());
|
||||
capture_radius = doubleToString(inputJsonValue["capture_radius"].asDouble());
|
||||
slip_radius = doubleToString(inputJsonValue["slip_radius"].asDouble());
|
||||
efficiency_measure = inputJsonValue["efficiency_measure"].asString();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1046,7 +1070,7 @@ inline void TaskManger::InitConfig()
|
||||
//
|
||||
readSafetyRules();
|
||||
setSafetyRules(maxTime, maxDepth, minAltitude, safePolygon);
|
||||
readWayConfig("a");
|
||||
readWayConfig();
|
||||
setWayConfig(lead,lead_damper,capture_line,capture_radius,slip_radius);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user