Posted by Tim Trueman on November 7, 2009 at 4:30pm
Here's an example of how to get data from the simulator: http://gist.github.com/228998It has everything you need to treat it as a virtual IMU. This was instrumental in getting my extended Kalman filter running (to be open sourced soonish) and I hope you find it useful too!(I'll do an updated version that shows you how to control the plane in X-Plane from your code.)
Faisal, I'll be curious to hear a comparison between FlightGear and X-Plane with respect to ease of adding it into the loop. Thanks for your links too!
Any good sources you guys are using for smaller (R/C) planes in X-Plane? I've been a big fan of X-Plane for some time - it is a great simulator, especially if you have a techy bent...
I was able to run a closed loop simulation with FlightGear as well. It's super easy ... in fact, all that you need is already done and explained in my blog posts. The only thing left to do is to flesh out the C code with your IMU/autopilot code and test away!
Comments
That's exactly what I was looking for! Thank you!
I am working on an updated post with code. It includes a bunch of updates but due to work limiting my time it probably won't be ready until January.
This might get you started if you're a confident programmer: https://gist.github.com/1161599
Any chance we will see the updated post with the control commands? Thanks!
self.az = unpack_from('f', data, 9+16+36)[0] # normal
self.ax = unpack_from('f', data, 9+20+36)[0] # axial
self.ay = unpack_from('f', data, 9+24+36)[0] # side
What variables are you using for accelerations from X Plane. From the input/output menu I see the angular rates but not the accels.
Any good sources you guys are using for smaller (R/C) planes in X-Plane? I've been a big fan of X-Plane for some time - it is a great simulator, especially if you have a techy bent...
http://www.diydrones.com/profiles/blogs/closed-loop-autopilot
http://www.diydrones.com/profiles/blogs/closed-loop-autopilot-1
X-plane looks interesting, I'm gonna check it out!