-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_moveo.py
More file actions
41 lines (33 loc) · 822 Bytes
/
Copy pathplot_moveo.py
File metadata and controls
41 lines (33 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import roboticstoolbox as rtb
import spatialmath as sm
from Moveo import Moveo
import numpy as np
from math import pi
# moveo model
robot = Moveo()
T = sm.SE3.Tx(0.3)
T *= sm.SE3.Tz(0.4)
# R = sm.SE3.Rz(90,'deg')
# print(T)
# inverse kinematics
ik = robot.ikine_LMS(T) # * R)
joint_angles = np.round(ik.q) * (180/pi)
#print(joint_angles)
#robot.teach(robot.qz, block=True)
# pulse/angle
'''
'''
pulse_per_deg = [((6400 * 10/1) / 360),
((6400 * 75/14) / 360),
((6400 * 150/7) / 360),
((6400 * 1/1) / 360),
((6400 * 22/5) / 360),
]
#print(joint_angles * pulse_per_deg)
# forward kinematics
fk = robot.fkine(ik.q)
# plot the robot
robot.plot(ik.q, block=True)
print(joint_angles)
# teach window for robot
# robot.teach(ik.q, block=True)