legged_gym
legged_gym copied to clipboard
How to get the coordinates of the robot's toe end position?
Hi, How to get the coordinates of the robot's toe end position? Thanks!
Hi, We can generate a list of feet indices:
for name in feet_name:
idx = gym.find_asset_rigid_body_index(robot_asset, name)
feet_index.append(idx)
Then we can acquire rigid body states and wrap them for later use
_rb_states = gym.acquire_rigid_body_state_tensor(sim)
rb_states = gymtorch.wrap_tensor(_rb_states)
rigid_body_state = rb_states.view(num_envs,-1, 13) #[num_envs,num_bodies,13]
When we wish to get the required data:
gym.refresh_rigid_body_state_tensor(sim)
feet_vel = rigid_body_state[:,feet_index,7:10]
feet_pos = rigid_body_state[:,feet_index,0:3]
Note that the acquired data is with respect to the environment frame.