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

Mismatch in Observation Order Between go2 and Other Environments #32

Open
juanjuanjuanbing opened this issue Jan 2, 2025 · 2 comments

Comments

@juanjuanjuanbing
Copy link

Thank you for your great work! I have encountered a problem when identifying observations. In the legged_robot.py environment class used in go2, the order of observations in compute_observations is as follows :
self.obs_buf torch.cat(( self.base_lin_vel * self.obs_scales.lin_vel, self.base_ang_vel * self.obs_scales.ang_vel, self.projected_gravity, self.commands[:, :3] * self.commands_scale, (self.dof_pos - self.default_dof_pos) * self.obs_scales.dof_pos, self.dof_vel * self.obs_scales.dof_vel, self.actions ), dim=-1)
However, in environments such as go1 and Mujoco deployments, the order of observations is:
self.obs_buf = torch.cat(( self.base_ang_vel * self.obs_scales.ang_vel, self.projected_gravity, self.commands[:, :3] * self.commands_scale, (self.dof_pos - self.default_dof_pos) * self.obs_scales.dof_pos, self.dof_vel * self.obs_scales.dof_vel, self.actions, sin_phase, cos_phase ), dim=-1)
If I want to train using go2, which order is correct? Theoretically, I should trust the former, but in my implemented network structure, I found that using the latter order for observations allows them to be correctly identified.

@craipy-hub
Copy link
Collaborator

I just provide a simple routine for your reference. If you want to train Go2, you can use any obs, but you just need to align them on different platforms.

@heartInsert
Copy link

@juanjuanjuanbing Did you solve this?

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

3 participants