Skip to content
Snippets Groups Projects
Commit 4581485a authored by oceanpdoshi@g.ucla.edu's avatar oceanpdoshi@g.ucla.edu
Browse files

fixed subjectID

parent 3ff0ca2e
Branches
No related merge requests found
......@@ -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
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment