Skip to content

Commit

Permalink
put context path in the config
Browse files Browse the repository at this point in the history
  • Loading branch information
luisa-mao committed Jun 1, 2024
1 parent 4aaa614 commit 9070e93
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/navigation_jackal_icl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ TerrainEvaluator = {
rollout_density = 10;

model_path = "../terrain_models/model.pt";
context_path="../terrain_models/context.pt";

-- dist_to_goal_weight = -0.2;
-- dist_to_goal_weight = -0.7;
Expand Down
4 changes: 4 additions & 0 deletions config/navigation_spot_icl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ AckermannSampler = {
clearance_path_clip_fraction = 0.8;
};

Context = {
context_path="terrain_models/context.pt";
}

TerrainEvaluator = {
patch_size_pixels = 1;
bev_pixels_per_meter = 150;
Expand Down
5 changes: 4 additions & 1 deletion src/navigation/terrain_evaluator2.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#include "terrain_evaluator.h"

namespace motion_primitives {
CONFIG_STRING(context_path, "Context.context_path");



class CustomTerrainEvaluator : public TerrainEvaluator {
public:
torch::Tensor context_tensor_;
CustomTerrainEvaluator() : TerrainEvaluator() {
// todo: store the context as private variable
torch::jit::script::Module tensors = torch::jit::load("../terrain_models/context.pt");
torch::jit::script::Module tensors = torch::jit::load(CONFIG_context_path);
context_tensor_ = tensors.run_method("return_tensor").toTensor();
}

Expand Down

0 comments on commit 9070e93

Please sign in to comment.