-
After reading the tutorials, I tried to implement a GO2 in Genesis. However, friction didn't seem to work correctly. Can Anyone kindly tell me what I missed while initializing the ground or GO2? Thanks a lot! Environment commit hash: 4a2987e Following is my code: import numpy as np
import genesis as gs
########################## init ##########################
gs.init(backend=gs.gpu)
########################## create a scene ##########################
scene = gs.Scene(
viewer_options=gs.options.ViewerOptions(
camera_pos=(0, -3.5, 2.5),
camera_lookat=(0.0, 0.0, 0.5),
camera_fov=30,
max_FPS=60,
),
sim_options=gs.options.SimOptions(
dt=0.01,
),
show_viewer=True,
)
########################## entities ##########################
plane = scene.add_entity(
gs.morphs.URDF(
file="urdf/plane/plane.urdf",
fixed=True,
),
material=gs.materials.Rigid(friction=1.0),
)
go2 = scene.add_entity(
gs.morphs.URDF(
file="urdf/go2/urdf/go2.urdf",
pos=[0.0, 0.0, 0.58],
quat=[0, -0.707, 0.0, 0.707],
),
material=gs.materials.Rigid(friction=1.0),
)
########################## build ##########################
scene.build()
joints_name = (
"FR_hip_joint",
"FR_thigh_joint",
"FR_calf_joint",
"FL_hip_joint",
"FL_thigh_joint",
"FL_calf_joint",
"RR_hip_joint",
"RR_thigh_joint",
"RR_calf_joint",
"RL_hip_joint",
"RL_thigh_joint",
"RL_calf_joint",
)
motors_dof_idx = [go2.get_joint(name).dofs_idx_local[0] for name in joints_name]
for i in range(10000):
go2.set_dofs_position(np.array([-0.1, 1, -2, 0.1, 1, -2, -0.1, 2.2, -1.2, -0.1, 2.2, -1.2]), motors_dof_idx)
scene.step()
print("joint angles:", go2.get_dofs_position(motors_dof_idx)),
print("pos:", go2.get_pos()) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Go2 should be rotating with its feet static as soon as it touches the ground vertically, but there seems to be no friction between its feet and the ground. |
Beta Was this translation helpful? Give feedback.
-
When I use |
Beta Was this translation helpful? Give feedback.
When I use
control_dofs_position
friction seems to be working correctly. Soset_dofs_position
causes physics to behave weird within its step, I see that.