Skip to content
Snippets Groups Projects
Commit 60c46ac3 authored by sayanmitracode's avatar sayanmitracode
Browse files

Debugging F16 scene creation. Agent instantiation. See file...

Debugging F16 scene creation. Agent instantiation. See file demo/F16/F16_waypoint_scene.py. Resume debugging at line 85
parent c568ebff
No related branches found
No related tags found
No related merge requests found
...@@ -10,20 +10,17 @@ import numpy as np ...@@ -10,20 +10,17 @@ import numpy as np
from scipy.integrate import ode from scipy.integrate import ode
from enum import Enum, auto from enum import Enum, auto
from dryvr_plus_plus.scene_verifier.agents.base_agent import BaseAgent from demo.F16.aerobench.run_f16_sim import F16Agent
from dryvr_plus_plus.scene_verifier.map.lane_map import LaneMap from dryvr_plus_plus.scene_verifier.map.lane_map import LaneMap
from dryvr_plus_plus.scene_verifier.code_parser.pythonparser import EmptyAst from dryvr_plus_plus.scene_verifier.code_parser.pythonparser import EmptyAst
from dryvr_plus_plus.scene_verifier.scenario.scenario import Scenario
import math import math
from numpy import deg2rad from numpy import deg2rad
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from aerobench.run_f16_sim import run_f16_sim from aerobench.run_f16_sim import run_f16_sim
from aerobench.visualize import plot from aerobench.visualize import plot
from waypoint_autopilot import WaypointAutopilot from waypoint_autopilot import WaypointAutopilot
...@@ -76,13 +73,18 @@ def main(): ...@@ -76,13 +73,18 @@ def main():
''' The main function defines and simulates a scene. ''' The main function defines and simulates a scene.
Defining and using a scenario involves the following 5 easy steps: Defining and using a scenario involves the following 5 easy steps:
1. creating a basic scenario object with Scenario() 1. creating a basic scenario object with Scenario()
2. defining the agents that will populate the object, here we have two ball agents 2. defining the agents that will populate the object. Here a single F16 agent.
3. adding the agents to the scenario using .add_agent() 3. adding the agents to the scenario using .add_agent()
4. initializing the agents for this scenario. 4. initializing the agents for this scenario.
Note that agents are only initialized *in* a scenario, not individually outside a scenario Note that agents are only initialized *in* a scenario, not individually outside a scenario
5. genetating the simulation traces or computing the reachable states 5. genetating the simulation traces or computing the reachable states
''' '''
F16waypointScene = Scenario() F16waypointScene = Scenario()
F16Controller = './F16_waypoint_scene.py'
# Resume here. This next line is the problem
# Fighter1 = F16Agent('Fighter1', file_name=F16Controller)
### Initial Conditions ### ### Initial Conditions ###
power = 9 # engine power level (0-10) power = 9 # engine power level (0-10)
......
# Adaptation of F16 model # Adaptation of F16 model
This is an adaptation of the Python F16 model from [Stanley Bak](https://github.com/stanleybak/AeroBenchVVPython). This is an adaptation of the Python F16 model from [Stanley Bak](https://github.com/stanleybak/AeroBenchVVPython).
All the files are copied to make this example a standalone executable. All the files are copied to make this example a standalone executable. Requires you to add ```/Users/mitras/Dpp/GraphGeneration/demo/F16``` to PYTHONPATH.
Test by ```python3 F16_waypoint_scene.py```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment