mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-27 08:55:51 +08:00
[nps] update nps_fdm_jsbsim to be compatible with latest jsbsim
not the best implementation, but should work with current paparazzi-jsbsim package (from 2012) and latest jsbsim version
This commit is contained in:
@@ -37,6 +37,7 @@
|
|||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
#include <FGJSBBase.h>
|
#include <FGJSBBase.h>
|
||||||
|
#include <initialization/FGInitialCondition.h>
|
||||||
#include <models/FGPropulsion.h>
|
#include <models/FGPropulsion.h>
|
||||||
#include <models/FGGroundReactions.h>
|
#include <models/FGGroundReactions.h>
|
||||||
#include <models/FGAccelerations.h>
|
#include <models/FGAccelerations.h>
|
||||||
@@ -230,7 +231,7 @@ static void feed_jsbsim(double* commands, int commands_nb) {
|
|||||||
for (i=0; i < commands_nb; i++) {
|
for (i=0; i < commands_nb; i++) {
|
||||||
sprintf(buf,"fcs/%s",names[i]);
|
sprintf(buf,"fcs/%s",names[i]);
|
||||||
property = string(buf);
|
property = string(buf);
|
||||||
FDMExec->GetPropertyManager()->SetDouble(property,commands[i]);
|
FDMExec->GetPropertyManager()->GetNode(property)->SetDouble("", commands[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -241,8 +242,7 @@ static void feed_jsbsim(double* commands, int commands_nb) {
|
|||||||
*/
|
*/
|
||||||
static void fetch_state(void) {
|
static void fetch_state(void) {
|
||||||
|
|
||||||
FGPropertyManager* node = FDMExec->GetPropertyManager()->GetNode("simulation/sim-time-sec");
|
fdm.time = FDMExec->GetPropertyManager()->GetNode("simulation/sim-time-sec")->getDoubleValue();
|
||||||
fdm.time = node->getDoubleValue();
|
|
||||||
|
|
||||||
#if DEBUG_NPS_JSBSIM
|
#if DEBUG_NPS_JSBSIM
|
||||||
printf("%f,",fdm.time);
|
printf("%f,",fdm.time);
|
||||||
@@ -395,7 +395,7 @@ static void init_jsbsim(double dt) {
|
|||||||
// LLA initial coordinates (geodetic lat, geoid alt)
|
// LLA initial coordinates (geodetic lat, geoid alt)
|
||||||
struct LlaCoor_d lla0;
|
struct LlaCoor_d lla0;
|
||||||
|
|
||||||
JSBSim::FGInitialCondition *IC = FDMExec->GetIC();
|
FGInitialCondition *IC = FDMExec->GetIC();
|
||||||
if(!jsbsim_ic_name.empty()) {
|
if(!jsbsim_ic_name.empty()) {
|
||||||
if ( ! IC->Load(jsbsim_ic_name)) {
|
if ( ! IC->Load(jsbsim_ic_name)) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|||||||
Reference in New Issue
Block a user