-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_2.py
76 lines (48 loc) · 1.61 KB
/
test_2.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
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
74
75
76
import numpy as np
class unit_param_double_t:
def __init__(self):
self.Name = ''
self.UnitOfMeas = ''
self.Value = 0
class unit_model_params_t:
def __init__(self):
# PID 控制器松弛时间
self.Tau_PID_XY = unit_param_double_t()
self.Tau_PID_Z = unit_param_double_t()
# 最大加速度
self.a_max = unit_param_double_t()
# GPS设备的刷新率
self.t_GPS = unit_param_double_t()
# 通信延迟
self.t_del = unit_param_double_t()
# 通信范围
self.R_C = unit_param_double_t()
# 丢包率相关
self.packet_loss_ratio = unit_param_double_t()
self.packet_loss_distance = unit_param_double_t()
# 噪声参数
self.Sigma_GPS_XY = unit_param_double_t() # inner noise
self.Sigma_Outer_XY = unit_param_double_t() # outer noise
self.Sigma_GPS_Z = unit_param_double_t() # inner noise
self.Sigma_Outer_Z = unit_param_double_t() # outer noise
# 风的影响(暂时加入,实际上并不需要)
self.Wind_Magn_Avg = unit_param_double_t()
self.Wind_StDev = unit_param_double_t()
self.Wind_Angle = unit_param_double_t()
self.ViscosityCoeff = unit_param_double_t()
class test():
def tt(self, a, b):
c = a + b
print(c)
a = c
def InsertAgentsVelocity(self, Phase, Velocity):
for j in range(3):
Phase[j] = Velocity[j]
t = test()
Phase = np.zeros(3)
Velocity = np.ones(3)
a = 1
b = 1
print(t.tt(a,b))
t.InsertAgentsVelocity(Phase,Velocity)
print(Phase)