Skip to content

Commit

Permalink
Use default value in max_layer_filter if the layer does not exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
mktk1117 committed Aug 11, 2024
1 parent c6f1f32 commit 968458a
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,13 @@ def __call__(
layers.append(layer)
if len(layers) == 0:
print("No layers are found, returning traversability!")
idx = layer_names.index("traversability")
return elevation_map[idx]
if isinstance(self.default_value, float):
layer = cp.ones_like(elevation_map[0])
layer *= float(self.default_value)
return layer
else:
idx = layer_names.index("traversability")
return elevation_map[idx]
result = cp.stack(layers, axis=0)
if self.min_or_max == "min":
result = cp.min(result, axis=0)
Expand Down

0 comments on commit 968458a

Please sign in to comment.