From 248e84b070a42a2f1370a6f8487ed4df2ea77ba0 Mon Sep 17 00:00:00 2001 From: Jimmy Yang Date: Sat, 10 Feb 2024 23:10:32 -0500 Subject: [PATCH] refine --- .../sub_tasks/articulated_object_sensors.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/habitat-lab/habitat/tasks/rearrange/sub_tasks/articulated_object_sensors.py b/habitat-lab/habitat/tasks/rearrange/sub_tasks/articulated_object_sensors.py index 5de986c7cf..5d5a45731b 100644 --- a/habitat-lab/habitat/tasks/rearrange/sub_tasks/articulated_object_sensors.py +++ b/habitat-lab/habitat/tasks/rearrange/sub_tasks/articulated_object_sensors.py @@ -160,10 +160,16 @@ class ArtObjAtDesiredState(Measure): def __init__(self, *args, sim, config, task, **kwargs): self._config = config self._gaze_method = config.gaze_method - self._center_cone_vector = mn.Vector3( - config.center_cone_vector - ).normalized() - self._min_dist, self._max_dist = config.gaze_distance_range + if config.center_cone_vector is None: + self._center_cone_vector = None + else: + self._center_cone_vector = mn.Vector3( + config.center_cone_vector + ).normalized() + if config.gaze_distance_range is None: + self._min_dist, self._max_dist = 0, 0 + else: + self._min_dist, self._max_dist = config.gaze_distance_range self._center_cone_angle_threshold = np.deg2rad( config.center_cone_angle_threshold )