Board index FlightGear Development

Existing Example(s) of a working State-Machine?  Topic is solved

FlightGear is opensource, so you can be the developer. In the need for help on anything? We are here to help you.
Forum rules
Core development is discussed on the official FlightGear-Devel development mailing list.

Bugs can be reported in the bug tracker.

Existing Example(s) of a working State-Machine?

Postby skipper0802 » Tue Feb 26, 2019 5:04 pm

Greetings All,
I'm interested in the capabilities that a state-machine can offer my AP code and have examined the (one) example posted within our forum. Does anyone know off-hand which aircraft has a (working) example to study?

Appreciate your mention. Thanks for your help,
Eric
V/r,
Eric
*******************************************************************
Intel Core i7-3520M CPU @ 2.9GHz, 16 GB RAM, 64-bit OS, x64-based processor
HP EliteBook 8770W
AMD FirePro M4000 1GB
Windows 10 Home
Flightgear 2018.2.2
skipper0802
 
Posts: 24
Joined: Tue Apr 24, 2018 3:12 pm
Location: Seattle, Washington, USA
Callsign: 0802SK, skipper0802
Version: 2018.2.2
OS: Windows10 Home

Re: Existing Example(s) of a working State-Machine?  

Postby PINTO » Tue Feb 26, 2019 5:10 pm

Actively developing the MiG-21bis (link to repo) (link to thread)

http://opredflag.com is an active flightgear dogfighting community (using a system that isn’t bombable)
User avatar
PINTO
 
Posts: 937
Joined: Wed Oct 21, 2015 6:28 pm
Callsign: pinto
Version: 2016.3.0
OS: Win10

Re: Existing Example(s) of a working State-Machine?

Postby skipper0802 » Tue Feb 26, 2019 5:20 pm

Thanks Pinto! I'm checking it out :-)
V/r,
Eric
*******************************************************************
Intel Core i7-3520M CPU @ 2.9GHz, 16 GB RAM, 64-bit OS, x64-based processor
HP EliteBook 8770W
AMD FirePro M4000 1GB
Windows 10 Home
Flightgear 2018.2.2
skipper0802
 
Posts: 24
Joined: Tue Apr 24, 2018 3:12 pm
Location: Seattle, Washington, USA
Callsign: 0802SK, skipper0802
Version: 2018.2.2
OS: Windows10 Home

Re: Existing Example(s) of a working State-Machine?

Postby stuart » Tue Feb 26, 2019 6:58 pm

I've just finished writing a fairly complex state machine for the Garmin GFC700 autopilot, that's part of the FG1000.

The top level autopilot file is here: https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Aircraft/Instruments-3d/FG1000/GFC700.xml

I split out the laternal and vertical autopilot components into separate FSMs:

https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Aircraft/Instruments-3d/FG1000/GFC700-lateral-FSM.xml
https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Aircraft/Instruments-3d/FG1000/GFC700-vertical-FSM.xml

I've found it very powerful and useful. Drawing a block diagram to gather my thoughts helped a lot as well.

-Stuart
G-MWLX
User avatar
stuart
Moderator
 
Posts: 1469
Joined: Wed Nov 29, 2006 9:56 am
Location: Edinburgh
Callsign: G-MWLX

Re: Existing Example(s) of a working State-Machine?

Postby skipper0802 » Wed Feb 27, 2019 5:38 am

Thanks Stuart!
Likewise, I've found examples of state/event tables, UML state charts, state transition tables, SDL tables, and what I used to call "pseudo-code" to help me understand the scope, structure, and features. Very helpful! I'll check-out your references soonest :-)
Cheers,
Eric
V/r,
Eric
*******************************************************************
Intel Core i7-3520M CPU @ 2.9GHz, 16 GB RAM, 64-bit OS, x64-based processor
HP EliteBook 8770W
AMD FirePro M4000 1GB
Windows 10 Home
Flightgear 2018.2.2
skipper0802
 
Posts: 24
Joined: Tue Apr 24, 2018 3:12 pm
Location: Seattle, Washington, USA
Callsign: 0802SK, skipper0802
Version: 2018.2.2
OS: Windows10 Home

Re: Existing Example(s) of a working State-Machine?

Postby stuart » Wed Feb 27, 2019 7:54 am

Also, I made some improvements to the error checking code for state machines recently. Previously things like incorrectly named transitions or states would crash FG when they were hit. Now you get a useful error message.

So it’s worth running the latest development build if you can.
G-MWLX
User avatar
stuart
Moderator
 
Posts: 1469
Joined: Wed Nov 29, 2006 9:56 am
Location: Edinburgh
Callsign: G-MWLX


Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest