@@ -48,7 +48,7 @@ def __init__(self):
4848 #self.model.to(self.device)
4949
5050
51- def env_parametrization (self , num_targets = 2 , num_sensors = 1 , target_motion_omegas = None , meas_model = 'range' ):
51+ def env_parametrization (self , num_targets = 4 , num_sensors = 1 , target_motion_omegas = None , meas_model = 'range' ):
5252 """
5353 Function for parametrizing the environment
5454 """
@@ -112,10 +112,10 @@ def env_parametrization(self, num_targets=2, num_sensors=1, target_motion_omegas
112112 self .y1_list .append (float (self .true_targets_pos [0 , 1 ]))
113113 self .x2_list .append (float (self .true_targets_pos [1 , 0 ]))
114114 self .y2_list .append (float (self .true_targets_pos [1 , 1 ]))
115- # self.x3_list.append(float(self.true_targets_pos[2, 0]))
116- # self.y3_list.append(float(self.true_targets_pos[2, 1]))
117- # self.x4_list.append(float(self.true_targets_pos[3, 0]))
118- # self.y4_list.append(float(self.true_targets_pos[3, 1]))
115+ self .x3_list .append (float (self .true_targets_pos [2 , 0 ]))
116+ self .y3_list .append (float (self .true_targets_pos [2 , 1 ]))
117+ self .x4_list .append (float (self .true_targets_pos [3 , 0 ]))
118+ self .y4_list .append (float (self .true_targets_pos [3 , 1 ]))
119119
120120 self .meas_model = meas_model
121121 if self .meas_model == 'bearing' :
@@ -145,10 +145,10 @@ def step(self, action, step_size):
145145 self .y1_list .append (float (self .true_targets_pos [0 , 1 ]))
146146 self .x2_list .append (float (self .true_targets_pos [1 , 0 ]))
147147 self .y2_list .append (float (self .true_targets_pos [1 , 1 ]))
148- # self.x3_list.append(float(self.true_targets_pos[2, 0]))
149- # self.y3_list.append(float(self.true_targets_pos[2, 1]))
150- # self.x4_list.append(float(self.true_targets_pos[3, 0]))
151- # self.y4_list.append(float(self.true_targets_pos[3, 1]))
148+ self .x3_list .append (float (self .true_targets_pos [2 , 0 ]))
149+ self .y3_list .append (float (self .true_targets_pos [2 , 1 ]))
150+ self .x4_list .append (float (self .true_targets_pos [3 , 0 ]))
151+ self .y4_list .append (float (self .true_targets_pos [3 , 1 ]))
152152
153153 self .heatmap = torch .zeros (self .len_workspace , self .len_workspace )
154154 for index in range (0 , self .num_targets ):
@@ -218,10 +218,10 @@ def reset(self, **kwargs):
218218 self .y1_list .append (float (self .true_targets_pos [0 , 1 ]))
219219 self .x2_list .append (float (self .true_targets_pos [1 , 0 ]))
220220 self .y2_list .append (float (self .true_targets_pos [1 , 1 ]))
221- # self.x3_list.append(float(self.true_targets_pos[2, 0]))
222- # self.y3_list.append(float(self.true_targets_pos[2, 1]))
223- # self.x4_list.append(float(self.true_targets_pos[3, 0]))
224- # self.y4_list.append(float(self.true_targets_pos[3, 1]))
221+ self .x3_list .append (float (self .true_targets_pos [2 , 0 ]))
222+ self .y3_list .append (float (self .true_targets_pos [2 , 1 ]))
223+ self .x4_list .append (float (self .true_targets_pos [3 , 0 ]))
224+ self .y4_list .append (float (self .true_targets_pos [3 , 1 ]))
225225
226226 self .heatmap = torch .zeros (self .len_workspace , self .len_workspace )
227227 for index in range (0 , self .num_targets ):
@@ -273,10 +273,10 @@ def render(self):
273273 plt .plot (self .x1_list [len (self .x1_list ) - 1 ], self .y1_list [len (self .y1_list ) - 1 ], 'o' , c = 'b' , marker = '*' )
274274 plt .plot (self .x2_list , self .y2_list , 'b--' )
275275 plt .plot (self .x2_list [len (self .x2_list ) - 1 ], self .y2_list [len (self .y2_list ) - 1 ], 'o' , c = 'b' , marker = '*' )
276- # plt.plot(self.x3_list, self.y3_list, 'b--')
277- # plt.plot(self.x3_list[len(self.x3_list) - 1], self.y3_list[len(self.y3_list) - 1], 'o', c='b', marker='*')
278- # plt.plot(self.x4_list, self.y4_list, 'b--')
279- # plt.plot(self.x4_list[len(self.x4_list) - 1], self.y4_list[len(self.y4_list) - 1], 'o', c='b', marker='*')
276+ plt .plot (self .x3_list , self .y3_list , 'b--' )
277+ plt .plot (self .x3_list [len (self .x3_list ) - 1 ], self .y3_list [len (self .y3_list ) - 1 ], 'o' , c = 'b' , marker = '*' )
278+ plt .plot (self .x4_list , self .y4_list , 'b--' )
279+ plt .plot (self .x4_list [len (self .x4_list ) - 1 ], self .y4_list [len (self .y4_list ) - 1 ], 'o' , c = 'b' , marker = '*' )
280280 if (len (self .robot_movement_x ) < 8 ):
281281 plt .plot (self .robot_movement_x , self .robot_movement_y , 'r--' )
282282 else :
0 commit comments