Skip to content

Commit 7ccabce

Browse files
committed
Formatting fixes.
1 parent e66eed1 commit 7ccabce

9 files changed

Lines changed: 33 additions & 27 deletions

File tree

source/isaaclab_tasks/isaaclab_tasks/contrib/deploy/cable_insertion/config/displayport_rizon_4s/joint_pos_env_cfg.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@
4848

4949
_SOCKET_ROOT = compute_socket_root(_GEOMETRY_POS, _SOCKET_ROT)
5050
_PLUG_ROOT, _PLUG_ROT = compute_plug_pose(
51-
_GEOMETRY_POS, _SOCKET_ROT, z_clearance=_PLUG_CLEARANCE_Z,
51+
_GEOMETRY_POS,
52+
_SOCKET_ROT,
53+
z_clearance=_PLUG_CLEARANCE_Z,
5254
)
5355

5456
# DisplayPort plug insertion length (blade engagement along the insertion axis)

source/isaaclab_tasks/isaaclab_tasks/contrib/deploy/cable_insertion/config/displayport_rizon_4s/ros_inference_env_cfg.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535

3636
_HUBBLE_SOCKET_ROOT = compute_socket_root(_HUBBLE_GEOMETRY_POS, _HUBBLE_SOCKET_ROT)
3737
_HUBBLE_PLUG_ROOT, _HUBBLE_PLUG_ROT = compute_plug_pose(
38-
_HUBBLE_GEOMETRY_POS, _HUBBLE_SOCKET_ROT, z_clearance=_HUBBLE_PLUG_CLEARANCE_Z,
38+
_HUBBLE_GEOMETRY_POS,
39+
_HUBBLE_SOCKET_ROT,
40+
z_clearance=_HUBBLE_PLUG_CLEARANCE_Z,
3941
)
4042

4143

@@ -133,9 +135,7 @@ def __post_init__(self):
133135

134136

135137
@configclass
136-
class Rizon4sGravDisplayportInsertionNoJointVelROSInferenceEnvCfg(
137-
Rizon4sGravDisplayportInsertionROSInferenceEnvCfg
138-
):
138+
class Rizon4sGravDisplayportInsertionNoJointVelROSInferenceEnvCfg(Rizon4sGravDisplayportInsertionROSInferenceEnvCfg):
139139
"""ROS inference config for the velocity-free joint-space policy.
140140
141141
Identical deployment setup to

source/isaaclab_tasks/isaaclab_tasks/contrib/deploy/cable_insertion/config/displayport_rizon_4s/task_space_env_cfg.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,12 @@
5353
_DAMPING_RATIO_TRANS = 35.0 / (2.0 * math.sqrt(300.0)) # ~1.010
5454
_DAMPING_RATIO_ROT = 1.1 / (2.0 * math.sqrt(30.0)) # ~0.100
5555
_DAMPING_RATIO = (
56-
_DAMPING_RATIO_TRANS, _DAMPING_RATIO_TRANS, _DAMPING_RATIO_TRANS,
57-
_DAMPING_RATIO_ROT, _DAMPING_RATIO_ROT, _DAMPING_RATIO_ROT,
56+
_DAMPING_RATIO_TRANS,
57+
_DAMPING_RATIO_TRANS,
58+
_DAMPING_RATIO_TRANS,
59+
_DAMPING_RATIO_ROT,
60+
_DAMPING_RATIO_ROT,
61+
_DAMPING_RATIO_ROT,
5862
)
5963

6064
# Production action_scale = [0.01]*6 for both position and rotation

source/isaaclab_tasks/isaaclab_tasks/contrib/deploy/cable_insertion/displayport_insertion_env_cfg.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def _quat_mul(q1_xyzw, q2_xyzw):
6262
w1 * w2 - x1 * x2 - y1 * y2 - z1 * z2,
6363
)
6464

65+
6566
# ---------------------------------------------------------------------------
6667
# USD body-frame offsets (DisplayPort asset geometry)
6768
# ---------------------------------------------------------------------------
@@ -114,7 +115,9 @@ def compute_plug_pose(geometry_pos, socket_rot, z_clearance=0.0):
114115

115116
_SOCKET_ROOT_POS = compute_socket_root(_INSERTION_POINT, _DEFAULT_SOCKET_ROT)
116117
_PLUG_ROOT_POS, _DEFAULT_PLUG_ROT = compute_plug_pose(
117-
_INSERTION_POINT, _DEFAULT_SOCKET_ROT, z_clearance=0.033,
118+
_INSERTION_POINT,
119+
_DEFAULT_SOCKET_ROT,
120+
z_clearance=0.033,
118121
)
119122

120123
##

source/isaaclab_tasks/isaaclab_tasks/contrib/deploy/cable_insertion/insertion_env.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from __future__ import annotations
2626

2727
import torch
28-
2928
import warp as wp
3029

3130
from isaaclab.envs import ManagerBasedRLEnv

source/isaaclab_tasks/isaaclab_tasks/contrib/deploy/mdp/events.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from typing import TYPE_CHECKING
1212

1313
import torch
14+
import warp as wp
1415

1516
import isaaclab.utils.math as math_utils
1617
from isaaclab.managers import EventTermCfg, ManagerTermBase, SceneEntityCfg
@@ -763,9 +764,7 @@ def __call__(
763764
# Write gripper STATE at ``hand_hold_width`` (fingers just touching the
764765
# plug, no mesh overlap) and set the TARGET to ``hand_close_width``
765766
# (fully closed) so the actuator drive squeezes around the plug.
766-
self.gripper_joint_setter_func(
767-
joint_pos, list(range(num_reset_envs)), self.finger_joints, self.hand_hold_width
768-
)
767+
self.gripper_joint_setter_func(joint_pos, list(range(num_reset_envs)), self.finger_joints, self.hand_hold_width)
769768
self.robot_asset.write_joint_position_to_sim_index(position=joint_pos, env_ids=env_ids)
770769
self.robot_asset.write_joint_velocity_to_sim_index(velocity=joint_vel, env_ids=env_ids)
771770

@@ -824,9 +823,7 @@ def __init__(self, cfg: EventTermCfg, env: ManagerBasedEnv):
824823

825824
self.normal_pose_range: dict = cfg.params.get("normal_pose_range", {})
826825

827-
self.identity_quat = torch.tensor(
828-
[0.0, 0.0, 0.0, 1.0], device=env.device, dtype=torch.float32
829-
)
826+
self.identity_quat = torch.tensor([0.0, 0.0, 0.0, 1.0], device=env.device, dtype=torch.float32)
830827

831828
def _current_at_goal_prob(self, env: ManagerBasedEnv) -> float:
832829
"""Return the at-goal probability for the current training progress.
@@ -835,11 +832,7 @@ def _current_at_goal_prob(self, env: ManagerBasedEnv) -> float:
835832
between ``anneal_start_iter`` and ``anneal_end_iter``. Returns the
836833
constant ``at_goal_prob`` when annealing is not fully configured.
837834
"""
838-
if (
839-
self.at_goal_prob_final is None
840-
or self.anneal_end_iter is None
841-
or not self.num_steps_per_env
842-
):
835+
if self.at_goal_prob_final is None or self.anneal_end_iter is None or not self.num_steps_per_env:
843836
return self.at_goal_prob
844837

845838
current_iter = env.common_step_counter / float(self.num_steps_per_env)
@@ -875,7 +868,10 @@ def __call__(
875868
socket_offset_batch = self.socket_insertion_offset.unsqueeze(0).expand(num_envs, -1)
876869
id_quat_batch = self.identity_quat.unsqueeze(0).expand(num_envs, -1)
877870
kp_origin_w, _ = math_utils.combine_frame_transforms(
878-
socket_pos, socket_quat, socket_offset_batch, id_quat_batch,
871+
socket_pos,
872+
socket_quat,
873+
socket_offset_batch,
874+
id_quat_batch,
879875
)
880876

881877
# Insertion axis in world frame (rotated by socket orientation)
@@ -917,7 +913,9 @@ def __call__(
917913
num_at_goal = int(at_goal_local.numel())
918914
if num_at_goal > 0:
919915
depth_rand = torch.rand(num_at_goal, 1, device=env.device)
920-
goal_kp_pos = kp_origin_w[at_goal_local] + depth_rand * insertion_axis_w[at_goal_local] * self.insertion_length
916+
goal_kp_pos = (
917+
kp_origin_w[at_goal_local] + depth_rand * insertion_axis_w[at_goal_local] * self.insertion_length
918+
)
921919

922920
# Convert keypoint position to plug root position
923921
plug_pos[at_goal_local] = goal_kp_pos - plug_kp_in_world[at_goal_local]

source/isaaclab_tasks/isaaclab_tasks/contrib/deploy/mdp/observations.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from typing import TYPE_CHECKING
1111

1212
import torch
13+
import warp as wp
1314

1415
from isaaclab.managers import ManagerTermBase, ObservationTermCfg, SceneEntityCfg
1516
from isaaclab.utils.math import combine_frame_transforms, matrix_from_quat

source/isaaclab_tasks/isaaclab_tasks/contrib/deploy/mdp/rewards.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -609,15 +609,13 @@ def __init__(self, cfg: RewardTermCfg, env: ManagerBasedRLEnv):
609609
torch.tensor(rot_offset_2, device=env.device, dtype=torch.float32).unsqueeze(0).repeat(env.num_envs, 1)
610610
)
611611

612-
self.identity_quat = (
613-
torch.tensor([[0.0, 0.0, 0.0, 1.0]], device=env.device, dtype=torch.float32).repeat(env.num_envs, 1)
612+
self.identity_quat = torch.tensor([[0.0, 0.0, 0.0, 1.0]], device=env.device, dtype=torch.float32).repeat(
613+
env.num_envs, 1
614614
)
615615

616616
self.keypoint_computer = _compute_keypoint_distance(cfg, env)
617617

618-
def _get_kp_frames(
619-
self, env: ManagerBasedRLEnv
620-
) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]:
618+
def _get_kp_frames(self, env: ManagerBasedRLEnv) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]:
621619
"""Compute keypoint frames for both assets with offsets applied."""
622620
import warp as wp
623621

source/isaaclab_tasks/isaaclab_tasks/contrib/deploy/mdp/terminations.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from typing import TYPE_CHECKING
1212

1313
import torch
14+
import warp as wp
1415

1516
import isaaclab.utils.math as math_utils
1617
from isaaclab.managers import ManagerTermBase, SceneEntityCfg, TerminationTermCfg

0 commit comments

Comments
 (0)