AERPAW bug fixes for first experiment
This commit is contained in:
@@ -186,7 +186,10 @@ static int readScenarioDataRow(const char* filename, char* line, int lineSize) {
|
||||
// 35-37: domainMax (east, north, up)
|
||||
// 38-39: objectivePos (east, north)
|
||||
// 40-43: objectiveVar (2x2 col-major: v11, v12, v21, v22)
|
||||
// 44 : sensorPerformanceMinimum
|
||||
// 44 : sensorPerformanceMinimum (CSV column 18)
|
||||
// 45 : useDoubleIntegrator (CSV column 23; 0=single-integrator, 1=double-integrator)
|
||||
// 46 : dampingCoeff (CSV column 24)
|
||||
// 47 : useFixedTopology (CSV column 25; 0=dynamic lesser-neighbor, 1=fixed)
|
||||
// Returns 1 on success, 0 on failure.
|
||||
int loadScenario(const char* filename, double* params) {
|
||||
char line[4096];
|
||||
@@ -198,8 +201,8 @@ int loadScenario(const char* filename, double* params) {
|
||||
|
||||
char* fields[32];
|
||||
int nf = splitCSVRow(copy, fields, 32);
|
||||
if (nf < 19) {
|
||||
fprintf(stderr, "loadScenario: expected >=19 columns, got %d\n", nf);
|
||||
if (nf < 26) {
|
||||
fprintf(stderr, "loadScenario: expected >=26 columns, got %d\n", nf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -290,6 +293,24 @@ int loadScenario(const char* filename, double* params) {
|
||||
params[44] = atof(trimField(tmp));
|
||||
}
|
||||
|
||||
// useDoubleIntegrator: column 23
|
||||
{
|
||||
char tmp[64]; strncpy(tmp, fields[23], sizeof(tmp) - 1); tmp[sizeof(tmp)-1] = '\0';
|
||||
params[45] = atof(trimField(tmp));
|
||||
}
|
||||
|
||||
// dampingCoeff: column 24
|
||||
{
|
||||
char tmp[64]; strncpy(tmp, fields[24], sizeof(tmp) - 1); tmp[sizeof(tmp)-1] = '\0';
|
||||
params[46] = atof(trimField(tmp));
|
||||
}
|
||||
|
||||
// useFixedTopology: column 25
|
||||
{
|
||||
char tmp[64]; strncpy(tmp, fields[25], sizeof(tmp) - 1); tmp[sizeof(tmp)-1] = '\0';
|
||||
params[47] = atof(trimField(tmp));
|
||||
}
|
||||
|
||||
printf("Loaded scenario: domain [%g,%g,%g] to [%g,%g,%g]\n",
|
||||
params[32], params[33], params[34], params[35], params[36], params[37]);
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user