You need to be a member of diydrones to add comments!
This reply was deleted.
Activity
RT @chr1sa: Donkeycar 4.4 released with tons of new features, including path learning (useful with GPS outdoors), better Web and Lidar supp…
RT @NXP: We are already biting our nails in anticipation of the #NXPCupEMEA challenge! 😉 Did you know there are great cash prizes to be won…
RT @gclue_akira: レースまであと3日。今回のコースは激ムズかも。あと一歩
#jetracer https://t.co/GKcEjImQ3t
RT @chr1sa: The next @DIYRobocars autonomous car race at @circuitlaunch will be on Sat, Dec 10.
Thrills, spills and a Brazilian BBQ. Fun…
RT @arthiak_tc: Donkey car platform ... Still training uses behavioral cloning #TCXpo #diyrobocar @OttawaAVGroup https://t.co/PHBYwlFlnE
RT @emurmur77: Points for style. @donkeycar racing in @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/Y2hMyj1…
RT @SmallpixelCar: Going to @diyrobocars race at @UCSDJacobs https://t.co/Rrf9vDJ8TJ
RT @SmallpixelCar: Race @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/kK686Hb9Ej
RT @PiWarsRobotics: Presenting: the Hacky Racers Robotic Racing Series in collaboration with #PiWars. Find out more and register your inter…
RT @Hacky_Racers: There will be three classes at this event: A4, A2, and Hacky Racer! A4 and A2 are based around UK paper sizing and existi…
RT @NeaveEng: Calling all UK based folks interested in @diyrobocars, @f1tenth, @donkey_car, and similar robot racing competitions! @hacky_r…
RT @araffin2: 🏎️
After hours of video editing, I'm happy to share a best of my Twitch videos on learning to race with RL.
🏎️
Each part is…
Replies
Yes, I want this for X-Plane & FlightGear ! You made great progress!
Would it be possible add a sim_net_config option for multiple computers sim_a=HK_GCS & APM HIL interface, sim_b=FlightGear, sim_c=X-Plane, and sim_d= X-Plane Instructor or extra window display.
Programs can interface with FlightGear through FlightGear's property tree. Very powerful.
http://wiki.flightgear.org/index.php/Property_Tree
If you run FlightGear with the --httpd= option, it will run a webserver on http://localhost: where you can browse the property tree and refresh the current values. Alternatively, in FlightGear you can type "/", and the property tree viewer will pop up and you can view the values changing in real time. I did this to figure out the sign convention for different properties.
The property tree can be read from and written to using a "Protocol". The protocol basically defines the format in which data is exchanged. You identify the nodes in the property tree which you want to interact with, the data types, the string formatting, and voila! Attached are the input and output .xml protocol files which I used.
The data can be passed through several means, serial port, tcp, udp, etc... I chose UDP for ease.
Here is how I ran FlightGear:
fgfs --httpd=5500 --generic=socket,out,40,localhost,5000,udp,output_protocol --generic=socket,in,45,localhost,5010,udp,input_protocol
I made the input data rate faster than the output data rate, because I would rather have FlightGear waiting for a new input value (when it doesn't get a new input, the last one persists) than the input being buffered.
The --generic option allows one to specify a generic protocol, which was defined in the .xml file (attached).
--generic=socket,,, ,,,.
Attached is a .c program which I wrote to interact with the property tree and provide feedback controls to FlightGear. I've implemented simple proportional control for roll and pitch to stabilize the aircraft. Timing is driven by FlightGear. The code makes a blocking call to read UDP data. It waits until it receives a new packet, processes it, and sends a packet with control inputs back to FlightGear. Then it loops again, waiting for another packet from FlightGear. Currently, everything is hardcoded (port numbers, etc ..), but it should be trivial to make it more general purpose.
This should provide a complete framework with which to write an autopilot controller in C.
Comments please!
input_protocol.xml
output_protocol.xml
udpserver.c
I also have the algorithms written in Flash, because they are easier to debug/visualize and I don't need to worry about memory types in C causing new formulas to output crazy values.
Jason
1. You need to create a "generic protocol" called "myproto" (or whatever).
http://wiki.flightgear.org/index.php/Howto:_Create_a_generic_protocol
http://wiki.flightgear.org/index.php/Generic_Protocol
The nodes to record are listed in the first post. Each node goes in its own block.
2. Run flight gear from command prompt like this: fgfs --generic=file, out, 20, data.xml, myproto
This will log the specified values 20 times per second to a file called data.xml using myproto.xml as the generic protocol description.
One can also output the parameters to a socket, which can be read in real-time from another application. The generic protocol can also be used to take parameters in (to close the loop!). I will investigate this and will post when i have it working.
I have been experimenting with JSBSim as a stand-alone simulation tool. I have sucessfully modeled an RC-sized aircraft and collected data, but I am still working on closing the autopilot loop. I would like to eventually add FlightGear for pretty visualization.
It can be done, I'm not sure if anyone has closed the loop using FlightGear yet.
Tom