Board index FlightGear Development

FGCopilot

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.

FGCopilot

Postby SP-WKA » Mon Nov 28, 2011 10:53 pm

FGCopilot makes interaction with the plane for the copilot possible in probably any aircraft. Copilot can:
-retract and extend flaps
-arm/retract spoilers
-retract/extend gear
-put throttle on IDLE
-toggle parking brakes
-toggle reversers
-toggle landing lights

http://www.mediafire.com/?akgjafh1bvwchjj

Readme included. Source code too :) Compiled with Delphi (7) with INDY.
SP-WKA
 
Posts: 48
Joined: Sun Sep 04, 2011 7:56 pm

Re: FGCopilot

Postby dr1 » Fri Dec 02, 2011 2:30 am

Just want to bump you, because this sounds like a really good idea.
dr1
 
Posts: 9
Joined: Tue Aug 02, 2011 1:08 pm

Re: FGCopilot

Postby SP-WKA » Fri Dec 02, 2011 6:19 am

thank you :) some response finally.
this is indeed a good idea, have you tried this out?
SP-WKA
 
Posts: 48
Joined: Sun Sep 04, 2011 7:56 pm

Re: FGCopilot

Postby Gijs » Fri Dec 02, 2011 8:02 am

Will try it this weekend. So, does this copilot think by itself, or does it follow/perform the pilot's commands?
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9544
Joined: Tue Jul 03, 2007 3:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: FGCopilot

Postby dr1 » Fri Dec 02, 2011 7:49 pm

I like the idea but I think there needs to be some other way of merging the idea into FlightGear itself. Im on linux so I dont believe I can run the code you've supplied. I think if you hacked this into FG itself, perhaps as a property 'editor' instead of just a property browser, that would be a better way to go. I would imagine with some work this could be added as another protocol to link 2 players together.
dr1
 
Posts: 9
Joined: Tue Aug 02, 2011 1:08 pm

Re: FGCopilot

Postby SP-WKA » Sat Dec 03, 2011 4:37 pm

Gijs wrote in Fri Dec 02, 2011 8:02 am:Will try it this weekend. So, does this copilot think by itself, or does it follow/perform the pilot's commands?


it's not like this. read the included text file :-)
SP-WKA
 
Posts: 48
Joined: Sun Sep 04, 2011 7:56 pm

Re: FGCopilot

Postby Hooray » Sat Dec 03, 2011 9:57 pm

SP-WKA wrote in Sat Dec 03, 2011 4:37 pm:
Gijs wrote in Fri Dec 02, 2011 8:02 am:Will try it this weekend. So, does this copilot think by itself, or does it follow/perform the pilot's commands?

it's not like this. read the included text file :-)


But that would certainly be possible, we actually talked about implementing this as a Nasal module a while ago: viewtopic.php?f=6&t=9556&p=96037&hilit=copilot+nasal#p96031
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: FGCopilot

Postby Hooray » Thu Dec 08, 2011 9:07 am

At the moment, there are about 3 different approaches to implement a "copilot" module for FlightGear - all of them being developed separately, as standalone programs talking to FG using socket connections.

While that is good from a design point of view, I think it is somewhat unfortunate because the people who work separately creating 3 different copilot solutions, could certainly work together and create a single one.

The real issue is that FG being cross platform software, it is generally understood to be a good idea that contributions to FG can also be used by all FG users, regardless of their platform/OS.

I haven't taken a look at FGCopilot yet, but that is also because I am on Linux and I assume that I cannot easily run your code?

redneck's project is more promising in this aspect because it is built using Java, which is multi-platform in general.

Also, redneck's project is reusing code that has been developed by FG core developers - so it is more efficient from a certain angle.

So, personally I would suggest to look into working together with redneck to improve his project - there are obviously many things that could be implemented here. And redneck got a head start already. If you already know Delphi, understanding and writing Java should be straightforward actually. So if you have any ideas or feature requests, I am sure that redneck's project would be a solid foundation actually.

Honestly, I don't think we even need to keep this separate from FG - anybody doing projects like these will inevitably need to deal with the FG property tree, which is usually done using a socket connection. This is more complicated than it needs to be. If you already know a programming language, learning Nasal is actually EASY - and Nasal has native support for dealing with the FG property tree and its API.

Bottom line being, 99% of the work you are doing could be done more easily by switching to Nasal instead. This would also have the added advantage of Nasal code being automatically cross-platform, too. Once people switch to using Nasal, they also ensure that ALL FG users can easily make use of their contributions.

Obviously, there are some things that are easy in a separate language/toolkit, which are more complicated or next to impossible from Nasal space, but usually that would only require modifying or adding 2-3 new Nasal extension functions, which would also be useful for all other Nasal scripts.

Seriously, even redneck mentioned a while ago that Nasal should be seriously considered here, especially because the telnet/props route has been shown to become too slow pretty soon:

viewtopic.php?f=6&t=13435&p=136211&hilit=#p136205
redneck wrote:It might be a little... slow :( Nasal seems to have all the same functions from my brief glance over some code, so, I suppose I could learn. I've also wanted to have some way to automate holding patterns as well.


Bottom line being, I am absolutely convinced that these autopilot/copilot tools are a great idea for FG, but I also believe anybody not coding this directly IN FlightGear by using Nasal, is making it more complicated than necessary. So, I will try to support anybody who is actually looking into porting this over to "native FlightGear space" by reimplemting such efforts in Nasal space instead - adding a bunch of extension functions to enrich the API is easy and well documented actually. Anybody knowing C++ (or Java for that matter), should be able to understand what's involved: http://wiki.flightgear.org/Howto:Extending_Nasal


Finally, it is usually a good idea to add announcements to the FlightGear newsletter (created and maintained using the wiki)- you can even create a new wiki article introducing your project, and linking to it from the newsletter. Let us know if you need any help contributing to the newsletter: http://wiki.flightgear.org/Next_newsletter
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: FGCopilot

Postby pygmyskunk » Sun Jan 08, 2012 1:46 am

Hooray wrote in Thu Dec 08, 2011 9:07 am:
Bottom line being, 99% of the work you are doing could be done more easily by switching to Nasal instead. This would also have the added advantage of Nasal code being automatically cross-platform, too. Once people switch to using Nasal, they also ensure that ALL FG users can easily make use of their contributions.
...
Bottom line being, I am absolutely convinced that these autopilot/copilot tools are a great idea for FG, but I also believe anybody not coding this directly IN FlightGear by using Nasal, is making it more complicated than necessary. So, I will try to support anybody who is actually looking into porting this over to "native FlightGear space" by reimplemting such efforts in Nasal space instead - adding a bunch of extension functions to enrich the API is easy and well documented actually. Anybody knowing C++ (or Java for that matter), should be able to understand what's involved: http://wiki.flightgear.org/Howto:Extending_Nasal
....
Finally, it is usually a good idea to add announcements to the FlightGear newsletter (created and maintained using the wiki)- you can even create a new wiki article introducing your project, and linking to it from the newsletter. Let us know if you need any help contributing to the newsletter: http://wiki.flightgear.org/Next_newsletter


Hooray is onto something here really. I have noticed on several aircraft some autopilot Nasal scripts that are supposed to takeoff and land on their own, however no matter what I try these scripts fail to run, these are found on the A-10, SU-37, YF-23, B-2 and a couple others I believe. So the code is there, we just need to get it to run.

This really dives into the realm of UAV work, something I have been working on for about a year myself with the X-47B. I think maybe we should make a new wiki page devoted to UAV's and the like since there are many of us that like these kind of aircraft and systems. Thoughts?
pygmyskunk
 
Posts: 25
Joined: Tue Feb 15, 2011 4:47 pm

Re: FGCopilot

Postby Hooray » Sun Jan 08, 2012 2:56 am

One of the problems is going to be that such a feature is pretty aircraft specific. That's probably part of the reason why people keep coming up with their own implementations. To get something like this started, you'd first of all need to start VERY simple, i.e. by making this work with the simplest aircraft you can find (such as the ufo) and then incrementally start making it more configurable, so that support for more complex aircraft can be added. This could be accomplished by using aircraft specific setup files that could be declared in XML space and loaded by Nasal scripts.

So that aircraft developers could specialize the default setup, specifically for a certain aircraft.

The wiki article you mentioned would probably be a good thing to collect all ideas, the step would probably be collecting all existing steps and seeing if/how they could be generalized and integrated to form a single script.

There's actually quite some interest in UAV stuff recently. And in fact, Curt recently provided a fully working uav demo by scripting the f14b to do carrier ops too. Unfortunately, the source code was obfuscated - so it would be of little use here, but it goes to show that it's definitely possible to come up with something like this.

It's probably just a matter of getting people to collaborate, rather than starting scripts from scratch ;-)
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: FGCopilot

Postby AbstractViolinist » Thu Aug 18, 2022 4:16 am

This file is no longer on MediaFire. Is it the same as <https://www.mediafire.com/?quubj6a9h1davlr>? The README file is very confusing, and I don't know how to get it to work.

The README file says:
"Simply extract to a convenient location, add the command --telnet=9321 (or another port number of your choice) to FG, start FG, then double-click. Just make sure that when the dialog box pops up, the port number in it matches the port number you told FG to listen on, so long as it's not a common/well-known port number (anything less than 1500).
Enjoy!

"Questions or comments can be directed to http://flightgear.org/forums/viewtopic.php?f=6&t=11895.

"Copyright 2011 Dwayne Gable"

The link to the forum is not working either.
AbstractViolinist
 
Posts: 5
Joined: Sat Aug 13, 2022 10:29 pm
Version: 2020.3.13
OS: Mac OS X

Re: FGCopilot

Postby Gijs » Thu Aug 18, 2022 7:07 am

Hi and welcome!

I don't know anything about the current status, but you can find the referenced forum topic at its new location here: viewtopic.php?f=6&t=11895 (I've fixed the link on the wiki). According to the last posts it doesn't seem to be under active care at the moment.

Which exact step in the readme is troubling you?

Cheers,
Gijs
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9544
Joined: Tue Jul 03, 2007 3:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: FGCopilot

Postby AbstractViolinist » Thu Aug 18, 2022 5:18 pm

Thank you for the reply! I'm unsure if "Simply extract to a convenient location" means extracting the file anywhere on the computer. I'll try putting it somewhere in the FlightGear folders. I also don't understand what "start FG, then double-click" means.
AbstractViolinist
 
Posts: 5
Joined: Sat Aug 13, 2022 10:29 pm
Version: 2020.3.13
OS: Mac OS X

Re: FGCopilot

Postby TheEagle » Thu Aug 18, 2022 11:21 pm

Noooo, don't put it into any of the FG folders - you might mess something up. You can unzip the addon to ANY place you like. Then, open the launcher, go to the settings tab and add --telnet=<port number> to the command line options. Now start FG by clicking on Fly. Or if you start FG directly from the command line, just add --telnet=<port number> there. Now, you need to navigate to the addon folder - there must be some executable in there, which you are supposed to double-click to run it. After that a dialog box should appear, where you must input the same <port number> as you gave FG before with --telnet=<port number>. I hope it's clear now - don't hesitate to report back if you encounter any further problems ! :)
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: FGCopilot

Postby AbstractViolinist » Sun Aug 21, 2022 4:23 am

Thank you so much for the explanation! I didn't realize that that is a separate application. I successfully opened it (had to download Java) and was able to set it up, and the last step (hopefully) is to wait and test it with another pilot.
AbstractViolinist
 
Posts: 5
Joined: Sat Aug 13, 2022 10:29 pm
Version: 2020.3.13
OS: Mac OS X


Return to Development

Who is online

Users browsing this forum: No registered users and 8 guests