paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] JSBSim for fixedwing example


From: Andreas Gäb
Subject: Re: [Paparazzi-devel] JSBSim for fixedwing example
Date: Tue, 08 Feb 2011 09:17:23 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7

Hi Stephen,

Am 07.02.2011 19:57, schrieb Stephen Dwyer:
> [...] I only added jsbsim.CFLAGS += -g to the makefile (not
> sure what this does).
it tells the compiler to add debug symbols in the executable. This
should not make any difference unless you actually run the simulator in
a debugger.

> [...]
> (These both compile with the exception that for microjet_example.xml I
> needed to comment out the second last line ppm_arch_init(); of
> /paparazzi/sw/airborne/subsystems/radio_control/ppm.c . Still looking
> to see what causes this.)
 in conf/autopilot/subsystems/shared/radio_control_ppm.makefile,
ppm_arch.c is only added for non-jsbsim targets. I don't know why this
is, at least for me it works to comment out the ifneq ($(ARCH),jsbsim)
and endif lines.

> [...]
> JSBSim startup beginning ...
> 
> Simulation delta 0.017
> Broadcasting on network 127.255.255.255, port 2010
so at least JSBSim starts up correctly.

> but once I pressed Takeoff then Launch, the Paparazzi Center output gives 
> this:
>       Invalid_argument("Latlong.of_utm")
> repeatedly. This looks to be an error from the GCS. Also, the display
> on the GCS shows outrageous and fluctuating values for AGL and
> velocity, and the aircraft does not move in the map.
this looks as if you're running into some NaN issues that were only
fixed in the recent CVS versions of JSBSim. You could verify this by
replacing check_crash_jsbsim() in sim_ac_jsbsim.c with this version:

bool check_crash_jsbsim(JSBSim::FGFDMExec* FDMExec) {
  double
    agl = FDMExec->GetPropagate()->GetDistanceAGL(), // in ft
    lat = FDMExec->GetPropagate()->GetLatitude(), // in rad
    lon = FDMExec->GetPropagate()->GetLongitude(); // in rad

  if (agl< 0) {
    cerr << "Crash detected: agl < 0" << endl << endl;
    return false;
  }
  if (agl > 1e5 || abs(lat) > M_PI_2 || abs(lon) > M_PI) {
    cerr << "Simulation divergence: Lat=" << lat
         << " rad, lon=" << lon << " rad, agl=" << agl << " ft" << endl
<< endl;
    return false;
  }

  if (isnan(agl) || isnan(lat) || isnan(lon)) {
    cerr << "JSBSim is producing NaNs. Exiting." << endl << endl;
    return false;
  }
  return true;
}

If you indeed have the NaN problem, I'd recommend to check with the
devel version of JSBSim. As Sourceforge's CVS is down at the moment,
you'll have to use the git repo from http://www.gitorious.org/jsbsim

> Interestingly,
> the Battery status indicator reads "12." instead of "12.5".
the JSBSim simulator doesn't do battery modeling. The 12 is hardcoded in
sim_ac_fw.c.

Best regards,
        Andreas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]