Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.usda filter=lfs diff=lfs merge=lfs -text
Binary file not shown.
Git LFS file not shown
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ def sample_viewpoints(self, nbr_viewpoints: int, seed: int = 1) -> torch.Tensor:
sample_idx_select = torch.randperm(sample_idx.sum())[
: min(nbr_samples_per_point, nbr_viewpoints - sample_locations_count)
]
sample_locations[sample_locations_count : sample_locations_count + sample_idx_select.shape[0]] = (
self.terrain_analyser.samples[sample_idx][sample_idx_select, :2]
)
sample_locations[
sample_locations_count : sample_locations_count + sample_idx_select.shape[0]
] = self.terrain_analyser.samples[sample_idx][sample_idx_select, :2]
sample_locations_count += sample_idx_select.shape[0]
curr_point_idx += 1
# reset point index if all points are sampled
Expand Down Expand Up @@ -239,7 +239,7 @@ def render_viewpoints(self, samples: torch.Tensor):
os.path.join(
filedir,
"semantics" if annotator == "semantic_segmentation" else "rgb",
f"{image_idx[cam_idx]}".zfill(4) + ".png"
f"{image_idx[cam_idx]}".zfill(4) + ".png",
),
cv2.cvtColor(output.astype(np.uint8), cv2.COLOR_RGB2BGR),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from omni.isaac.lab.managers import ObservationTermCfg as ObsTerm
from omni.isaac.lab.managers import SceneEntityCfg
from omni.isaac.lab.scene import InteractiveSceneCfg
from omni.isaac.lab.sensors import ContactSensorCfg, patterns, CameraCfg
from omni.isaac.lab.sensors import CameraCfg, ContactSensorCfg, patterns
from omni.isaac.lab.utils import configclass
from omni.isaac.matterport.config import MatterportImporterCfg
from omni.isaac.matterport.domains import MatterportRayCasterCfg
Expand Down Expand Up @@ -121,7 +121,7 @@ class TerrainSceneCfg(InteractiveSceneCfg):
debug_vis=False,
mesh_prim_paths=["${USER_PATH_TO_USD}/matterport.ply"],
)

# NOTE: comment the following lines to only render the semantic segmentation and depth images
rgb_camera = CameraCfg(
prim_path="{ENV_REGEX_NS}/Robot/base/rgb_camera",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class TerrainSceneCfg(InteractiveSceneCfg):
static_friction=1.0,
dynamic_friction=1.0,
),
usd_path=os.path.join(DATA_DIR, "warehouse", "warehouse_new.usd"),
usd_path=os.path.join(DATA_DIR, "warehouse", "warehouse_new.usda"),
groundplane=True,
sem_mesh_to_class_map=os.path.join(DATA_DIR, "warehouse", "keyword_mapping.yml"),
people_config_file=os.path.join(DATA_DIR, "warehouse", "people_cfg.yml"),
Expand Down
12 changes: 6 additions & 6 deletions viplanner/utils/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ def filter_obs_inflation(self) -> None:
print("DONE!")
print(
"[INFO] odom points outside obs inflation :"
f" \t{self.nb_odom_points} ({round(self.nb_odom_points/nb_odom_point_prev*100, 2)} %)"
f" \t{self.nb_odom_points} ({round(self.nb_odom_points / nb_odom_point_prev * 100, 2)} %)"
)

return
Expand Down Expand Up @@ -1072,16 +1072,16 @@ def split_samples(
f"[INFO] datamix containing {odom.shape[0]} suitable odom-goal"
" pairs: \n"
"\t fov :"
f" \t{int(odom.shape[0] * ratio_fov_samples) } ({round(ratio_fov_samples*100, 2)} %) \n"
f" \t{int(odom.shape[0] * ratio_fov_samples)} ({round(ratio_fov_samples * 100, 2)} %) \n"
"\t front of robot :"
f" \t{int(odom.shape[0] * ratio_front_samples)} ({round(ratio_front_samples*100, 2)} %) \n"
f" \t{int(odom.shape[0] * ratio_front_samples)} ({round(ratio_front_samples * 100, 2)} %) \n"
"\t back of robot :"
f" \t{int(odom.shape[0] * ratio_back_samples) } ({round(ratio_back_samples*100, 2)} %) \n"
f" \t{int(odom.shape[0] * ratio_back_samples)} ({round(ratio_back_samples * 100, 2)} %) \n"
"from"
f" {self.odom_used} ({round(self.odom_used/self.nb_odom_points*100, 2)} %)"
f" {self.odom_used} ({round(self.odom_used / self.nb_odom_points * 100, 2)} %)"
" different starting points where \n"
"\t non-suitable filter:"
f" {self.odom_no_suitable_goals} ({round(self.odom_no_suitable_goals/self.nb_odom_points*100, 2)} %)"
f" {self.odom_no_suitable_goals} ({round(self.odom_no_suitable_goals / self.nb_odom_points * 100, 2)} %)"
)

# generate split
Expand Down
8 changes: 4 additions & 4 deletions viplanner/utils/eval_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def plt_single_model(self, eval_dir: str, show: bool = True) -> None:
ax.set_title(
(
"Avg increase of path length is"
f" {round(np.mean(self.path_extension), 5)*100:.2f}% for"
f" {round(np.mean(self.path_extension), 5) * 100:.2f}% for"
" successful paths with tolerance of"
f" {self.distance_tolerance}"
),
Expand Down Expand Up @@ -255,7 +255,7 @@ def plt_single_model(self, eval_dir: str, show: bool = True) -> None:
ax1.set_title(
(
f"With a tolerance of {self.distance_tolerance} are"
f" {round(goal_success_mean, 5)*100:.2f} % of goals reached"
f" {round(goal_success_mean, 5) * 100:.2f} % of goals reached"
),
fontsize=16,
)
Expand Down Expand Up @@ -416,7 +416,7 @@ def plt_comparison(
unique_goal_length + bar_pos,
mean_path_extension,
width=bar_width,
label=(f"{model_name} (avg {round(avg_increase, 5)*100:.2f} %))"),
label=(f"{model_name} (avg {round(avg_increase, 5) * 100:.2f} %))"),
alpha=0.8,
) # yerr=std_path_extension,
# axs_path.plot(goal_length_path_exists, mean_path_extension, label=f'{model_name} ({round(avg_increase, 5)*100:.2f} %))')
Expand All @@ -428,7 +428,7 @@ def plt_comparison(
unique_goal_length + bar_pos,
mean_goal_distance,
width=bar_width,
label=(f"{model_name} (success rate" f" {round(goal_success, 5)*100:.2f} %)"),
label=(f"{model_name} (success rate" f" {round(goal_success, 5) * 100:.2f} %)"),
alpha=0.8,
) # yerr=std_goal_distance,
# axs_goal.plot(unique_goal_length, mean_goal_distance, label=f'{model_name} ({round(goal_success, 5)*100:.2f} %)')
Expand Down
4 changes: 2 additions & 2 deletions viplanner/utils/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,8 @@ def _train_epoch(
train_loss += loss.item()
enumerater.set_description(
f"Epoch: {epoch} in Env: "
f"({env_id+1}/{len(self._cfg.env_list)-1}) "
f"- train loss:{round(train_loss/(batch_idx+1), 4)} on"
f"({env_id + 1} / {len(self._cfg.env_list) - 1}) "
f"- train loss:{round(train_loss / (batch_idx + 1), 4)} on"
f" {batch_idx}/{batches}"
)
return train_loss / (batch_idx + 1)
Expand Down