trick/trick_sims/SIM_aircraft/RUN_test/input.py
Mrockwell2 28d5ecfa84
SIM_aircraft Waypoint Update (#1453)
* Set up a waypoint system that reads waypoints from an input file.

On branch aircraftUpdate
Changes to be committed:
    new file:   trick_sims/SIM_aircraft/Modified_data/default.waypoints
	modified:   trick_sims/SIM_aircraft/RUN_test/input.py
	modified:   trick_sims/SIM_aircraft/models/Aircraft/include/Aircraft.hh
	modified:   trick_sims/SIM_aircraft/models/Aircraft/src/Aircraft.cpp
	modified:   trick_sims/SIM_aircraft/models/graphics/src/trick/AircraftDisplay.java

* Fixed the Segmentation Fault and completed the waypoint configuration.

On branch aircraftUpdate
Changes to be committed:
	modified:   trick_sims/SIM_aircraft/RUN_test/input.py
	modified:   trick_sims/SIM_aircraft/models/Aircraft/include/Aircraft.hh
	modified:   trick_sims/SIM_aircraft/models/Aircraft/src/Aircraft.cpp

* Created README.md to document recent changes

* Adding in ability to set icons for waypoints.
  On branch aircraftUpdate_WaypointIcons
  Changes to be committed:
	modified:   trick_sims/SIM_aircraft/Modified_data/default.waypoints
	new file:   trick_sims/SIM_aircraft/images/CompassRose.png
	new file:   trick_sims/SIM_aircraft/images/Figure1.png
	new file:   trick_sims/SIM_aircraft/images/Figure2.png
	new file:   trick_sims/SIM_aircraft/images/cheese_64x64.png
	new file:   trick_sims/SIM_aircraft/images/mouse_128x128.png
	new file:   trick_sims/SIM_aircraft/images/strawberry_64x64.png
	new file:   trick_sims/SIM_aircraft/images/twoWheelRover.png
	new file:   trick_sims/SIM_aircraft/images/wp0.png
	new file:   trick_sims/SIM_aircraft/images/wp1.png
	new file:   trick_sims/SIM_aircraft/images/wp10.png
	new file:   trick_sims/SIM_aircraft/images/wp11.png
	new file:   trick_sims/SIM_aircraft/images/wp2.png
	new file:   trick_sims/SIM_aircraft/images/wp3.png
	new file:   trick_sims/SIM_aircraft/images/wp4.png
	new file:   trick_sims/SIM_aircraft/images/wp5.png
	new file:   trick_sims/SIM_aircraft/images/wp6.png
	new file:   trick_sims/SIM_aircraft/images/wp7.png
	new file:   trick_sims/SIM_aircraft/images/wp8.png
	new file:   trick_sims/SIM_aircraft/images/wp9.png
	modified:   trick_sims/SIM_aircraft/models/graphics/src/trick/AircraftDisplay.java

* Reformatted the README file

* Updating the build process to use Maven

* Updating the README file

* Finalized the implementation for adding icons for each waypoint.

* Removed commented code that will not be used.

* Updated the SIM_aircraft documentation to include the waypoint icon implementation.

* Minor README fix and file cleanup
2023-02-13 16:45:15 -06:00

40 lines
1.4 KiB
Python

exec(open("Modified_data/realtime.py").read())
dyn_integloop.getIntegrator(trick.Runge_Kutta_4, 6)
dyn_integloop.set_integ_cycle(0.01)
dyn.aircraft.set_desired_compass_heading(45.0);
dyn.aircraft.autoPilot = True;
dyn.aircraft.desired_speed = 200 # meters per second
#==========================================
# Read the waypoints from the input file
#==========================================
waypoints_path = "Modified_data/default.waypoints"
fp = open(waypoints_path, "r")
for line in fp:
fields = line.split(",")
dyn.aircraft.add_waypoint( float(fields[0]), float(fields[1]))
dyn.aircraft.reset_trip()
#==========================================
# Start the Satellite Graphics Client
#==========================================
varServerPort = trick.var_server_get_port();
AircraftDisplay_path = "models/graphics/build/AircraftDisplay.jar"
if (os.path.isfile(AircraftDisplay_path)) :
AircraftDisplay_cmd = "java -jar " \
+ AircraftDisplay_path \
+ " -w " + waypoints_path \
+ " " + str(varServerPort) + " &" ;
print(AircraftDisplay_cmd)
os.system( AircraftDisplay_cmd);
else :
print('==================================================================================')
print('AircraftDisplay needs to be built. Please \"cd\" into ../models/graphics and type \"make\".')
print('==================================================================================')
trick.stop(5400);