Skip to content

Skillgen demo#4

Merged
LJones-alt merged 2 commits into
aarch-uol:skillgen_demofrom
LJones-alt:skillgen_demo
Feb 25, 2026
Merged

Skillgen demo#4
LJones-alt merged 2 commits into
aarch-uol:skillgen_demofrom
LJones-alt:skillgen_demo

Conversation

@LJones-alt

Copy link
Copy Markdown
Member

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
List any dependencies that are required for this change.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

Screenshots

Please attach before and after screenshots of the change if applicable.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

Copilot AI review requested due to automatic review settings February 25, 2026 16:34
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-mimic labels Feb 25, 2026
@LJones-alt
LJones-alt merged commit 90c657d into aarch-uol:skillgen_demo Feb 25, 2026
4 of 7 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request appears to be a demonstration or experimental implementation for "Skillgen" that adds support for a vial insertion task with various backup controllers and recovery mechanisms. The PR introduces new environment configurations, modifies termination and observation logic, adds ensemble training capabilities, and implements state machine-based backup controllers for safe robot manipulation.

Changes:

  • Adds new environment registration "Dev-IK-Rel-Insert-v1" for top-down vial insertion task
  • Implements backup controller state machines for insert operations with recovery logic
  • Updates training configurations and uncertainty-based switching parameters
  • Adds LaTeX documentation for the switching logic algorithm

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 23 comments.

Show a summary per file
File Description
terminations.py Modified termination conditions for object insertion with updated thresholds and added debug prints
observations.py (tasks) Added debug print statements to observation functions
dev_ik_rel_vial_insert_top_down.py New configuration file for top-down vial insertion task
dev_ik_rel_vial_insert.py Updated termination parameters for success criteria
bc_rnn_low_dim.json Modified WandB project name and increased training epochs
init.py Registered new "Dev-IK-Rel-Insert-v1" environment
generation.py Changed log file mode from append to write
observations.py (isaaclab) Added debug print for joint positions
train_ensemble.py Updated hard-coded data paths and bootstrap sampling percentage
switching_logic_algorithm.tex New LaTeX documentation for uncertainty-based switching logic
play_with_backup.py Changed backup controller task type to "insert"
play_ensemble_v05.py Enabled recovery mode and updated uncertainty parameters for vial insertion
play_controller.py Switched to BackupControllerInsertSM
backup_controller_insert_top.py New state machine controller implementation for top-down insertion
backup_controller_insert.py Extensive updates to state machine logic with rotation checking and new UNGRASP state
backup_controller_handler.py Added "insert_top" task type support with duplicate import
run_experiments.sh Updated experiment configuration for insert task
config.json New training configuration file
find_best_checkpoints.py Changed to absolute Docker path

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

height_dist = torch.linalg.vector_norm(pos_diff[:, 2:], dim=1)
xy_dist = torch.linalg.vector_norm(pos_diff[:, :2], dim=1)
#print(f"For DEBUG : xy_dist : {xy_dist}, height_dist : {height_dist}")
# print(f"For DEBUG : xy_dist : {xy_dist}, height_dist : {height_dist}")

Copilot AI Feb 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation. The comment on line 164 has incorrect indentation (3 spaces instead of 4), which violates Python's PEP 8 style guidelines.

Copilot uses AI. Check for mistakes.
Comment on lines 189 to +191
#print(f"For DEBUG : STACKED STATUS : {stacked}")
stacked_upright = stacked & upright_good
#print(f"For DEBUG : STACKED STATUS : {stacked_upright}, {stacked}, {upright_good} ")

Copilot AI Feb 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation. The comment on line 191 has incorrect indentation (3 spaces instead of 4), which violates Python's PEP 8 style guidelines.

Suggested change
#print(f"For DEBUG : STACKED STATUS : {stacked}")
stacked_upright = stacked & upright_good
#print(f"For DEBUG : STACKED STATUS : {stacked_upright}, {stacked}, {upright_good} ")
# print(f"For DEBUG : STACKED STATUS : {stacked}")
stacked_upright = stacked & upright_good
# print(f"For DEBUG : STACKED STATUS : {stacked_upright}, {stacked}, {upright_good} ")

Copilot uses AI. Check for mistakes.
robot.data.root_state_w[:, :3], robot.data.root_state_w[:, 3:7], object_pos_w
)

#print(f"object position : {object_pos_b}")

Copilot AI Feb 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation. The comment on line 37 has incorrect indentation (3 spaces instead of 4), which violates Python's PEP 8 style guidelines.

Suggested change
#print(f"object position : {object_pos_b}")
# print(f"object position : {object_pos_b}")

Copilot uses AI. Check for mistakes.
)
dot = wp.min(dot, float(1.0))
angle = float(2.0) * wp.acos(dot)
# print(f"angle : {angle}, threshold : {threshold_rad}")

Copilot AI Feb 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation. The comment on line 60 has incorrect indentation (3 spaces instead of 4), which violates Python's PEP 8 style guidelines.

Suggested change
# print(f"angle : {angle}, threshold : {threshold_rad}")
# print(f"angle : {angle}, threshold : {threshold_rad}")

Copilot uses AI. Check for mistakes.
robot: Articulation = env.scene[robot_cfg.name]
upper: RigidObject = env.scene[upper_object_cfg.name]
tilt_deg = upright_tilt_deg(upper.data.root_quat_w, upper.data.default_root_state[:, 3:7])
print(f"Tilt deg: {tilt_deg}")

Copilot AI Feb 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This print statement should be removed before merging to production. Debug print statements left in production code can clutter logs and impact performance.

Suggested change
print(f"Tilt deg: {tilt_deg}")

Copilot uses AI. Check for mistakes.
Comment on lines +112 to +114
self.observations.subtask_terms.appr_goal=ObsTerm(func=mdp.is_object_lifted, params={"threshold":0.15}

)

Copilot AI Feb 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing closing parenthesis. The ObsTerm function call on line 112 is not properly closed, which will cause a syntax error.

Suggested change
self.observations.subtask_terms.appr_goal=ObsTerm(func=mdp.is_object_lifted, params={"threshold":0.15}
)
self.observations.subtask_terms.appr_goal = ObsTerm(
func=mdp.is_object_lifted,
params={"threshold": 0.15},
)

Copilot uses AI. Check for mistakes.
Comment on lines +81 to +97
# self.scene.robot = FRANKA_PANDA_HIGH_PD_CFG.replace(
# prim_path="{ENV_REGEX_NS}/Robot",
# init_state=ArticulationCfg.InitialStateCfg(
# joint_pos={

# "panda_joint1": 0.3281,
# "panda_joint2": -0.3684,
# "panda_joint3": -0.2787,
# "panda_joint4": -2.6138,
# "panda_joint5": -2.7527,
# "panda_joint6": 2.4991, # +90° → keeps hand level
# "panda_joint7": 0.3331,
# "panda_finger_joint1": 0.04, # open gripper
# "panda_finger_joint2": 0.04,
# }
# ),
# )

Copilot AI Feb 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Large blocks of commented-out code (lines 81-97) reduce code readability and maintainability. If this code is no longer needed, it should be removed. If it might be useful in the future, consider documenting why it's kept or moving it to version control history.

Suggested change
# self.scene.robot = FRANKA_PANDA_HIGH_PD_CFG.replace(
# prim_path="{ENV_REGEX_NS}/Robot",
# init_state=ArticulationCfg.InitialStateCfg(
# joint_pos={
# "panda_joint1": 0.3281,
# "panda_joint2": -0.3684,
# "panda_joint3": -0.2787,
# "panda_joint4": -2.6138,
# "panda_joint5": -2.7527,
# "panda_joint6": 2.4991, # +90° → keeps hand level
# "panda_joint7": 0.3331,
# "panda_finger_joint1": 0.04, # open gripper
# "panda_finger_joint2": 0.04,
# }
# ),
# )

Copilot uses AI. Check for mistakes.
)
dot = wp.min(dot, float(1.0))
angle = float(2.0) * wp.acos(dot)
# print(f"angle : {angle}, threshold : {threshold_rad}")

Copilot AI Feb 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation. The comment on line 60 has incorrect indentation (3 spaces instead of 4), which violates Python's PEP 8 style guidelines.

Suggested change
# print(f"angle : {angle}, threshold : {threshold_rad}")
# print(f"angle : {angle}, threshold : {threshold_rad}")

Copilot uses AI. Check for mistakes.
#print(f"rpy version :{torch.cat([rest_pos,roll.unsqueeze(0), pitch.unsqueeze(0), yaw.unsqueeze(0)], dim =-1)}")
if self.tasktype == "insert_top":
rest_pos = torch.tensor([[ 0.6226, -0.0621, 0.3555]], device=self.device)
rest_rot = tensor([[ 0, 1, 0, 0]], device=self.device)

Copilot AI Feb 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing import statement for 'tensor'. The code uses 'tensor' on line 105 but it's not imported. This should be 'torch.tensor' to avoid a NameError.

Suggested change
rest_rot = tensor([[ 0, 1, 0, 0]], device=self.device)
rest_rot = torch.tensor([[ 0, 1, 0, 0]], device=self.device)

Copilot uses AI. Check for mistakes.

def upright_tilt_deg(q_cur, q_init) -> torch.Tensor:
u_cur, u_init = matrix_from_quat(q_cur)[:, :, 2], matrix_from_quat(q_init)[:, :, 2]
# print(f"upright good {torch.rad2deg(torch.acos((u_cur * u_init).sum(-1).clamp(-1.0, 1.0)))}")

Copilot AI Feb 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation. The comment on line 147 has incorrect indentation (3 spaces instead of 4), which violates Python's PEP 8 style guidelines. This should be aligned with the rest of the function body.

Suggested change
# print(f"upright good {torch.rad2deg(torch.acos((u_cur * u_init).sum(-1).clamp(-1.0, 1.0)))}")
# print(f"upright good {torch.rad2deg(torch.acos((u_cur * u_init).sum(-1).clamp(-1.0, 1.0)))}")

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation isaac-mimic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants