Skip to content

Commit 09748fe

Browse files
committed
respond to reviewer comments
1 parent b6ab9bb commit 09748fe

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

source/isaaclab/isaaclab/actuators/actuator_base.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,15 @@ class ActuatorBase(ABC):
7676
"""
7777

7878
drive_model: torch.Tensor
79-
"""Three parameters for each joint/env defining the speed_effort_gradient, maximum actuator velocity, and
80-
velocity_dependent_resistance which define velocity and effort dependent constraints on the motor's performance.
81-
This feature is only implemented in IsaacSim v5.0. Shape is (num_envs, num_joints, 3)."""
79+
"""Three parameters for each joint/env defining the:
80+
(1) [:,:,0] speed_effort_gradient : float = 1 (default),
81+
(2) [:,:,1] maximum_actuator_velocity : float = torch.inf (default), and
82+
(3) [:,:,2] velocity_dependent_resistance : float = 1 (default)
83+
which define velocity and effort dependent constraints on the motor's performance.
84+
85+
This feature is only implemented in IsaacSim v5.0.
86+
87+
The shape is (num_envs, num_joints, 3)."""
8288

8389
stiffness: torch.Tensor
8490
"""The stiffness (P gain) of the PD controller. Shape is (num_envs, num_joints)."""
@@ -369,14 +375,13 @@ def _parse_joint_parameter(
369375
+ f"actuator on joints {self.joint_names}. Expected float or dict, got tuple"
370376
)
371377
# ensure the tuple is the correct length, and assign to the last tensor dimensions across all joints
372-
if len(cfg_value) is expected_shape[2]:
373-
for i, v in enumerate(cfg_value):
374-
param[:, :, i] = float(v)
375-
else:
378+
if not len(cfg_value) is expected_shape[2]:
376379
raise ValueError(
377380
f"Invalid tuple length for parameter {param_name}, got {len(cfg_value)}, expected"
378381
+ f" {expected_shape[2]}"
379382
)
383+
for i, v in enumerate(cfg_value):
384+
param[:, :, i] = float(v)
380385
elif isinstance(cfg_value, dict):
381386
# if dict, then parse the regular expression
382387
indices, _, values = string_utils.resolve_matching_names_values(cfg_value, self.joint_names)
@@ -415,14 +420,13 @@ def _parse_joint_parameter(
415420
+ f"actuator on joints {self.joint_names}. Expected float or dict, got tuple"
416421
)
417422
# ensure the tuple is the correct length, and assign to the last tensor dimensions across all joints
418-
if len(default_value) is expected_shape[2]:
419-
for i, v in enumerate(default_value):
420-
param[:, :, i] = float(v)
421-
else:
423+
if not len(default_value) is expected_shape[2]:
422424
raise ValueError(
423425
f"Invalid tuple length for parameter {param_name}, got {len(default_value)}, expected"
424426
+ f" {expected_shape[2]}"
425427
)
428+
for i, v in enumerate(default_value):
429+
param[:, :, i] = float(v)
426430
elif isinstance(default_value, torch.Tensor):
427431
# if tensor, then use the same tensor for all joints
428432
if tuple(default_value.shape) == expected_shape:

0 commit comments

Comments
 (0)