diff --git a/CoLo-AT/dataset_manager/data_generator.py b/CoLo-AT/dataset_manager/data_generator.py index 97985478045b95e08bfcbb7217857050cfc7c525..13fc4c26b4a3f736c9c29ffee77a2db682ba9f40 100644 --- a/CoLo-AT/dataset_manager/data_generator.py +++ b/CoLo-AT/dataset_manager/data_generator.py @@ -204,14 +204,14 @@ class DataGenerator(): # Relative (other robots) observations other_robot_locs = {label : [self.groundtruth_data[i][time_idx]['x_pos'], self.groundtruth_data[i][time_idx]['y_pos']] for i, label in enumerate(self.robot_labels, 0) if i != robot_idx } - for robotidx, other_robot_loc in other_robot_locs.items(): + for robotID, other_robot_loc in other_robot_locs.items(): if (self.within_vision(self.robot_fov, robot_loc, other_robot_loc, robot_orientation)): measurement_range = self.calc_distance(robot_loc, other_robot_loc) + np.random.normal(loc=0.0,scale=self.measurement_range_noise) bearing = atan2((other_robot_loc[1]-robot_loc[1]), (other_robot_loc[0]-robot_loc[0])) + np.random.normal(loc=0.0,scale=self.bearing_noise) # global coordinates bearing = bearing - robot_orientation # NOTE - local = global - orientation, all between 0 and 2*pi bearing = self.converge_to_angle_range(bearing) - self.measurement_data[robot_idx].append({'time': time, 'subject_ID': self.robot_labels[robotidx], 'measurment_range':measurement_range, 'bearing':bearing}) + self.measurement_data[robot_idx].append({'time': time, 'subject_ID': robotID, 'measurment_range':measurement_range, 'bearing':bearing}) time_arr.append(time) # we expect repeats/skipped times in time array # Landmark (absolute) observations