Prepairing for C++ integration.
int result;
if ( model == FG_LARCSIM ) {
- fgFlight_2_LaRCsim(f); /* translate FG to LaRCsim structure */
- fgLaRCsimUpdate(multiloop);
- fgLaRCsim_2_Flight(f); /* translate LaRCsim back to FG structure */
+ fgLaRCsimUpdate(f, multiloop);
} else {
fgPrintf(FG_FLIGHT,FG_WARN,"Unimplemented flight model == %d\n", model);
}
/* $Log$
-/* Revision 1.11 1998/04/18 04:14:04 curt
-/* Moved fg_debug.c to it's own library.
+/* Revision 1.12 1998/04/21 16:59:33 curt
+/* Integrated autopilot.
+/* Prepairing for C++ integration.
/*
+ * Revision 1.11 1998/04/18 04:14:04 curt
+ * Moved fg_debug.c to it's own library.
+ *
* Revision 1.10 1998/02/07 15:29:37 curt
* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
* <chotchkiss@namg.us.anritsu.com>
#define _FLIGHT_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#include <Flight/Slew/slew.h>
/* #include <Flight/LaRCsim/ls_interface.h> */
int fgFlightModelUpdate(int model, fgFLIGHT *f, int multiloop);
+#ifdef __cplusplus
+}
+#endif
+
+
#endif /* _FLIGHT_H */
/* $Log$
-/* Revision 1.14 1998/02/07 15:29:37 curt
-/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
-/* <chotchkiss@namg.us.anritsu.com>
+/* Revision 1.15 1998/04/21 16:59:33 curt
+/* Integrated autopilot.
+/* Prepairing for C++ integration.
/*
+ * Revision 1.14 1998/02/07 15:29:37 curt
+ * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
* Revision 1.13 1998/01/24 00:04:59 curt
* misc. tweaks.
*
navion_init.c navion_init.h \
ls_interface.c ls_interface.h
-INCLUDES += -I$(top_builddir) -I$(top_builddir)/Simulator
+INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib -I$(top_builddir)/Simulator
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
-INCLUDES += -I$(top_builddir) -I$(top_builddir)/Simulator
+INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib -I$(top_builddir)/Simulator
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
#include "ls_init.h"
#include <Flight/flight.h>
#include <Aircraft/aircraft.h>
+#include <Autopilot/autopilot.h>
+#include <Debug/fg_debug.h>
+
/* global variable declarations */
/* Run an iteration of the EOM (equations of motion) */
-int fgLaRCsimUpdate(int multiloop) {
+int fgLaRCsimUpdate(fgFLIGHT *f, int multiloop) {
int i;
if (speedup > 0) {
ls_cockpit();
}
+ // translate FG to LaRCsim structure
+ fgFlight_2_LaRCsim(f);
+
for ( i = 0; i < multiloop; i++ ) {
+ //Insertion by Jeff Goeke-Smith for Autopilot.
+
+ // run Autopilot system
+ fgPrintf( FG_ALL, FG_BULK,"Attempting autopilot run\n");
+
+ fgAPRun();
+
+ // end of insertion
+
ls_loop( model_dt, 0);
+
+ // translate LaRCsim back to FG structure so that the
+ // autopilot (and the rest of the sim can use the updated
+ // values
+ fgLaRCsim_2_Flight(f);
}
return(1);
/* Flight Gear Modification Log
*
* $Log$
+ * Revision 1.18 1998/04/21 16:59:38 curt
+ * Integrated autopilot.
+ * Prepairing for C++ integration.
+ *
* Revision 1.17 1998/02/23 19:07:58 curt
* Incorporated Durk's Astro/ tweaks. Includes unifying the sun position
* calculation code between sun display, and other FG sections that use this
int fgLaRCsimInit(double dt);
/* update position based on inputs, positions, velocities, etc. */
-int fgLaRCsimUpdate(int multiloop);
+int fgLaRCsimUpdate(fgFLIGHT *f, int multiloop);
/* Convert from the fgFLIGHT struct to the LaRCsim generic_ struct */
int fgFlight_2_LaRCsim (fgFLIGHT *f);
/* $Log$
-/* Revision 1.7 1998/02/07 15:29:39 curt
-/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
-/* <chotchkiss@namg.us.anritsu.com>
+/* Revision 1.8 1998/04/21 16:59:39 curt
+/* Integrated autopilot.
+/* Prepairing for C++ integration.
/*
+ * Revision 1.7 1998/02/07 15:29:39 curt
+ * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
* Revision 1.6 1998/02/03 23:20:17 curt
* Lots of little tweaks to fix various consistency problems discovered by
* Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper