From 142ad861039202d5ae82e7dabb8a41a090c8b17f Mon Sep 17 00:00:00 2001 From: Chengshu Li Date: Tue, 17 Sep 2024 15:43:40 -0700 Subject: [PATCH] sanity check virtual joints of HolonomicBaseRobot --- omnigibson/robots/holonomic_base_robot.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/omnigibson/robots/holonomic_base_robot.py b/omnigibson/robots/holonomic_base_robot.py index 6f8df17eb..2b89b92fe 100644 --- a/omnigibson/robots/holonomic_base_robot.py +++ b/omnigibson/robots/holonomic_base_robot.py @@ -136,13 +136,13 @@ def _post_load(self): def _initialize(self): super()._initialize() - # Set the max velocity for the base joints - self.joints["base_footprint_x_joint"].max_velocity = m.MAX_LINEAR_VELOCITY - self.joints["base_footprint_y_joint"].max_velocity = m.MAX_LINEAR_VELOCITY - self.joints["base_footprint_z_joint"].max_velocity = m.MAX_LINEAR_VELOCITY - self.joints["base_footprint_rx_joint"].max_velocity = m.MAX_ANGULAR_VELOCITY - self.joints["base_footprint_ry_joint"].max_velocity = m.MAX_ANGULAR_VELOCITY - self.joints["base_footprint_rz_joint"].max_velocity = m.MAX_ANGULAR_VELOCITY + for i, component in enumerate(["x", "y", "z", "rx", "ry", "rz"]): + joint_name = f"base_footprint_{component}_joint" + assert joint_name in self.joints, f"Missing base joint: {joint_name}" + if i < 3: + self.joints[joint_name].max_velocity = m.MAX_LINEAR_VELOCITY + else: + self.joints[joint_name].max_velocity = m.MAX_ANGULAR_VELOCITY # Force the recomputation of this cached property del self.control_limits