-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcarre.py
More file actions
55 lines (46 loc) · 1.01 KB
/
carre.py
File metadata and controls
55 lines (46 loc) · 1.01 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/python3
from class_robot import *
from class_table import *
from math import *
from math import *
from proxi_serial import *
from time import sleep
import threading
table = Table();
proxy = Proxy_serial()
robot = Robot(table,proxy);
robot.distanceHard()
robot.rotationHard()
robot.setTicks(0,0)
robot.setX(0)
robot.setY(0)
robot.setAngle(0)
robot.setTickRatio(27800,4350);
# robot.goto(300,0,pi/2)
# robot.goto(300,300,pi)
# robot.goto(0,300,-pi/2)
# robot.goto(0,0,0)
robot.goto(300,0,-pi/2)
robot.goto(300,-300,pi)
robot.goto(0,-300,pi/2)
robot.goto(0,0,0)
# robot.goto(30, 0, end_angle = 0)
# robot.goto(0, 0, end_angle = 0)
# robot.moveForward(400)
# robot.moveBackward(400)
# robot.rotate(3.14)
# robot.rotate(-3.14)
# # robot.setDistCoeffs(0,0)
# while True :
# print(robot.isJumperIn())
# robot.proxy.setServo(15,10)
# sleep(1)
# robot.proxy.setServo(15,100)
print(robot.getX())
print(robot.getY())
print(robot.getAngle())
sleep(5)
robot.distanceSoft()
robot.rotationSoft()
# # print()
# sleep(1)