[Top][All Lists]

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

Re: [Paparazzi-devel] Paparazzi JSBSim configuration

From: Felix Ruess
Subject: Re: [Paparazzi-devel] Paparazzi JSBSim configuration
Date: Wed, 21 May 2014 17:35:55 +0200

Hi Shaun,

currently NPS is only set up as as SITL (SoftwareInTheLoop) simulation and not HITL (HardwareInTheLoop).
It is meant feed only the "raw" sensor data and run the actual state estimation algorithms just like on the real autopilot (although you can overwrite it with the simulator ground truth).

Challenges when implementing a real HITL:
- sensor data (with fast IMU) is quite a lot data which can't be handled by e.g. an xbee datalink
- requires proper time synchronization between the fdm and the autopilot
  (e.g. you can slow down or speed up NPS and in the jsbsim fdm the timestep is adapted/lowered if you are closer to the ground to get better results)

The execution of the FDM, generation of the raw sensor data and FlightGear visualization is not directly tied to the paparazzi autopilot code.
See nps_main_run_sim_step(). The calling of the "actual" autopilot code is done in nps_autopilot_run_step(), which can be implementation specific, e.g. for rotorcraft firmware running as SITL in the same process, similar thing for fixedwing.
So you could write your own nps_autopilot_external.c implementing this interface and it could send the data to the autopilot and retrieve the commands instead of running the code locally.
Or you could run the estimation and control locally and only send the final actuator commans to the real autopilot board in order to e.g. see the control surfaces moving.

If you only want to feed the "true" attitude, velocity, position from the FDM to the autopilot, then you don't really need simulation of the actual sensors with noise, bias, delay, etc...

How you implement it in the end very much depends on what you actually want to achieve...
- at what "level" do you want to simulate it?
- which parts do you want to run on the real hw and which ones in sw?
- does everything need to run in (synchronized) realtime?

I'm also quite interested to hear what autopilot your are using, what RTOS...?

Cheers, Felix

On Wed, May 21, 2014 at 5:01 PM, Shaun C <address@hidden> wrote:
Hi Felix,

Thank your for your recent help with jsbsim. I have a question regarding the nps simulation. Is the nps simulation tightly integrated into the autopilot code?

We have been setting up a system with an isolated autopilot for a fixed wing aircraft and have it communicate with a simulator on a PC. The autopilot is running on an rtos on a separate board. We are currently sending the 6 degree pose info and the gps from the simulator to the board. Do you think this setup would be possible with the nps based simulator or is there more going on with the data after it comes from the FDM? I have looked at the nps code and it looks coupled with the autopilot, especially regarding the simulated sensors so I am wary of just taking the jsbsim FDM data and omitting the nps autopilot calls.


On Mon, May 19, 2014 at 4:29 PM, Felix Ruess <address@hidden> wrote:
Hi Shaun,

the simulator of the "jsbsim" target is basically a subset of NPS where you usually also use JSBSim as the actual flight dynamic model with fdm type="jsbsim" (you can however use other like crrcsim or your own fdm). So in that respect there should be no difference for you in terms of creating appropriate JSBSim models.

NPS additionally also simulates all the sensors (including noise, etc.) and run the actual AHRS, INS code that you use on the real thing as well.
However you can overwrite these with the "true" values from the simulator with NPS_BYPASS_AHRS|INS (as done in microject_lisa_m).

There is only only one thing that I know doesn't work as correctly in the jsbsim target as in nps: depending on your initial condiitons the waypoint locations are sometimes not correct, can't remember in which case anymore (that is because JSBSim uses a geocentric instead of geodetic world model internally). That however works in NPS.

So I would recommend to use NPS, it is more complete, powerful and flexible and has currently less known bugs than the jsbsim target.

If you have more questions about how to "switch" what you currently have for "jsbsim" to NPS, don't hesitate to ask.

Cheers, Felix

On Mon, May 19, 2014 at 9:39 PM, Shaun C <address@hidden> wrote:
Hi Felix,

Thank you very much for making those modifications to the code.

I have tested it out and with the Microjet_LisaM profile, the microjet_lisa_m.xml works nicely under the NPS simulator. However, when compiled for JSBSim with the same settings, it cannot appear to turn, only go in a huge arc.
Also, I have tried out the Microjet profile with JSBSim and it too files however, once it takes off and gains altitude, it only appears to turn right.

As the JSBSim target is going to be removed in future versions, is there some functionality in the IMU sensors that is tied into NPS but not JSBSim? Or something else that is not currently implemented for full JSBSim simulation hence causing the strange results?

The reason I ask is that the project we are working on is currently committed to using JSBSim and switching to NPS right now is not feasible. Worst case scenario, we can use an older version of paparazzi but that is not ideal.

Once again, thank you for getting the JSBSim functioning again.

On Mon, May 19, 2014 at 1:01 PM, Felix Ruess <address@hidden> wrote:
Hi Shaun,

should be fixed in master, at least it basically works.

Also note that you should be able to use NPS (with JSBSim) for fixedwing simulation now and that we will remove the jsbsim target in the future.
See microjet_lisa_m.xml as a basic example (which roughly works using basic.xml flightplan, considering that the Malolo model is actually quite a bit bigger, faster).

If you add the nps.xml settings file you can also change the wind, turbulence, etc...

Cheers, Felix

On Thu, May 15, 2014 at 8:55 PM, Shaun C <address@hidden> wrote:

As part of a college project we have been doing some work with paparazzi and hitl based simulations. We wish to use jsbsim for the simulator.

I am using the latest version of paparazzi with the latest version of paparazzi-jsbsim running on ubuntu 12.04 and also 14.04 (multiple dev machines).

Right now I am trying to get the standard micro jet configuration profile to run in sitl with the jsbsim simulation and I am having some difficulties with what appear to be the paparazzi flight configuration parameters. After this is working I can move into the hitl portion of our project.

This is a list of what I have tried so far to get a working flight. To keep this email short I will omit the details:
The first issue is that the flight crashes very soon after take-off. I added a catapult configuration and changed launch speeds etc.. It all resulted in the plane crashing again at various locations (within meters of the launch point).
Recreating the configuration file based on jsbsim.xml 
Using a different plane model other than the Malolo1 
Adding jsbsim target to several of the other configurations like twinjet etc...
Changing many different configuration parameters in the micro jet XML file
Tuning the pid for the pitch (interestingly enough, the best results that I got for jsbsim would not work for the OCaml simulator and vice versa)
I also took a configuration file for the micro jet from the paparazzi git version from July 2011. Some of the pid parameters in that micro jet file are inverted compared to the parameters in the latest version. The older version works slightly better in that it does not crash but it also never seems to take-off either, just travel along the ground.

All of the above were tried and I have not been able to get the plane to fly.

The reason for this may be due to my n00bness with paparazzi and the jsbsim FDM. I am willing to bet that there are things I am not doing correctly but I cannot seem to gain any traction. All of the trial and error now leads me to a question regarding the jsbsim implementation.

Does the current version of paparazzi actually work with the current version of paparazzi jsbsim (July 2012  version)? 

If it does, is there a known working configuration that is available that I can use as a reference?
Otherwise is there some resource I can draw from to get a jsbsim based simulation up and running?

Thanks in advance.

Paparazzi-devel mailing list

Paparazzi-devel mailing list

Paparazzi-devel mailing list

Paparazzi-devel mailing list

Paparazzi-devel mailing list

reply via email to

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