Skip to content

Commit 7736d32

Browse files
committed
move axis checking code to subclass
1 parent e1f5f55 commit 7736d32

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

robosuite/controllers/parts/mobile_base/joint_vel.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,20 +300,21 @@ def control_limits(self):
300300
def name(self):
301301
return "JOINT_VELOCITY"
302302

303+
303304
class LegacyMobileBaseJointVelocityController(MobileBaseJointVelocityController):
304305
"""
305306
Legacy version of MobileBaseJointVelocityController, created to address
306-
the recent change in the axis of the forward joint in the mobile base xml.
307+
the recent change in the axis of the forward joint in the mobile base xml.
307308
This controller is identical to the original MobileBaseJointVelocityController,
308-
except that it dynamically checks the axis of the forward joint and reorders
309-
the input action accordingly if the forward axis is the y axis instead of the x axis.
310-
This allows for backwards compatibility with previously collected datasets
309+
except that it dynamically checks the axis of the forward joint and reorders
310+
the input action accordingly if the forward axis is the y axis instead of the x axis.
311+
This allows for backwards compatibility with previously collected datasets
311312
that were generated using older versions of the mobile base xml.
312313
"""
313314

314315
def __init__(self, *args, **kwargs):
315316
super().__init__(*args, **kwargs)
316-
317+
317318
def _check_forward_joint_reversed(self):
318319
# Detect the axis for the forward joint and dynamically reorder action accordingly.
319320
# This is needed because previous versions of the mobile base xml had different forward

0 commit comments

Comments
 (0)