Replies: 3 comments
-
Well.. this is not exactly correct (I think), but try this... (if it doesn't work, try force = 0) Try:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
@rohit-kumar-j |
Beta Was this translation helpful? Give feedback.
0 replies
-
@Magikod |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I loaded a panda robot and want to open the gripper, move to target position, close the gripper. I use time.sleep() to delay the execution time between actions, but it doesn't work. It took a day and still hasn't solved the problem.
Hear is the code;
import pybullet as p
pandaId = p.loadURDF("franka_panda/panda.urdf")
robotEndPos = [1,1,1]
robotEndOrientation = p.getQuaternionFromEuler([0, 3.2 ,0])
targetPositionsJoints = p.calculateInverseKinematics(pandaId, 11, robotEndPos, robotEndOrientation)
finger_target = 0.2
finger_target2 = 0
#open the gripper
for i in range [9,10]:
p.setJointMotorControl2(pandaId, i, p.POSITION_CONTROL, finger_target,force = 10)
time.sleep(2)
#move to target position
for j in range (7):
p.setJointMotorControl2(pandaId, j, p.POSITION_CONTROL, targetPositionsJoints[j])
time.sleep(2)
#close the gripper
for k in range [9,10]:
p.setJointMotorControl2(pandaId, k, p.POSITION_CONTROL, finger_target2, force = 10)
Beta Was this translation helpful? Give feedback.
All reactions