mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-06 16:58:48 +08:00
fix simulation with new version of JSBSim
This commit is contained in:
@@ -28,6 +28,9 @@
|
||||
#include "main_fbw.h"
|
||||
#include "jsbsim_hw.h"
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
using namespace JSBSim;
|
||||
|
||||
/* Datalink Ivy function */
|
||||
@@ -46,6 +49,11 @@ static void on_DL_SETTING(IvyClientPtr app __attribute__ ((unused)),
|
||||
int argc __attribute__ ((unused)), char *argv[]){
|
||||
parse_dl_setting(argv);
|
||||
}
|
||||
static void on_DL_GET_SETTING(IvyClientPtr app __attribute__ ((unused)),
|
||||
void *user_data __attribute__ ((unused)),
|
||||
int argc __attribute__ ((unused)), char *argv[]){
|
||||
parse_dl_get_setting(argv);
|
||||
}
|
||||
static void on_DL_BLOCK(IvyClientPtr app __attribute__ ((unused)),
|
||||
void *user_data __attribute__ ((unused)),
|
||||
int argc __attribute__ ((unused)), char *argv[]){
|
||||
@@ -61,6 +69,7 @@ void autopilot_init(void) {
|
||||
IvyBindMsg(on_DL_PING, NULL, "^(\\S*) DL_PING");
|
||||
IvyBindMsg(on_DL_ACINFO, NULL, "^(\\S*) DL_ACINFO (\\S*) (\\S*) (\\S* (\\S*) (\\S*) (\\S*)) (\\S*) (\\S*)");
|
||||
IvyBindMsg(on_DL_SETTING, NULL, "^(\\S*) DL_SETTING (\\S*) (\\S*) (\\S*)");
|
||||
IvyBindMsg(on_DL_GET_SETTING, NULL, "^(\\S*) DL_GET_SETTING (\\S*) (\\S*)");
|
||||
IvyBindMsg(on_DL_BLOCK, NULL, "^(\\S*) BLOCK (\\S*) (\\S*)");
|
||||
IvyBindMsg(on_DL_MOVE_WP, NULL, "^(\\S*) MOVE_WP (\\S*) (\\S*) (\\S*) (\\S*) (\\S*)");
|
||||
|
||||
@@ -125,8 +134,8 @@ void copy_inputs_to_jsbsim(FGFDMExec* FDMExec) {
|
||||
run_model = true;
|
||||
//set_value(FDMExec, "propulsion/set-running", 1);
|
||||
// set initial speed
|
||||
FDMExec->GetIC()->SetAltitudeFtIC((GROUND_ALT+50.0) / FT2M);
|
||||
FDMExec->GetIC()->SetVgroundFpsIC(40./FT2M);
|
||||
FDMExec->GetIC()->SetAltitudeAGLFtIC(5.0 / FT2M);
|
||||
FDMExec->GetIC()->SetVgroundFpsIC(20./FT2M);
|
||||
FDMExec->RunIC();
|
||||
th = 0.;
|
||||
}
|
||||
|
||||
@@ -25,9 +25,13 @@
|
||||
#include "sim_ac_jsbsim.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <glib.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
//#include <Ivy/ivy.h>
|
||||
#include <Ivy/ivyglibloop.h>
|
||||
|
||||
@@ -210,8 +214,8 @@ void jsbsim_init(void) {
|
||||
// Use flight plan initial conditions
|
||||
IC->SetLatitudeDegIC(NAV_LAT0 / 1e7);
|
||||
IC->SetLongitudeDegIC(NAV_LON0 / 1e7);
|
||||
IC->SetAltitudeFtIC((GROUND_ALT+100) / FT2M);
|
||||
IC->SetTerrainAltitudeFtIC(GROUND_ALT / FT2M);
|
||||
IC->SetAltitudeAGLFtIC(0.0 / FT2M);
|
||||
IC->SetTerrainElevationFtIC(GROUND_ALT / FT2M);
|
||||
IC->SetPsiDegIC(QFU);
|
||||
IC->SetVgroundFpsIC(0.);
|
||||
if (!FDMExec->RunIC()) {
|
||||
|
||||
Reference in New Issue
Block a user