1
0
Fork 0

Integrated autopilot.

Prepairing for C++ integration.
This commit is contained in:
curt 1998-04-21 16:59:33 +00:00
parent 7d39aa3777
commit e2ddc6f2b8
6 changed files with 59 additions and 15 deletions

View file

@ -59,9 +59,7 @@ int fgFlightModelUpdate(int model, fgFLIGHT *f, int multiloop) {
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);
}
@ -73,9 +71,13 @@ int fgFlightModelUpdate(int model, fgFLIGHT *f, int multiloop) {
/* $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>

View file

@ -28,6 +28,11 @@
#define _FLIGHT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <Flight/Slew/slew.h>
/* #include <Flight/LaRCsim/ls_interface.h> */
@ -397,14 +402,23 @@ int fgFlightModelInit(int model, fgFLIGHT *f, double dt);
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.
*

View file

@ -20,4 +20,4 @@ libLaRCsim_la_SOURCES = \
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

View file

@ -335,7 +335,7 @@ installdirs mostlyclean-generic distclean-generic clean-generic \
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.

View file

@ -242,6 +242,9 @@ $Original log: LaRCsim.c,v $
#include "ls_init.h"
#include <Flight/flight.h>
#include <Aircraft/aircraft.h>
#include <Autopilot/autopilot.h>
#include <Debug/fg_debug.h>
/* global variable declarations */
@ -545,15 +548,32 @@ int fgLaRCsimInit(double dt) {
/* 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);
@ -914,6 +934,10 @@ int fgLaRCsim_2_Flight (fgFLIGHT *f) {
/* 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

View file

@ -36,7 +36,7 @@
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);
@ -51,10 +51,14 @@ void ls_loop( SCALAR dt, int initialize );
/* $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