Hi everyone.

Are you trying to test your control law, that you implemented in Simulink, on a flight simulator (e.g. X-Plane) and see how it  performs before you actually try it on your drone?

Then this is the right tool for you!!

This is basically some Simulink models that allow communication between Simulink and X-Plane 10 (Yes X-Plane 10, not 9!)

Simply, it decodes the UDP data packets coming from X-Plane to meaningful data (roll, pitch, yaw, rates...etc), so you can use them in your control design!

Also, it allows you to send commands to the plane in X-Plane (e.g. control surfaces, nosewheel and many!!)

I know many of you (developers, researchers, or even hobbyists), myself included, have been looking for such tool. Probably since long time, like myself!

I also know that there are many people who have already done that, but I can not easily find such tool that can be just downloaded and used immediately.  So I thought of just doing it and share it with you guys.

These are basically three models.

1- 'setup_xplane': it sends some commands to xplane to tell it what data to send back (e.g. attitude angles, rates, GPS data..etc). Basically, it checks the boxes of the requested data in the 'Data Input & Output' screen in xplane

2- 'getData_from_xplane': it receives requested data packets from xplane, then decipher them to meaningful information.

3- 'commands_to_xplane': send commands to xplane to manipulate the plane actuators (elevators, ailerons, rudder, nose wheel). However, it's not limited to that!! You can have almost full control of the simulator environment, by sending the appropriate commands.

Again, this is tested successfully on X-Plane 10 NOT 9. However, it can be modified to talk to X-Plane 9 (you will do that; yet, i don't see why you still use X-Plane9 anyway!)

Feel free to play with it and tune/modify/improve/copy/redistribute it, for good, but please at least keep the credit :)

I hope you find it useful for you guys, and I am waiting for your feedback.

[Codes here]

Thanks

[EDIT] July 2nd 2014

I did a little modification on the nose wheel  control signal. It was not working properly. Now it does.

Inbox me if you are interested in the modified version.

=============================

[EDIT] Jul 6 2014

Files are moved to Mathwroks File Exchange website

Link here

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Hi Mohamed

    while i was trying connect the simulink with x-plane i opened all m files(getdata,send command and setup_x-plane ) i get a error.

    "Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks.
    Use 'mex -setup' to select a supported C-compiler."

    Do you have any advise

    • @ thevenin:  Could you contact me by email?

      • yes i contated to you by e-mail at 10.44 today

  • Hi Yoga,

    I am glad it serves your needs. It certainly helped a lot in our lab, too. It facilitates the process of simulation testing and control design.

  • I have found this UDP very useful as it is very configurable. I could adapt it to a helicopter X-planes model and set the various parameters like rotor rpm, pitch etc. Getting the data back is also very easy and I could close the loop on an X-planes helicopter model using Simulink. Thank you.

This reply was deleted.

Activity

DIY Drones via Twitter
RT @MarvelmindMaxim: Extreme precision for 60 swarming robots. #marvelmind #autonomousrobotics #robotics #swarmrobotics #rtls #ips #indoor…
34 minutes ago
DIY Drones via Twitter
RT @MarvelmindMaxim: Precise (±2cm) tracking for racing boats and autonomous boats. Works outdoor and indoor. #autonomous #AutonomousVehic…
34 minutes ago
DIY Drones via Twitter
RT @MarvelmindMaxim: Helping PixHawk folks to fly autonomous quadcopters using PX4 and ArduPilot. https://marvelmind.com/drones/ Equally suitab…
35 minutes ago
DIY Robocars via Twitter
RT @chr1sa: The @DIYRobocars @donkey_car virtual AI car race is starting in 15 minutes! Watch it live on Twitch https://www.twitch.tv/mossmann3333 htt…
Saturday
DIY Robocars via Twitter
RT @chr1sa: Don't miss our monthly @DIYRobocars @donkey_car virtual AI car race tomorrow at 10:00am PT live on Twitch. Head-to-head racing…
Friday
DIY Robocars via Twitter
RT @sparkfun: Our completed tutorial on building an @NVIDIA Jetson Nano-powered @Sphero RVR gets your bot up and running via teleoperation…
Thursday
DIY Robocars via Twitter
RT @SmallpixelCar: Freeway test https://t.co/4V5tV9lhIP
Thursday
DIY Robocars via Twitter
Very small autonomous cars racing, thanks to an overhead camera: https://control.ee.ethz.ch/research/team-projects/autonomous-rc-car-racing.html
Wednesday
DIY Robocars via Twitter
Wednesday
DIY Robocars via Twitter
Wednesday
DIY Robocars via Twitter
RT @chr1sa: Don't miss our virtual AI car race this Saturday! Real developers + virtual cars =🏎️🏎️🏎️ Head-to-head battles with thrills, sp…
Tuesday
DIY Robocars via Twitter
Jul 27
DIY Robocars via Twitter
RT @usashirou1: Jetson nano by Isaac Kaya #jetson https://t.co/Mu1N0CyQkN
Jul 23
DIY Robocars via Twitter
RT @GPUsolution: JetRacer mady by Iflytek company #JetsonNANO #Nvidia https://t.co/MimTymIwge
Jul 23
DIY Robocars via Twitter
RT @openmvcam: I love this: Mega or Mini? Image Classification on the 1MB OpenMV Cam H7 by Ish Ot Jr. in OpenMV, Edge Impulse, Internet of…
Jul 23
DIY Robocars via Twitter
RT @RoboticMasters: This is looking pretty good... but still needs a bit more refinement. Pure OpenCV Turning Sign Detection. No Tensorfl…
Jul 23
More…