Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions apps/warthog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// @created: 2016-11-23
//

#include <warthog/config.h>

#include <warthog/constants.h>
#include <warthog/domain/gridmap.h>
#include <warthog/domain/labelled_gridmap.h>
Expand All @@ -29,7 +31,6 @@

#include "cfg.h"
#include <getopt.h>
#include <warthog/config.h>

#include <cmath>
#include <filesystem>
Expand Down Expand Up @@ -160,6 +161,12 @@ struct gridmap_scenario
if(!patches.load(map)) { return false; }
return run.gridmap_init(grid, patches);
}

bool
apply_patches()
{
return run.gridmap_apply_patches(grid, patches) >= 0;
}
};

template<typename Search>
Expand Down Expand Up @@ -188,7 +195,7 @@ run_experiments(
if(exp == nullptr) { break; }
if(patch_count != 0)
{
if(scen.run.gridmap_apply_patches(scen.grid, scen.patches) < 0)
if(!scen.apply_patches())
{
// failed to apply patches, exit
WARTHOG_GCRIT("dynamic patch error: failed to apply patches");
Expand Down