forked from tasbolat1/franka_analytical_ik
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.py
21 lines (18 loc) · 893 Bytes
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import numpy as np
from panda_kinematics import PandaWithHandKinematics
from panda_kinematics import PandaWithPumpKinematics
if __name__ == '__main__':
print('Example using kinematics with Panda + Hand')
kinematics = PandaWithHandKinematics()
position = np.array([0.53, 0.07, 0.31])
orientation_quat = np.array([ 0.0, 0.0, 0.0, 1.0]) # xyzw
initial_joint_positions = np.array([0, 0, 0, 0, 0, 0, 0])
solution = kinematics.ik(initial_joint_positions, position, orientation_quat)
print(solution)
print('Example using kinematics with Panda + Pump')
kinematics = PandaWithPumpKinematics()
position = np.array([0.53, 0.07, 0.31])
orientation_quat = np.array([ 0.0, 0.0, 0.0, 1.0]) # xyzw
initial_joint_positions = np.array([0, 0, 0, 0, 0, 0, 0])
solution = kinematics.ik(initial_joint_positions, position, orientation_quat)
print(solution)