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

How to set stateencoding and actionencoding in another robot (legged robot) #98

Open
wuyukun-tong opened this issue May 26, 2024 · 2 comments

Comments

@wuyukun-tong
Copy link

Hi
I am very confused hoe to modify the following code to fit my own data

`class StateEncoding(IntEnum):
"""Defines supported proprio state encoding schemes for different datasets."""

NONE = -1  # no state provided
POS_EULER = 1  # EEF XYZ + roll-pitch-yaw + 1 x pad + gripper open/close  
POS_QUAT = 2  # EEF XYZ + quaternion + gripper open/close
JOINT = 3  # 7 x joint angles (padding added if fewer) + gripper open/close
JOINT_BIMANUAL = 4  # 2 x [6 x joint angles + gripper open/close]

class ActionEncoding(IntEnum):
"""Defines supported action encoding schemes for different datasets."""

EEF_POS = 1  # EEF delta XYZ + roll-pitch-yaw + gripper open/close
JOINT_POS = 2  # 7 x joint delta position + gripper open/close
JOINT_POS_BIMANUAL = 3  # 2 x [6 x joint pos + gripper]`

In our custom dataset the robot state are the imu data and joint position data and the action is velocity of robot.

@kpertsch
Copy link
Collaborator

If you want to do finetuning you don't need to actually modify this code, you can just directly modify the finetuning config: https://github.com/octo-models/octo/blob/main/scripts/configs/finetune_config.py

The StateEncoding and ActionEncoding is primarily used to determine the action normalization mask (ie which dimensions should be normalized) here:

if dataset_kwargs["action_encoding"] is ActionEncoding.EEF_POS:

So if you want to use your dataset for OpenX co-training, you can define a new element in the Enums above and then modify the code in the link above to set the normalization mask accordingly (eg for Octo we typically don't normalize the gripper dimension)

@wuyukun-tong
Copy link
Author

Thank a lot !

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

2 participants