-
Notifications
You must be signed in to change notification settings - Fork 3
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
Question about the dataset format #1
Comments
I have debugged the But when I load the real world data, there are certain differences in the data, Specifically, I find a difference between My code is as following: import h5py
import numpy as np
from scipy.spatial.transform import Rotation as R
import robosuite.utils.transform_utils as trans
def calc_goal_rotmat(delta: np.ndarray, current_orientation: np.ndarray):
quat_error = trans.axisangle2quat(delta)
rotation_mat_error = trans.quat2mat(quat_error)
goal_orientation = np.dot(rotation_mat_error, current_orientation)
return goal_orientation
def scale_action(action: np.ndarray):
"""
this function is used when I run the eval.py
reference from robosuite.controllers.base_controller.Controller.scale_action
[robosuite](https://github.com/ARISE-Initiative/robosuite/blob/b9d8d3de5e3dfd1724f4a0e6555246c460407daa/robosuite/controllers/base_controller.py#L104)
action: np.ndarray shape = (N, 6)
"""
input_min = np.array([-1., -1., -1., -1., -1., -1.])
input_max = np.array([1., 1., 1., 1., 1., 1.])
output_max = np.array([0.05, 0.05, 0.05, 0.5 , 0.5 , 0.5 ])
output_min = np.array([-0.05, -0.05, -0.05, -0.5 , -0.5 , -0.5 ])
action_scale = np.abs(output_max - output_min) / np.abs(input_max - input_min)
action_output_transform = (output_max + output_min) / 2.0
action_input_transform = (input_max + input_min) / 2.0
return (action - action_input_transform) * action_scale + action_output_transform
f = h5py.File("RW8_open_the_top_drawer_demo.hdf5", "r") # load the read world data
actions = np.array(f["data/demo_0/actions"])
actions[:, :-1] = scale_action(actions[:, :-1]) # scale action
ee_states = np.array(f["data/demo_0/obs/ee_states"]).reshape(-1, 4, 4).transpose(0, 2, 1) # ee pose in base frame (N, 4, 4)
ee_rotmat = ee_states[:, :3, :3] # (N, 3, 3)
for i in range(ee_rotmat.shape[0] - 1):
target_rotmat = calc_goal_rotmat(actions[i, 3:6], ee_rotmat[i])
print("max rot difference:", np.abs(R.from_matrix(target_rotmat).as_rotvec() - R.from_matrix(ee_rotmat[i + 1]).as_rotvec()).max(), end=", ")
print("max xyz difference:", np.abs(ee_states[i + 1, :3, 3] - (ee_states[i, :3, 3] + actions[i, :3])).max())
f.close() The output is as follows:
I think there may be a problem with the parameters in the function |
Hi, Thanks for showing interest in our work. The equation On a side note, we do not use |
Thanks for resolving my doubts😄. @ShahRutav input_min = np.array([-1., -1., -1., -1., -1., -1.])
input_max = np.array([1., 1., 1., 1., 1., 1.])
output_max = np.array([0.05, 0.05, 0.05, 0.5 , 0.5 , 0.5 ])
output_min = np.array([-0.05, -0.05, -0.05, -0.5 , -0.5 , -0.5 ]) It is important for deploying the MUTEX in my robotic arm. |
Hi, Due to hardware constraints, the action scaling can be very different in simulation and real-world. I can attach the controller configs if that is helpful (as soon as I can access the robot). Let me know if you need it! |
Hi, thanks for your great work.
I want to deploy your work on my robotic arm, but I am not very clear about the format of the data. Specifically, I have checked the realworld dataset you provided and it has the following format:
I can understand the meanings of
agentview_rgb
,eye_in_hand_rgb
,gripper_states
, andjoint_states
, but I am not clear about the specific meanings represented by each value ofactions
, andee_states
.Can you explain their meanings?
Thanks!
The text was updated successfully, but these errors were encountered: