diff --git a/omnigibson/action_primitives/starter_semantic_action_primitives.py b/omnigibson/action_primitives/starter_semantic_action_primitives.py index d3def32ae..a0fd65742 100644 --- a/omnigibson/action_primitives/starter_semantic_action_primitives.py +++ b/omnigibson/action_primitives/starter_semantic_action_primitives.py @@ -21,7 +21,6 @@ from omnigibson import object_states from omnigibson.action_primitives.action_primitive_set_base import ActionPrimitiveError, ActionPrimitiveErrorGroup, BaseActionPrimitiveSet from omnigibson.utils.object_state_utils import sample_cuboid_for_predicate -from omnigibson.object_states.utils import get_center_extent from omnigibson.objects.object_base import BaseObject from omnigibson.robots import BaseRobot from omnigibson.tasks.behavior_task import BehaviorTask @@ -1713,7 +1712,7 @@ def _sample_position_on_aabb_face(target_obj): Returns: 3-array: (x,y,z) Position in the world frame """ - aabb_center, aabb_extent = get_center_extent(target_obj.states) + aabb_center, aabb_extent = target_obj.aabb_center, target_obj.aabb_extent # We want to sample only from the side-facing faces. face_normal_axis = random.choice([0, 1]) face_normal_direction = random.choice([-1, 1]) diff --git a/omnigibson/object_states/utils.py b/omnigibson/object_states/utils.py deleted file mode 100644 index 730cf42bd..000000000 --- a/omnigibson/object_states/utils.py +++ /dev/null @@ -1,16 +0,0 @@ -import numpy as np -from omnigibson.object_states.aabb import AABB - -def get_center_extent(obj_states): - assert AABB in obj_states - aabb = obj_states[AABB].get_value() - center, extent = get_aabb_center(aabb), get_aabb_extent(aabb) - return center, extent - -def get_aabb_center(aabb): - lower, upper = aabb - return (np.array(lower) + np.array(upper)) / 2. - -def get_aabb_extent(aabb): - lower, upper = aabb - return np.array(upper) - np.array(lower) \ No newline at end of file