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

Why jaco_arm/joints_pos shape is (1, 6, 2) and how to do joint position control? #489

Open
zhuoqun-chen opened this issue Aug 21, 2024 · 0 comments

Comments

@zhuoqun-chen
Copy link

@yuvaltassa @kevinzakka

Hi dm_control developers team,

As the title suggested, I have 2 questions:

  1. For the default manipulation env with kinova jaco arm, why the joint position has 2 dim for each joint for a 6-DoF jaco arm? How to convert this observation to qpos, which has exactly 1 dim per joint?

  2. For the same env, how to turn the torque control to joint position control (control qpos)?

The minimum code is:

import gymnasium as gym
env = gym.make("dm_control/lift_large_box_features-v0", render_mode="rgb_array")
print(env.observation_spec())
print(env.action_spec())

and this gives me:

env.observation_spec(): OrderedDict([
        ('jaco_arm/joints_pos', Array(shape=(1, 6, 2), dtype=dtype('float64'), name='jaco_arm/joints_pos')),
        ('jaco_arm/joints_torque', Array(shape=(1, 6), dtype=dtype('float64'), name='jaco_arm/joints_torque')),
        ('jaco_arm/joints_vel', Array(shape=(1, 6), dtype=dtype('float64'), name='jaco_arm/joints_vel')),
        ('jaco_arm/jaco_hand/joints_pos', Array(shape=(1, 3), dtype=dtype('float64'), name='jaco_arm/jaco_hand/joints_pos')),
        ('jaco_arm/jaco_hand/joints_vel', Array(shape=(1, 3), dtype=dtype('float64'), name='jaco_arm/jaco_hand/joints_vel')),
        ('jaco_arm/jaco_hand/pinch_site_pos', Array(shape=(1, 3), dtype=dtype('float64'), name='jaco_arm/jaco_hand/pinch_site_pos')),
        ('jaco_arm/jaco_hand/pinch_site_rmat', Array(shape=(1, 9), dtype=dtype('float64'), name='jaco_arm/jaco_hand/pinch_site_rmat')),
        ('unnamed_model/angular_velocity', Array(shape=(1, 3), dtype=dtype('float64'), name='unnamed_model/angular_velocity')),
        ('unnamed_model/linear_velocity', Array(shape=(1, 3), dtype=dtype('float64'), name='unnamed_model/linear_velocity')),
        ('unnamed_model/orientation', Array(shape=(1, 4), dtype=dtype('float64'), name='unnamed_model/orientation')),
        ('unnamed_model/position', Array(shape=(1, 3), dtype=dtype('float64'), name='unnamed_model/position')),
    ])

env.action_spec(): (
        BoundedArray(shape=(9,), dtype=dtype('float64'), name='jaco_arm/joint_1\tjaco_arm/joint_2\tjaco_arm/joint_3\tjac
        o_arm/joint_4\tjaco_arm/joint_5\tjaco_arm/joint_6\tjaco_arm/jaco_hand/finger_1\tjaco_arm/jaco_hand/finger_2\tjac
        o_arm/jaco_hand/finger_3', minimum=[-0.62831853 -0.62831853 -0.62831853 -0.83775804 -0.83775804 -0.83775804
         -5.         -5.         -5.        ], maximum=[0.62831853 0.62831853 0.62831853 0.83775804 0.83775804
        0.83775804
         5.         5.         5.        ])
    

by processing info from above we have:

('jaco_arm/joints_pos', Array(shape=(1, 6, 2), dtype=dtype('float64'), name='jaco_arm/joints_pos')),

And I just wonder why it's (1, 6, 2).

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

No branches or pull requests

1 participant