Skip to content

Commit

Permalink
update grasping example
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouxian committed Jan 5, 2025
1 parent 8c8df82 commit bc2e122
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/tutorials/IK_motion_planning_grasp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import numpy as np

import genesis as gs
import numpy as np

########################## init ##########################
gs.init(backend=gs.gpu)
Expand All @@ -15,7 +14,6 @@
),
sim_options=gs.options.SimOptions(
dt=0.01,
substeps=4, # for more stable grasping contact
),
show_viewer=True,
)
Expand Down Expand Up @@ -77,9 +75,10 @@
# reach
qpos = franka.inverse_kinematics(
link=end_effector,
pos=np.array([0.65, 0.0, 0.135]),
pos=np.array([0.65, 0.0, 0.130]),
quat=np.array([0, 1, 0, 0]),
)
print(qpos)
franka.control_dofs_position(qpos[:-2], motors_dof)
for i in range(100):
scene.step()
Expand All @@ -94,9 +93,10 @@
# lift
qpos = franka.inverse_kinematics(
link=end_effector,
pos=np.array([0.65, 0.0, 0.3]),
pos=np.array([0.65, 0.0, 0.28]),
quat=np.array([0, 1, 0, 0]),
)
print(qpos)
franka.control_dofs_position(qpos[:-2], motors_dof)
for i in range(200):
scene.step()

0 comments on commit bc2e122

Please sign in to comment.