- Notifications
You must be signed in to change notification settings - Fork0
A System to allow integration of unsupported Radio Controllers with Microsoft AirSim Simulator for Unreal Engine 4 without any coding required, as well as provide general APIs for handling Real Drones.
License
AshishKumar4/AirSimRCplusplus
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This software stack allows you to integrate any Radio Controller hasle-free, to use with Unreal Engine 4 based AirSim Simulator as well as to provide extended APIs for general use.
Wanted to use your Radio Controller but its not supported by AirSim? or just wanted to get data from a Radio Controller to a PC for god knows what reason? Well this might just end your search.
AirSimRC++ allows you to connect your random radio controller to a PC, via anintermediate Arduino (or stm8/32 or any other microcontroller really), and provide a useful set of APIs and tools to do stuff with the data, for example, connect to the AirSim Simulator of Unreal Engine 4, withoutEXPLICITLY coding for a new RX.
First upload theArduinoInterface sketch onto an arduino board (or stm etc.). Tweak the serial speed as the max available on that board.
Connect the board to the Reciever, All signal pins on PWM pins of the Arduino. If required, change the pin layout in the sketch as necessary.
Launch Unreal Engine 4 and aproject configured with AirSim, and hit'Play'
Execute theAirSimControls.py script (rom theAirSim Handler folder) using Python 3. Terminal ->python3 AirSimControls.py
Open a terminal in theManualController Directory and typemake to compile and generate binaries.
Switch on the Radio controller and make sure it is binded to the reciever.
Execute the ManualController Binary.
Procedures to calibrate the controller follows. Firstboth joysticks to bottom, thentop, thenleft thenright thenleave in middle. ThenWait for 5 seconds for the procedure to finish.
Following the steps, You should now be able to fly the MultiCopter using the controller, intuitively. Report any bugs/problems if found.
The Radio Reciever isconnected to an Arduino, withprovided Code uploaded on it. The Radio Reciever sends data recieved from the transmitter viaPWM signals. Arduino then writes the data onto aSerial port as stream to a PC attached.
TheManualController Program reads from this Serial port, unpacks the data, calibrates it when needed, and applies some signal processing to sanitize and smoothen it, and converts it into a range of0-255.ManualController program then connects to a local server, created by theAirSimControls.py and begins sending RX data over via sockets.
TheAirSimControls.py is a Python 3 script that connects to the AirSim module running along Unreal Engine 4, sets up a local server, listens for RX data fromManualController, and then calls AirSim's internal APIs to forward the commands and thus control the virtual drone as if real.
One might wonder why so much trouble setting up local servers and passing data via sockets. well, This code is a part of a greater project, where I needed to control a Real Drone, via a PC itself. This ManualController was developed to just test all the protocols and APIs involved. And to test the offboard side of things, I created a simple 'Drone Emulating' server, which mimicked the Drone's APIs that I had developed, but instead of commanding a real drone, commanded a virtual one in Unreal Engine itself. I thought this can be useful for someone as a standalone system itself, thus this.The overhead of data transfers isn't significant as compared to the main bottleneck, which is the Reciever to Arduino communication, which can't be optimized.Still, Suggestions, Bug alerts and possible fixes as well as any optimization you well are welcomed, Do open a pull request.
About
A System to allow integration of unsupported Radio Controllers with Microsoft AirSim Simulator for Unreal Engine 4 without any coding required, as well as provide general APIs for handling Real Drones.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.