Creating pk.Robot with only specific joints (reduced_model) from full urdf. #68
Open
chaitanya1chawla wants to merge 1 commit intochungmin99:mainfrom
Open
Creating pk.Robot with only specific joints (reduced_model) from full urdf. #68chaitanya1chawla wants to merge 1 commit intochungmin99:mainfrom
chaitanya1chawla wants to merge 1 commit intochungmin99:mainfrom
Conversation
Add a static method to create a reduced URDF file with preserved joint names and validate the structure.
Usage:
preserved_joint_names = [
# Left arm
'left_shoulder_pitch_joint',
'left_shoulder_roll_joint',
'left_shoulder_yaw_joint',
'left_elbow_joint',
'left_wrist_roll_joint',
'left_wrist_pitch_joint',
'left_wrist_yaw_joint',
# Right arm
'right_shoulder_pitch_joint',
'right_shoulder_roll_joint',
'right_shoulder_yaw_joint',
'right_elbow_joint',
'right_wrist_roll_joint',
'right_wrist_pitch_joint',
'right_wrist_yaw_joint',
# ... etc
]
original_urdf = "dexmachina/assets/g1/g1_body29_frozen_hand_mod_waist_new_arms_waist_yaw_lower_frozen.urdf"
reduced_urdf_path = "dexmachina/assets/g1/robot_reduced.urdf"
reduced_robot = create_reduced_urdf(
original_urdf,
preserved_joint_names,
reduced_urdf_path
)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a static method to create a robot with only specific joints.
First creates a reduced URDF with preserved_joint_names, and then creates a pk.Robot object using from_urdf().
Usage:
preserved_joint_names = [
# Left arm
'left_shoulder_pitch_joint',
'left_shoulder_roll_joint',
'left_shoulder_yaw_joint',
'left_elbow_joint',
'left_wrist_roll_joint',
'left_wrist_pitch_joint',
'left_wrist_yaw_joint',
# Right arm
'right_shoulder_pitch_joint',
'right_shoulder_roll_joint',
'right_shoulder_yaw_joint',
'right_elbow_joint',
'right_wrist_roll_joint',
'right_wrist_pitch_joint',
'right_wrist_yaw_joint',
# ... etc
]
original_urdf = "dexmachina/assets/g1/g1_body29_frozen_hand_mod_waist_new_arms_waist_yaw_lower_frozen.urdf" reduced_urdf_path = "dexmachina/assets/g1/robot_reduced.urdf"
reduced_robot = from_reduced_urdf(
original_urdf,
preserved_joint_names,
reduced_urdf_path
)