Skip to content

A python wrapper and controlling software for the Pluto drone.

License

Notifications You must be signed in to change notification settings

ShisuiMadara/PlutoPanchi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PlutoPanchi

This program is responsible for establishing a fast and stable channel of communication between the python wrapper and Pluto. It is very easy to set-up and customise as per need but is powerful enough out-of-box that it can handle drone controls easily. It implements the MSP protocol over a TCP connection and sends the commands as specified by the wrapper and also sends packets periodically to maintain a persistent connection between Pluto and the python wrapper. It should also be noted that it is an essential component of the wrapper package and is required for the wrapper to work.
The complete documentation can be found HERE .


Installation and building

The program is available as a downloadable standalone executable for Linux systems; however, we recommend you build/compile it from the source code which is easy to do. There are some pre-requisites that you should note:
  • Operating System: Linux/Unix or POSIX-Compliant
  • Compiler: G++ 9.4.0 or above
  • Libraries: ZeroMQ
  • Note:

    The compilation process may work for G++ versions < 9.4.0 but there is no guarantee. ZeroMQ is not required for running the program and is only required for building.


    For Debian users, if you do not have ZeroMQ you can install it using the following command:
    $ sudo apt-get install libzmq3-dev
    

    Non-Debian users can refer to: https://zeromq.org/download/
    To obtain the source code you should clone the git repository and we are assuming at this point you have already cloned the repo. You will find the code in the [repository]/wrapper/Server folder. Inside the folder, there must be a main.cpp file which contains the source code. To proceed with the build open a terminal and change the directory to the above-mentioned.
    To build the program you simply need to run the following command:

    $ g++ -o Server.out -lzmq -lpthread main.cpp
    

    After the execution of the command, if successful, you must see a file named Server.out and it is the compiled program. In case of an error please make sure you followed the instructions correctly. In case the error persists please take a look at the troubleshooting section.


    How To Use

    To use this program, you should follow simple steps:
    1. Make sure you are connected to the Pluto’s Wi-Fi Hotspot
    2. Run the executable and wait for the program to print “Connected”
    3. Command to run the executable:

      $ ./Server.out

    These are the only steps to run this program. Once the “Connected” message is printed, the backend program is actively communicating with Drone and is ready to receive commands from the wrapper. If you encounter errors like connection failed or ZMQ error please take a look at the Troubleshooting section.

    Further sections will cover details about the working of the program and are of great importance if you want to modify the program or to understand how it works. If you are not interested in the internal working, I would suggest you to skip to Troubleshooting at the end.

    Controlling

    Parameter Type
    W Go forward
    S Go backward
    A Go towards left
    D Go towards right
    1 Take Off
    2 Land
    3 Back Flip
    4 Front Flip
    5 Right Flip
    6 Left Flip
    Arrow Key UP Increase Height
    Arrow Key DOWN Decrease Height
    Q Quit

    Dependencies

    • C/C++ compiler
    • Python3
    • pthread library
    • zmq
    • curses

    Troubleshooting

    Possible Errors:
    • Drone Connection Error: The most probable cause for this error is that you are not connected to the Pluto’s Wi-Fi. Generally connecting/re-connecting to Wi-Fi fixes this issue.
    • ZMQ Port Already Used: This error happens when you restart the application few times. The fix is to kill the process running on that port. You can run the command:

      $ fuser -k 6000/tcp

    • -1 on Console: It usually means drone has closed the Socket on its end. You need to rerun the program.

About

A python wrapper and controlling software for the Pluto drone.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published