Giter VIP home page Giter VIP logo

remote-access's Introduction

Drone Controller

http://gtataranni.github.io/remote-access/

University project for MobServ class at Eurecom.

The purpose of the project is to build a chatbot application that allows to send remote commands between Android devices, having one (or more) of them onboard on drones. The server is a simple chat server in Python/Twisted, and the client is an Android app that sends/receives messages and performs actions described there.

How to install

In order to use the application, download the code and compile it using Android Studio.

For the server, python and the Twisted protocol are required. To launch the server use command

$ python server.py

When the server is up and running it will show the ip address to insert in the application.

How to use

In order to use the application you need to run the server. The server will provide you with an ip address, which you need to insert into the first page of the app and click connect to server. Once you are connected you can choose a name, if you choose a name already taken you will be asked to provide a different one. If you do not choose a name, the first thing you write in the application will be your name.

Now you can start sending requests, request for periodic messages or provide your own GPS position.

This is done by first selecting the name of the device you would like to communicate with, or choosing all in order to broadcast. After doing this you will be provided with the option of sending a request, recuesting for periodic messages or send your own GPS position. When you for example choose to send a request, options on what you can request will appear. When the only option that remains is ;, your message is ready to be send and you click SEND, do not include ; before SEND.

You can also add more actions to your message by adding ; an action message. After choosing ; you continue as explained over, starting by selecting a device which will recive the action.

When you click SEND your request will be sent through the server to the devise you choose and you will recive a response with the data you requested.

Protocol syntax

The syntaxt of the messages beeing sent over the server is of the form

/recipient_user/command/action/params/moreparams

The recipient_user field is used for the username of the user the command is beeing sent to. recipient_user can also be set to all in case of broadcast.

The command field is used for commands, like requests (Req), responses or execute (Exec).

The action field is used for the specific action of the command. E.g. Gps, Photo, Live stream or Network.

The params and moreparams field is used for any parameters that the action migth need. This field will be specific for every different action.

The server forward the message m by sending “< sendername >, m” to the recipient, where sendername is the name of the message sender.

Examples of messages:

/user1/req/photo```

Here user3 requests a photo from user1

```< server >
/all/resp/clientlist/2/user1/user3```

Here the server broadcast the clientlist


### Features

##### Already implemented

Supported features so far are

 - Properly connect/disconnect from the server
 - Proper interpretation of server messages
 - Easy message composability/suggestions
 - List of connected users
 - Ask/send GPS coordinates in plaintext
 - Show received GPS position on a map
 - Send GPS position through clicking on a map
 - Ask/Send pictures to/from other clients
 - Save received pictures to memory
 - Save received pictures in app gallery
 - Stream video
 - Log activity to file


##### Ideas on features that can be added

A potential new feature that can be implemented is the ability to interact with the drone API. Making it possible to control the drone with your android device, sending commands for it to e.g. move left, right, up, down, etc. There is also a possibility to implement the possibility to send a position by clicking on the map, making the drone fly to the given position.

Another feature that can be added include event-based subscription for batch commands.

There is also the possibility to implement a request for data from various sensors, e.g. a humidity or temperature sensor  connected to the application. You will then be able to monitor the environment where the sensors are located, if the sensors allow it, it is possible to implement a command to change e.g. the temperature.


##### How to implement new features

In order to implement new features you just need to add a new case in the switch case for `messageIsReq()` and `messageIsResp()`. If you want to implement a new feature which need to deal with the GUI, you need to add a callback and implement it in the activity in charge of the GUI.

If you want to, you can also rewrite the GUI. You do this by rewriting the class ChatActivity.


### License

Apache License, Version 2.0, January 2004

http://www.apache.org/licenses/


### Support

If you are having issues, please let us know by posting an issue on this github page.

remote-access's People

Contributors

giovanni-t avatar gtataranni avatar heidisv avatar leoxama avatar pacellig avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

remote-access's Issues

Renaming suggestion

What about renaming the app with something related to the fact that we designed everything thinking about an android on a drone? Something like "remote drone" or similar

Status of project - Midterm suggestions - Terminated tasks

ToDo or To be Improved/Terminated:

  • Improve UI towards a chat interface ✓done
    → All the functionalities completely moved to the new GUI
  • batch mode
    → for now, implemented it in linux style, by putting a ';' after the 'read/gps' so that you can write another /dest/read/something after that.
    → adding the picture to the list of messages but it doesn't work. It's because of the communication model for the picture, maybe a list of pictures should be kept (?)
  • periodic cmd
    → a pubsub communication model
    → 1st version for GPS implemented , needs to be implemented also for the pictures (?)
  • persistent storage of the results
    → done for the photo, adding a gallery that shows the pictures
  • formalize generic schemes on per service basis (photo, gps)
    → ENTIRELY To be written
  • change the app name to "Drone Controller"

** Terminated tasks from the ones included in the midterm presentation: **

  • Show received GPS position on a map. ✓done
  • Improve application connectivity by keeping a thread in background. ✓done
  • Send GPS position through clicking on a map. ✓done
  • Let user to save pictures to memory. ✓done
  • Stream video. ✓done

TODO: List of streaming videos

We have to show a list of available streaming videos. The list has already been built, hence, the only thing that is missing is the list adapter. Who is interested in doing this part, please contact me.

TODO: Documentation needed

Need documentation. The important aspects to document:

  • The protocol syntax
    • how will the server forward the messages ( themessage)
    • what is the use of every field of the message
    • some examples of action request and response
  • How to add a new feature
    • which are the rules to follow in order not to break the protocol

We should consider using the GitHub wiki!

Stop GPS service

We need to stop the GPS service either when closing the socket, or even after a small timeout. I would suggest when we close the socket

TODO: Save and load pictures from the storage

We have to manage to save pictures in the storage (done but not tested), show the pictures somehow and load them from the storage to be send to the server(change the input source -> it is not supposed to be difficult to implement)

Feature: speed (GPS)

We could add the GPS speed in the things we can ask to the other client.
I was also thinking about orientation (in the space/3axes) but then it would be hard to represent it graphically, only in numbers. But it doesn't make too much sense if we just send incomprehensible numbers

TODO: midterm suggestions

[ UPDATE ] 29-12-2015

  • Improve UI towards a chat interface
    → Giovanni is taking care of it
  • batch mode
    → for now, I implemented it in linux style, by putting a ';' after the 'read/gps' so that you can write another /dest/read/something after that.
    → i tried adding the picture to the list of messages but it doesn't work.
    I guess it's because of the communication model for the picture.
  • periodic cmd
    → a pubsub communication model
    → 1st version for GPS implemented , needs to be done for the pictures (?)
  • persistent storage of the results
    → done for the photo, adding a gallery that shows the pictures
  • formalize generic schemes on per service basis (photo, gps)

Broadcast request for photo does not work

The request of photo to all clients connected ( /all/req/photo ) won't work.
This is due to the server limitations in design, which was something we had as a starting point and has not been changed in the deep structure. Rewrite the server is, unfortunately, out of the time window for this team

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.