diff --git a/scenarios.json b/scenarios.json index 5554f54..eb2ce9a 100644 --- a/scenarios.json +++ b/scenarios.json @@ -1,126 +1,166 @@ { - "scenario1": { - "name": "scenario1", - "targets": [ - { - "target_id": 0, - "active": true, - "traceable": true, - "trajectory": [ - { - "maneuver_type": "Fly to Point", - "duration_s": 10.0, - "target_altitude_ft": 10000.0, - "target_range_nm": 20.0, - "target_azimuth_deg": 0.0 - }, - { - "maneuver_type": "Fly for Duration", - "target_velocity_fps": 1670.9318999999994, - "target_heading_deg": 10.0, - "duration_s": 300.0, - "target_altitude_ft": 10000.0 - }, - { - "maneuver_type": "Fly to Point", - "duration_s": 400.0, - "target_altitude_ft": 10000.0, - "target_range_nm": 25.0, - "target_azimuth_deg": -20.0 - } - ] - } - ] - }, - "scenario2": { - "name": "scenario2", - "targets": [ - { - "target_id": 0, - "active": true, - "traceable": true, - "trajectory": [ - { - "maneuver_type": "Fly to Point", - "duration_s": 10.0, - "target_altitude_ft": 10000.0, - "target_range_nm": 10.0, - "target_azimuth_deg": 1.0 - }, - { - "maneuver_type": "Fly to Point", - "duration_s": 200.0, - "target_altitude_ft": 10000.0, - "target_range_nm": 20.0, - "target_azimuth_deg": 10.0 - }, - { - "maneuver_type": "Fly to Point", - "duration_s": 200.0, - "target_altitude_ft": 10000.0, - "target_range_nm": 30.0, - "target_azimuth_deg": -10.0 - }, - { - "maneuver_type": "Fly to Point", - "duration_s": 200.0, - "target_altitude_ft": 10000.0, - "target_range_nm": 35.0, - "target_azimuth_deg": 10.0 - }, - { - "maneuver_type": "Fly to Point", - "duration_s": 200.0, - "target_altitude_ft": 10000.0, - "target_range_nm": 35.0, - "target_azimuth_deg": 30.0 - }, - { - "maneuver_type": "Fly to Point", - "duration_s": 200.0, - "target_altitude_ft": 10000.0, - "target_range_nm": 20.0, - "target_azimuth_deg": 45.0 - } - ], - "use_spline": true - }, - { - "target_id": 1, - "active": true, - "traceable": true, - "trajectory": [ - { - "maneuver_type": "Fly to Point", - "duration_s": 10.0, - "target_altitude_ft": 10000.0, - "target_range_nm": 10.0, - "target_azimuth_deg": 10.0 - }, - { - "maneuver_type": "Fly to Point", - "duration_s": 10.0, - "target_altitude_ft": 10000.0, - "target_range_nm": 20.0, - "target_azimuth_deg": 20.0 - }, - { - "maneuver_type": "Fly to Point", - "duration_s": 30.0, - "target_altitude_ft": 10000.0, - "target_range_nm": 30.0, - "target_azimuth_deg": 30.0 - }, - { - "maneuver_type": "Fly to Point", - "duration_s": 30.0, - "target_altitude_ft": 10000.0, - "target_range_nm": 35.0, - "target_azimuth_deg": -10.0 - } - ], - "use_spline": false - } - ] - } + "scenario1": { + "name": "scenario1", + "targets": [ + { + "target_id": 0, + "active": true, + "traceable": true, + "trajectory": [ + { + "maneuver_type": "Fly to Point", + "duration_s": 10.0, + "target_altitude_ft": 10000.0, + "target_range_nm": 20.0, + "target_azimuth_deg": 0.0 + }, + { + "maneuver_type": "Fly for Duration", + "target_velocity_fps": 1670.9318999999994, + "target_heading_deg": 10.0, + "duration_s": 300.0, + "target_altitude_ft": 10000.0 + }, + { + "maneuver_type": "Fly to Point", + "duration_s": 400.0, + "target_altitude_ft": 10000.0, + "target_range_nm": 25.0, + "target_azimuth_deg": -20.0 + } + ] + } + ] + }, + "scenario2": { + "name": "scenario2", + "targets": [ + { + "target_id": 0, + "active": true, + "traceable": true, + "trajectory": [ + { + "maneuver_type": "Fly to Point", + "duration_s": 10.0, + "target_range_nm": 10.0, + "target_azimuth_deg": 1.0, + "target_altitude_ft": 10000.0, + "longitudinal_acceleration_g": 0.0, + "lateral_acceleration_g": 0.0, + "vertical_acceleration_g": 0.0, + "turn_direction": "Right" + }, + { + "maneuver_type": "Fly to Point", + "duration_s": 200.0, + "target_range_nm": 20.0, + "target_azimuth_deg": 10.0, + "target_altitude_ft": 10000.0, + "longitudinal_acceleration_g": 0.0, + "lateral_acceleration_g": 0.0, + "vertical_acceleration_g": 0.0, + "turn_direction": "Right" + }, + { + "maneuver_type": "Fly to Point", + "duration_s": 200.0, + "target_range_nm": 30.0, + "target_azimuth_deg": -10.0, + "target_altitude_ft": 10000.0, + "longitudinal_acceleration_g": 0.0, + "lateral_acceleration_g": 0.0, + "vertical_acceleration_g": 0.0, + "turn_direction": "Right" + }, + { + "maneuver_type": "Fly to Point", + "duration_s": 200.0, + "target_range_nm": 35.0, + "target_azimuth_deg": 10.0, + "target_altitude_ft": 10000.0, + "longitudinal_acceleration_g": 0.0, + "lateral_acceleration_g": 0.0, + "vertical_acceleration_g": 0.0, + "turn_direction": "Right" + }, + { + "maneuver_type": "Fly to Point", + "duration_s": 200.0, + "target_range_nm": 35.0, + "target_azimuth_deg": 30.0, + "target_altitude_ft": 10000.0, + "longitudinal_acceleration_g": 0.0, + "lateral_acceleration_g": 0.0, + "vertical_acceleration_g": 0.0, + "turn_direction": "Right" + }, + { + "maneuver_type": "Fly to Point", + "duration_s": 200.0, + "target_range_nm": 20.0, + "target_azimuth_deg": 45.0, + "target_altitude_ft": 10000.0, + "longitudinal_acceleration_g": 0.0, + "lateral_acceleration_g": 0.0, + "vertical_acceleration_g": 0.0, + "turn_direction": "Right" + } + ], + "use_spline": true + }, + { + "target_id": 1, + "active": true, + "traceable": true, + "trajectory": [ + { + "maneuver_type": "Fly to Point", + "duration_s": 10.0, + "target_range_nm": 10.0, + "target_azimuth_deg": 10.0, + "target_altitude_ft": 10000.0, + "longitudinal_acceleration_g": 0.0, + "lateral_acceleration_g": 0.0, + "vertical_acceleration_g": 0.0, + "turn_direction": "Right" + }, + { + "maneuver_type": "Fly to Point", + "duration_s": 10.0, + "target_range_nm": 20.0, + "target_azimuth_deg": 20.0, + "target_altitude_ft": 10000.0, + "longitudinal_acceleration_g": 0.0, + "lateral_acceleration_g": 0.0, + "vertical_acceleration_g": 0.0, + "turn_direction": "Right" + }, + { + "maneuver_type": "Fly to Point", + "duration_s": 30.0, + "target_range_nm": 30.0, + "target_azimuth_deg": 30.0, + "target_altitude_ft": 10000.0, + "longitudinal_acceleration_g": 0.0, + "lateral_acceleration_g": 0.0, + "vertical_acceleration_g": 0.0, + "turn_direction": "Right" + }, + { + "maneuver_type": "Fly to Point", + "duration_s": 30.0, + "target_range_nm": 35.0, + "target_azimuth_deg": -10.0, + "target_altitude_ft": 10000.0, + "longitudinal_acceleration_g": 0.0, + "lateral_acceleration_g": 0.0, + "vertical_acceleration_g": 0.0, + "turn_direction": "Right" + } + ], + "use_spline": false + } + ] + } } \ No newline at end of file diff --git a/settings.json b/settings.json index fd7a685..0769468 100644 --- a/settings.json +++ b/settings.json @@ -2,7 +2,7 @@ "general": { "scan_limit": 60, "max_range": 100, - "geometry": "1599x1024+481+287", + "geometry": "1599x1024+501+84", "last_selected_scenario": "scenario2", "connection": { "target": { diff --git a/target_simulator/gui/ppi_display.py b/target_simulator/gui/ppi_display.py index 1d07ed7..e4525a8 100644 --- a/target_simulator/gui/ppi_display.py +++ b/target_simulator/gui/ppi_display.py @@ -191,21 +191,21 @@ class PPIDisplay(ttk.Frame): (line,) = self.ax.plot([theta_rad_plot, theta_end_rad_plot], [r_nm, r_end_nm], color=color, linewidth=1.2) artist_list.append(line) # Debug log: useful to diagnose heading vs plotting coordinates - try: - logger.debug( - "PPIDisplay: TID %s az=%.6f hdg=%.6f theta0_deg=%.3f theta1_deg=%.3f x_start=%.3f y_start=%.3f x_end=%.3f y_end=%.3f", - target.target_id, - target.current_azimuth_deg, - target.current_heading_deg, - math.degrees(theta_rad_plot), - math.degrees(theta_end_rad_plot), - x_start_nm, - y_start_nm, - x_end_nm, - y_end_nm, - ) - except Exception: - pass + #try: + # logger.debug( + # "PPIDisplay: TID %s az=%.6f hdg=%.6f theta0_deg=%.3f theta1_deg=%.3f x_start=%.3f y_start=%.3f x_end=%.3f y_end=%.3f", + # target.target_id, + # target.current_azimuth_deg, + # target.current_heading_deg, + # math.degrees(theta_rad_plot), + # math.degrees(theta_end_rad_plot), + # x_start_nm, + # y_start_nm, + # x_end_nm, + # y_end_nm, + # ) + #except Exception: + # pass txt = self.ax.text(theta_rad_plot, r_nm + (vector_len_nm * 0.5), str(target.target_id), color="white", fontsize=8, ha="center", va="bottom") self.target_label_artists.append(txt)