Board index FlightGear Support Interfacing

Position aircraft without reset

Connecting two computers, using generic protocol, connecting with Matlab?

Position aircraft without reset

Postby weliwarmer » Wed Sep 12, 2018 11:01 am

Hi,

I'd like to slowly increase the altitude as if the aircraft is being lifted by a balloon. Is there a way to position the aircraft without resetting the flight?

If I use the Position Aircraft, it resets the simulation and disconnects my SITL script. I've been flying the aircraft up to the desired height which triggers the script to run but it's not really a valid test.

Any pointers in the right direction would be most welcome.

Version 2018.2.2 on Linux.

Thanks, Tim
weliwarmer
 
Posts: 6
Joined: Wed Sep 12, 2018 10:50 am
Location: UK
Version: 2018.2.2
OS: Ubuntu/Mac

Re: Position aircraft without reset

Postby ludomotico » Wed Sep 12, 2018 11:19 am

Ctrl+U instantly increases the altitude in steps of 1000ft. If you need other steps, you can configure keyboard.xml globally, or only for a specific aircraft in the .xml describing the aircraft.
User avatar
ludomotico
 
Posts: 997
Joined: Tue Apr 24, 2012 1:01 pm
Version: git
OS: Debian GNU/Linux

Re: Position aircraft without reset

Postby Thorsten » Wed Sep 12, 2018 11:54 am

Do you want to simulate the slowly being lifted part? In this case, external forces in the FDM are the tool of choice (I've been using a rather sophisticated variant of that to drag the Shuttle on top of a 747 to glide tests).

Or do you just want to get higher by teleportation - in this case writing to /position/altitude-ft gets the job done rather efficiently.
Thorsten
 
Posts: 9758
Joined: Mon Nov 02, 2009 8:33 am

Re: Position aircraft without reset

Postby weliwarmer » Wed Sep 12, 2018 2:41 pm

Thanks guys. I think the Ctrl+U will help me to test the script in the short term but I'd really like to model the lift by simulating a weather balloon attached to the aircraft. Could you point me to any documentation on where to start with external forces please? Ideally there would be two simulated craft, the UAV and the balloon.

I've started reading http://wiki.flightgear.org/JSBSim_Buoyant_forces

Maybe the development stages could be:
1. Ctrl+U
2. External buoyant force directly on the aircraft - linear 5m/s lift while under 100,000ft
3. Model a weather balloon with attachment to UAV. Balloon simulates a 7.5kg upward force and would burst at 120,000ft. The UAV triggers a separation from balloon at 100,000ft. This would allow testing of emergency scenarios such as early balloon burst.

Meanwhile I'll start with Ctrl+U :-)
weliwarmer
 
Posts: 6
Joined: Wed Sep 12, 2018 10:50 am
Location: UK
Version: 2018.2.2
OS: Ubuntu/Mac

Re: Position aircraft without reset

Postby Thorsten » Wed Sep 12, 2018 2:56 pm

The JSBSim reference manual is your friend.
Thorsten
 
Posts: 9758
Joined: Mon Nov 02, 2009 8:33 am

Re: Position aircraft without reset

Postby wkitty42 » Wed Sep 12, 2018 3:18 pm

i was going to mention the UFO's HOME and END keys implementations which raise and lower the UFO... the longer you hold them down, the faster the rising or lowering... the UFO uses its own FDM, though, so it may not be helpful...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 4641
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Position aircraft without reset

Postby wlbragg » Wed Sep 12, 2018 3:36 pm

Between the Shuttle 747 ride (most likely to be closer to your use case) and what is in the cargo hauling of the AirCrane dev repository https://github.com/wlbragg/AirCrane, you probably have all the working examples you would need to do what you want to do. Being able to read it and immediately understand how it works might be another story.
Another example (jsbsim) is the mooring code in the latest c172p and j3cub. It is an example of forces at work between two objects that could be adapted for your use case.
Last edited by wlbragg on Wed Sep 12, 2018 7:25 pm, edited 1 time in total.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4050
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Position aircraft without reset

Postby weliwarmer » Wed Sep 12, 2018 4:05 pm

Great info, thanks again.

Need to find out how interaction between simulated aircraft works, e.g. the AirCrane, so I can get the Weather Balloon model to lift the UAV... https://sourceforge.net/p/jsbsim/code/c ... r-balloon/

Looks like I've got a lot of studying to do....
weliwarmer
 
Posts: 6
Joined: Wed Sep 12, 2018 10:50 am
Location: UK
Version: 2018.2.2
OS: Ubuntu/Mac

Re: Position aircraft without reset

Postby Thorsten » Wed Sep 12, 2018 4:25 pm

It's not terribly difficult, but you'd do well to work through the JSBSim manual.
Thorsten
 
Posts: 9758
Joined: Mon Nov 02, 2009 8:33 am

Re: Position aircraft without reset

Postby weliwarmer » Wed Sep 12, 2018 9:32 pm

Knickers! Ctrl-U stops working when simulation is connected to my script (ardupilot SITL).
weliwarmer
 
Posts: 6
Joined: Wed Sep 12, 2018 10:50 am
Location: UK
Version: 2018.2.2
OS: Ubuntu/Mac

Re: Position aircraft without reset

Postby Thorsten » Thu Sep 13, 2018 4:39 am

What is your script actually doing?
Thorsten
 
Posts: 9758
Joined: Mon Nov 02, 2009 8:33 am

Re: Position aircraft without reset

Postby weliwarmer » Thu Sep 13, 2018 8:14 am

I'm connecting to FlightGear on udp:5503 using the Ardupilot SITL (http://ardupilot.org/dev/docs/setting-u ... linux.html). There is also a python script running on a virtual companion computer which watches the altitude, ready to trigger UAV release from the balloon and start the descent flight (https://github.com/EqualExperts/eesa/bl ... mission.py)

When ardupilot SITL is connected to FlightGear, the CTRL+U does not work.
weliwarmer
 
Posts: 6
Joined: Wed Sep 12, 2018 10:50 am
Location: UK
Version: 2018.2.2
OS: Ubuntu/Mac

Re: Position aircraft without reset

Postby Thorsten » Thu Sep 13, 2018 10:07 am

Well, the site you linked says

Developers can optionally install the FlightGear Flight Simulator and use it (in view-only mode) to display a 3D simulation of the vehicle and its surroundings. (emphasis by myself)

So if the actual simulation is done elsewhere and FG does just the visualization, naturally you can not influence the state of the simulated object FG-side - you have to prod your simulation software to alter altitude.
Thorsten
 
Posts: 9758
Joined: Mon Nov 02, 2009 8:33 am

Re: Position aircraft without reset

Postby weliwarmer » Thu Sep 13, 2018 7:42 pm

Yeah, boo. I was hoping that there's a simple way to increase altitude. Even setting up a Generic Protocol UDP listener and injecting /position/altitude-ft does not work, I can see the altitude jump to the required value but then it bounces right back to the home altitude.

I don't (yet) understand how the SITL script runs as an external FDM enough to modify it. Time for more reading....

Thanks again for your help.
weliwarmer
 
Posts: 6
Joined: Wed Sep 12, 2018 10:50 am
Location: UK
Version: 2018.2.2
OS: Ubuntu/Mac

Re: Position aircraft without reset

Postby Thorsten » Fri Sep 14, 2018 5:23 am

I'm not really sure on what you ultimately want to do - but as long as you use FG for visualization, the position data comes from eslewhere, so all you do inside FG is immediately overwritten when the next update from the external FDM arrives.

You also can't use JSBSim, buoyancy or external forces in that case - all of that has to be in your external FDM - FG just provides what you see at the position it is told from elswhere.
Thorsten
 
Posts: 9758
Joined: Mon Nov 02, 2009 8:33 am

Next

Return to Interfacing

Who is online

Users browsing this forum: No registered users and 0 guests