Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add create_action_vector() for 'basic' controller; converts body part key/vector into full vector #589

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kevin-thankyou-lin
Copy link
Contributor

@kevin-thankyou-lin kevin-thankyou-lin commented Dec 12, 2024

What this does

Goal: specify values for each joint.

Added create_action_vector() for BASIC controller; currently, converts body part key-vector dict into full vector.

How it was tested

python robosuite/demos/demo_random_action.py --robots Panda --controller BASIC

Note: need to revert basic.json after testing.

Implementation notes

Currently, something wrong with the SimpleGripperController's control_dim for InspireHand. The input dim should be 6, but the control dim is 11. @xieleo5, we'd need to retrieve the correct joints that're being set so that the keys of the action dict correspond to individual joint names. Do you know how to do that (esp. for the InspireHand, but also in general)?

ipdb>         env.robots[0].print_action_info_dict()
 
[robosuite INFO] 
Action Info for GR1FixedLowerBody:

{
    "Action Dimension": [
        32
    ],
    "Action Split Indexes": {
        "right": [
            0,
            7
        ],
        "left": [
            7,
            14
        ],
        "torso": [
            14,
            17
        ],
        "head": [
            17,
            20
        ],
        "right_gripper": [
            20,
            26
        ],
        "left_gripper": [
            26,
            32
        ]
    },
    "Action Split Joint Names": {
        "right": [
            "robot0_r_shoulder_pitch",
            "robot0_r_shoulder_roll",
            "robot0_r_shoulder_yaw",
            "robot0_r_elbow_pitch",
            "robot0_r_wrist_yaw",
            "robot0_r_wrist_roll",
            "robot0_r_wrist_pitch"
        ],
        "left": [
            "robot0_l_shoulder_pitch",
            "robot0_l_shoulder_roll",
            "robot0_l_shoulder_yaw",
            "robot0_l_elbow_pitch",
            "robot0_l_wrist_yaw",
            "robot0_l_wrist_roll",
            "robot0_l_wrist_pitch"
        ],
        "torso": [
            "robot0_torso_waist_yaw",
            "robot0_torso_waist_pitch",
            "robot0_torso_waist_roll"
        ],
        "head": [
            "robot0_head_yaw",
            "robot0_head_roll",
            "robot0_head_pitch"
        ],
        "right_gripper": [
            "gripper0_right_R_thumb_proximal_yaw_joint",
            "gripper0_right_R_thumb_proximal_pitch_joint",
            "gripper0_right_R_thumb_distal_joint",
            "gripper0_right_R_index_proximal_joint",
            "gripper0_right_R_index_intermediate_joint",
            "gripper0_right_R_middle_proximal_joint",
            "gripper0_right_R_middle_intermediate_joint",
            "gripper0_right_R_ring_proximal_joint",
            "gripper0_right_R_ring_intermediate_joint",
            "gripper0_right_R_pinky_proximal_joint",
            "gripper0_right_R_pinky_intermediate_joint"
        ],
        "left_gripper": [
            "gripper0_left_L_thumb_proximal_yaw_joint",
            "gripper0_left_L_thumb_proximal_pitch_joint",
            "gripper0_left_L_thumb_distal_joint",
            "gripper0_left_L_index_proximal_joint",
            "gripper0_left_L_index_intermediate_joint",
            "gripper0_left_L_middle_proximal_joint",
            "gripper0_left_L_middle_intermediate_joint",
            "gripper0_left_L_ring_proximal_joint",
            "gripper0_left_L_ring_intermediate_joint",
            "gripper0_left_L_pinky_proximal_joint",
            "gripper0_left_L_pinky_intermediate_joint"
        ]
    }
} 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant