Esempio n. 1
0
def generate_target(time, radar):
    # Generate true state
    state_transition_model = autocommon.DWNAModel(
        target_process_noise_covariance)
    initial_state = np.array([
        initial_position[0], initial_velocity[0], initial_position[1],
        initial_velocity[1]
    ])
    true_state_list = []
    for k, t in enumerate(time):
        if k == 0:
            true_state = autocommon.Estimate(t,
                                             initial_state,
                                             np.identity(4),
                                             is_posterior=True)
        else:
            true_state = state_transition_model.draw_transition(
                true_state_list[-1], t, is_posterior=True)
        true_state_list.append(true_state)

    # Generate measurements
    target_originated_measurements = []
    for k, t in enumerate(time):
        true_pos = true_state_list[k].est_posterior.take((0, 2))
        measurement = radar.generate_target_measurements([true_pos], t)
        target_originated_measurements.append(measurement)
    return target_originated_measurements, true_state_list
Esempio n. 2
0
def setup_ipda_manager():
    target_model = autocommon.DWNAModel(target_process_noise_covariance)
    track_gate = autocommon.TrackGate(gate_probability, maximum_velocity)
    clutter_model = autocommon.ConstantClutterModel(clutter_density)
    measurement_model = autocommon.CartesianMeasurementModel(
        measurement_mapping,
        measurement_covariance,
        PD,
        clutter_model=clutter_model)
    tracker = autotrack.IPDAFTracker(target_model, measurement_model,
                                     track_gate, survival_probability)
    track_initiation = autoinit.IPDAInitiator(tracker, init_prob,
                                              conf_threshold, term_threshold)
    track_termination = autotrack.IPDATerminator(term_threshold)
    ipda_track_manager = automanagers.Manager(tracker, track_initiation,
                                              track_termination)
    return ipda_track_manager
def generate_target(time, radar):
    # Generate true state
    state_transition_model = autocommon.DWNAModel(
        target_process_noise_covariance)
    initial_state = np.array([
        initial_position[0], initial_velocity[0], initial_position[1],
        initial_velocity[1]
    ])
    true_state_list = []
    for k, t in enumerate(time):
        if k == 0:
            true_state_list.append(
                autocommon.Estimate(t,
                                    initial_state,
                                    np.identity(4),
                                    is_posterior=True))
        elif t <= termination_time:
            true_state = state_transition_model.draw_transition(
                true_state_list[-1], t, is_posterior=True)
            true_state_list.append(true_state)

    # Generate measurements
    true_detectability = []
    true_existence = []
    target_originated_measurements = []
    for k, t in enumerate(time):
        if t >= detectability_change_time:
            radar.update_detection_probability(PD_low)
        if k < len(true_state_list):
            true_detectability.append(radar.detection_probability)
            true_pos = true_state_list[k].est_posterior.take((0, 2))
            measurement = radar.generate_target_measurements([true_pos], t)
            [true_state_list[k].store_measurement(z) for z in measurement]
            target_originated_measurements.append(measurement)
            true_existence.append(1)
        else:
            true_detectability.append(None)
            target_originated_measurements.append(set())
            true_existence.append(0)
    return target_originated_measurements, true_state_list, np.array(
        true_detectability), np.array(true_existence)
Esempio n. 4
0
def generate_scenario():
    ais_data, measurements_all, measurement_timestamps = autobag.bag2raw_data(
        selected_rosbag, return_timestamps=True)
    ais_data = add_landmark(measurements_all, landmark_mmsi, ais_data)
    ais_data = autobag.synchronize_track_file_to_timestamps(
        ais_data, measurement_timestamps, target_process_noise_covariance)
    true_targets = {
        mmsi: ais_data[mmsi]
        for mmsi in chosen_targets if mmsi in ais_data.keys()
    }
    ownship_state = ais_data[ownship_mmsi]
    return true_targets, ownship_state, measurements_all, measurement_timestamps


target_model = autocommon.DWNAModel(target_process_noise_covariance)
track_gate = autocommon.TrackGate(gate_probability, maximum_velocity)
clutter_model = autocommon.NonparametricClutterModel()


def setup_trackers(titles):
    current_managers = dict()
    for title in titles:
        if title == 'MC1-IPDA':
            measurement_model = autocommon.ConvertedMeasurementModel(
                measurement_mapping,
                measurement_covariance_range,
                measurement_covariance_bearing,
                single_PD,
                min_cartesian_cov,
                clutter_model=clutter_model)