-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample_6dof.py
41 lines (35 loc) · 905 Bytes
/
example_6dof.py
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
41
import SMSLibrary as sms
import time as t
sms.init(0)
motorId = [4, 5, 6, 7, 8, 9]
t.sleep(0.02)
sms.broadcastStop()
t.sleep(0.02)
sms.broadcastStart()
# sms.start(motorId)
for i in motorId:
sms.resetErrors(i)
# print(sms.getPosition(i))
t.sleep(0.02)
for i in motorId:
# sms.setProfiledVelocitySetpoint(i, 128)
print(sms.getAbsolutePosition(i)[1])
t.sleep(1)
# sms.broadcastDoMove()
t.sleep(1)
# print(sms.getPIDgainP(motorId))
# print(sms.getPIDgainI(motorId))
# print(sms.getPIDgainD(motorId))
# sms.profiledMoveToRelativePosition(motorId, 10000)
# t.sleep(5)
# print(float(sms.getPosition(motorId)[1]))
# sms.moveToRelativePosition(motorId, -16384)
# t.sleep(5)
# sms.moveWithVelocity(motorId, 10000)
# t.sleep(5)
# sms.profiledMoveWithVelocity(motorId, -10000)
# t.sleep(5)
# sms.moveToAbsolutePosition(motorId, 16384)
# sms.stop(5)
sms.broadcastStop()
sms.shut_down(0)