diff --git a/AirSim Handler/AirSimControls.py b/AirSim Handler/AirSimControls.py index 201c01b..ac00567 100644 --- a/AirSim Handler/AirSimControls.py +++ b/AirSim Handler/AirSimControls.py @@ -94,7 +94,7 @@ def ChannelControllers(self, id): # Handshake Message -> IN: "Hello Gardien!" buff = c.recv(1024).decode("utf-8") if buff == "Hello Gardien!": - print("Connection to overlord successfull!") + print("Connection to overlord successful!") c.send(b"Hello Overloard!") # Handshake else: print("Connection Failed!, Got Back this handshake -->") @@ -115,14 +115,14 @@ def ChannelControllers(self, id): bb = bytes(a[tmp.rfind(b".") :], "utf-8") # Get the index of the last dot and store it for future b = str(a).split(".") except Exception as e: - print("Error in Recieving and parsing...") + print("Error in Receiving and parsing...") del self.connections[id] del c break print(b) for i in b: # For multiple logged commands cmd = i.split(":") - if len(cmd) == 3: # We recieved the command properly + if len(cmd) == 3: # We received the command properly # print("Got Request nicely...") val = float(int(cmd[1])) print("Got Request "+ self.channelTable[id]["name"] + " :"+ str(val)) diff --git a/ManualController/Controls/DirectControls/DirectControls.cpp b/ManualController/Controls/DirectControls/DirectControls.cpp index 57901c4..60f39cf 100644 --- a/ManualController/Controls/DirectControls/DirectControls.cpp +++ b/ManualController/Controls/DirectControls/DirectControls.cpp @@ -35,7 +35,7 @@ void DirectController::InitSequence() for (int i = 0; i < 6; i++) { send(server_fd[i], HANDSHAKE_IN_MSG, strlen(HANDSHAKE_IN_MSG), 0); - // TODO: Place mechanism to recieve back handshake and if not matching, Panic! + // TODO: Place mechanism to receive back handshake and if not matching, Panic! char *buff = (char *)malloc(1024); int valread = read(server_fd[i], buff, 1024); if (strncmp(buff, HANDSHAKE_OUT_MSG, strlen(HANDSHAKE_OUT_MSG))) @@ -43,7 +43,7 @@ void DirectController::InitSequence() std::cout << "Gardien Could not establish Connection / Handshake Failure...\n"; throw "Handshake Failed!"; } - printf("Handshake Successfull, Connection Established!\n"); + printf("Handshake Successful, Connection Established!\n"); } disarm(); balance(); diff --git a/ManualController/Controls/README b/ManualController/Controls/README index 530a2e9..d6bb90f 100644 --- a/ManualController/Controls/README +++ b/ManualController/Controls/README @@ -7,4 +7,4 @@ the Microsoft AirSim Simulatior. DirectControl/ --> Code and APIs for handling over commands to the remote drone computers AbstractControls --> Abstract classes to provide APIs for control and communicating to the drone -DirectControls --> Implemntations of the Controller class for Actual Real Drone Controls \ No newline at end of file +DirectControls --> Implementations of the Controller class for Actual Real Drone Controls \ No newline at end of file diff --git a/ManualController/Controls/RemoteDemo.cpp b/ManualController/Controls/RemoteDemo.cpp index 9cf020a..0d5e351 100644 --- a/ManualController/Controls/RemoteDemo.cpp +++ b/ManualController/Controls/RemoteDemo.cpp @@ -67,7 +67,7 @@ int main() case 0: exit(0); default: - cout << "Incorrect Option choosen!\n"; + cout << "Incorrect Option chosen!\n"; } } return 0; diff --git a/ManualController/ManualController.cpp b/ManualController/ManualController.cpp index b94f507..a61260e 100644 --- a/ManualController/ManualController.cpp +++ b/ManualController/ManualController.cpp @@ -39,11 +39,11 @@ class RunningAverage double alpha; public: - RunningAverage(int blength, int seed, double alph) + RunningAverage(int blength, int seed, double alpha) { for (int j = 0; j < blength; j++) avgBuffs.push_back(seed); - alpha = alph; + alpha = alpha; buffLength = blength; } @@ -55,9 +55,9 @@ class RunningAverage return y; } - void Reset(double alph) + void Reset(double alpha) { - alpha = alph; + alpha = alpha; } }; diff --git a/README.md b/README.md index ed0acc7..0abbc4e 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ # Use any Radio Controller easily with AirSimRC++ -## 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 an **_intermediate 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, without **_EXPLICITLY coding for a new RX_**. +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. -### _For the Architecture, check the bottom note_ +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 an **_intermediate 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, without **_EXPLICITLY coding for a new RX_**. + +## _For the Architecture, check the bottom note_ ## **_Usage:_** > First upload the **_ArduinoInterface_** sketch onto an arduino board (or stm etc.). Tweak the serial speed as the max available on that board. @@ -17,7 +19,7 @@ > Open a terminal in the **_ManualController_** Directory and type **_make_** to compile and generate binaries. -> **_Switch on the Radio controller_** and make sure it is binded to the reciever. +> **_Switch on the Radio controller_** and make sure it is binded to the receiver. > **_Execute the ManualController_** Binary. @@ -27,13 +29,12 @@ ### Following the steps, You should now be able to fly the MultiCopter using the controller, intuitively. Report any bugs/problems if found. ### **_The Architecture is as follows_** -> The Radio Reciever is **connected to an Arduino**, with **provided Code uploaded on it**. The Radio Reciever sends data recieved from the transmitter via _PWM_ signals. Arduino then writes the data onto a _Serial_ port as stream to a PC attached. +> The Radio Receiver is **connected to an Arduino**, with **provided Code uploaded on it**. The Radio Receiver sends data received from the transmitter via _PWM_ signals. Arduino then writes the data onto a _Serial_ port as stream to a PC attached. > The **_ManualController_** 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 of _0-255_. **_ManualController_** program then connects to a local server, created by the **_AirSimControls.py_** and begins sending RX data over via sockets. > The **_AirSimControls.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 from **_ManualController_**, 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. - +The overhead of data transfers isn't significant as compared to the main bottleneck, which is the Receiver 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. \ No newline at end of file diff --git a/Real Drone/ControlServer.cpp b/Real Drone/ControlServer.cpp index ffe2d1e..d3313d1 100644 --- a/Real Drone/ControlServer.cpp +++ b/Real Drone/ControlServer.cpp @@ -72,7 +72,7 @@ class ControlServer CreateChannel(portBase + 5, 5); // Aux2 is 5*/ // We Create six channels, each corresponding to six basic controls of drone - // We would then create serveral threads, which would in turn listen to sockets + // We would then create several threads, which would in turn listen to sockets LaunchListenerThreads(); } ~ControlServer() diff --git a/Real Drone/SPI/SPIdrivers.h b/Real Drone/SPI/SPIdrivers.h index 2b28eb6..6a8c37b 100644 --- a/Real Drone/SPI/SPIdrivers.h +++ b/Real Drone/SPI/SPIdrivers.h @@ -4,7 +4,7 @@ #define SPI_SPEED 1000000 /* - SPI Drivers, to send and recieve data packets over SPI + SPI Drivers, to send and receive data packets over SPI */ int SPI_init(char* file); diff --git a/Real Drone/test/test.ino b/Real Drone/test/test.ino index a571bae..1aa2fc1 100644 --- a/Real Drone/test/test.ino +++ b/Real Drone/test/test.ino @@ -99,7 +99,7 @@ ISR(SPI_STC_vect) { Serial.println("Got..."); //buff[0] = g; - SPDR = ACCEPT_SIGNAL; // Recieved Signal + SPDR = ACCEPT_SIGNAL; // Received Signal index = 0; process = false; }