-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathconfig.py
More file actions
64 lines (55 loc) · 1.58 KB
/
config.py
File metadata and controls
64 lines (55 loc) · 1.58 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
import numpy as np
TIMESTEP = 0.05
ROBOT_RADIUS = 0.3
ALERT_RADIUS = 3*ROBOT_RADIUS
SENSING_RADIUS = 3.0
ITER_MAX = 1000
EPSILON = 0.1
ALPHA = 8
VREF = 1.0
VMAX = 2.0
UMAX = 2.0
UREF = np.array([1,0,0])
DREF = 1.0
W_form = 1.0
W_tail = 1.0
W_obs = 8.0
W_col = 8.0
W_rand = 2e-2
XLIM = [-20., 25.]
YLIM = [ 0., 6.5]
SIZE = [10, 3]
INITS = np.array([[-18.0, 3.0, 0.],
[-18.1, 5.0, 0.],
[-18.2, 4.0, 0.],
[-18.3, 2.0, 0.],
[-18.4, 1.0, 0.]])
XGOAL = 22.
NUM_ROBOT = INITS.shape[0]
# Formation description
TYPE = 1
if TYPE == 1: # Polygon
TOPOLOGY = []
for i in range(NUM_ROBOT):
TOPOLOGY.append([np.cos(2*np.pi/NUM_ROBOT*i), np.sin(2*np.pi/NUM_ROBOT*i), 0.0])
TOPOLOGY = np.array(TOPOLOGY)
elif TYPE == 2: # V shape
TOPOLOGY = np.array([[ 1.0, 0.0, 0.0],
[-1.0, 1.0, 0.0],
[ 0.0, 0.5, 0.0],
[ 0.0,-0.5, 0.0],
[-1.0,-1.0, 0.0]])
CONTROLLER = 'erc' # erc, bc, iapf
# Create obstacles
OBSTACLES = [
# Forest-like
[[-5.0, 3.0], [-5.5, 3.5], [-4.5, 4.0], [-4.0, 3.0]],
[[-10.0, 0.7], [-9.5, 1.5], [-8.5, 1.9], [-9.0, 0.7]],
[[-12.0, 5.0], [-11.5, 4.5], [-10.5, 4.7], [-11.5, 5.5]],
[[-3.0, 0.5], [-2.5, 1.0], [-1.5, 1.2], [-2.0, 0.1]],
# Narrow gap
[[0.0, 0.0], [ 5.0, 3.0], [15.0, 3.0], [20.0, 0.0]],
[[0.0, 6.5], [10.0, 4.0], [15.0, 4.0], [20.0, 6.5]]
]
FILE_NAME = "results/data_{}_shape{}.txt".format(CONTROLLER, TYPE)
GIF_NAME = "results/gif_{}_shape{}.gif".format(CONTROLLER, TYPE)