Repository navigation
Expand file tree
/
Copy pathinterfaces.py
More file actions
73 lines (62 loc) · 1.63 KB
/
Copy pathinterfaces.py
File metadata and controls
73 lines (62 loc) · 1.63 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
class ILoop(object):
objects = []
def add_object(self, obj):
"""
Add object to the pool of objects
:param obj: Updatable object
:type obj: interfaces.IUpdatable
"""
raise NotImplementedError
def tick(self):
"""
Process update method of all objects
"""
raise NotImplementedError
def start(self):
"""
Init loop and start reactor
"""
raise NotImplementedError
class IUpdatable(object):
def update(self, t):
"""
:param t: Time, passed since last update in seconds
:type t: float
"""
raise NotImplementedError
class ICar(object):
def get_speed(self):
"""
Get value of car's speed
:return: Value of car's speed
:rtype: float
"""
raise NotImplementedError
def get_heading(self):
"""
Get value of car's heading
:return: Value of car's heading in degrees 0 .. 359.9
:rtype: float
"""
raise NotImplementedError
def get_location(self):
"""
Get current car's location
:return: Value of car's location
:rtype: utils.GeoPoint
"""
raise NotImplementedError
def get_odometer_value(self):
"""
Get path length since previous point
:return: Odometers value
:rtype: float
"""
raise NotImplementedError
def get_full_mileage(self):
"""
Get path length since start of car
:return: Value of car's mileage
:rtype: float
"""
raise NotImplementedError