Author Topic: Help with graphical joystick in GUI to control a pi-quadcopter  (Read 2141 times)

0 Members and 1 Guest are viewing this topic.

Offline Jake-Cub94Topic starter

  • Beginner
  • *
  • Posts: 4
  • Helpful? 1
Help with graphical joystick in GUI to control a pi-quadcopter
« on: February 26, 2015, 07:42:36 AM »
Hello!
I have recently created a quadcopter using a raspberry pi.
At the moment I am controlling it with keyboard to input to the lxterminal which sends a message to the escs to spin the motor.
This works perfectly now but it's time to make a GUI for android! (relatively new to programming so please bare with me XD)
I downloaded android studio and had a bit of a play with it however I have some questions:

1.How would I create a graphical joystick on the screen of my phone to control the quad?

2. What is the best way to link the GUI on my phone to the raspberry pi using wifi and how would I go about this?

3. How would I create an override so that connecting a ps3 controller (xperia z1 phone) would mean that I could use this instead?

I welcome any suggestions and help that you can give!
Many thanks,
Cub

Offline mklrobo

  • Supreme Robot
  • *****
  • Posts: 516
  • Helpful? 14
  • From Dream to Design at the speed of Imagination!
Re: Help with graphical joystick in GUI to control a pi-quadcopter
« Reply #1 on: February 26, 2015, 08:32:34 AM »
 :) Hello!  :)
Your project is pretty intense, insofar as the work involved.
Alot of questions come to light;
> program for Raspberr Pi to control quadcopter
> maxim and minimum limits of the program Android studio.
> PS3 controller schematic/interface to the phone/computer.
> any software drivers/interface to PS3 or associated components.
> feedback controls for flying, altitude, speed, gps, etc.
I would suggest this: Break the project down into components,
as the questions above indicate.
Start at the begining project question, an look up any free info on
youtube.
If you can not find any in a certain amount of time, continue on
to the next objective.
You objective seems to be, to build your own controller; in which can
be bought. In your pursuit of the project, research, and trial and error
will be the cost of your endeavor.
  I would like to know how to
do this myself.   :) Keep me posted....   ;D ;D ;D

Offline Jake-Cub94Topic starter

  • Beginner
  • *
  • Posts: 4
  • Helpful? 1
Re: Help with graphical joystick in GUI to control a pi-quadcopter
« Reply #2 on: March 03, 2015, 05:12:11 PM »
Hey!
Thanks for taking an interest :D
For the GUI I chose to use swing. Its easier for beginners and I can include everything that I need.
I started setting up the classes and the GUI and then I found something called Jslider which is basically a slider which you would find on a volume control for your pc.
This will be used for the vertical thrust.
The right analogue stick is something to worry about for another day,
I've read up a lot on sockets and networking in Java however i'm still trying to get my head around it.

I believe that I can make a java socket meet a python socket, change the ticks on the slider so that they represent the duty cycle in 0.001 increments and send each of these instructions through the socket to my python program to increase the rpm of my motors.
i believe that each instruction will have to be a byte large though so if i went from 0-50% throttle in a second then it would have to send 500 bytes worth of information.
Im quite new to understanding bytes as well ysee.....

Offline mklrobo

  • Supreme Robot
  • *****
  • Posts: 516
  • Helpful? 14
  • From Dream to Design at the speed of Imagination!
Re: Help with graphical joystick in GUI to control a pi-quadcopter
« Reply #3 on: March 04, 2015, 08:05:22 AM »
 8) cool!  8)
In regards to this info in your post;
I can make a java socket meet a python socket, change the ticks on the slider so that they represent the duty cycle in 0.001 increments and send each of these instructions through the socket to my python program to increase the rpm of my motors. I believe that each instruction will have to be a byte large though so if i went from 0-50% throttle in a second then it would have to send 500 bytes worth of information.
I have played with somthing of this nature with a communications center, and found the (for me)
java to python more than I could handle, and so I used Perl. I had to interface a C++
dedicated program for perhiperial control, while the Perl program acted like a gateway to interface to
any other programs that might be needed. A cool concept,  8) I was making a robotic glider, which looked
like the starship enterprise, to be controlled by a group of people dressed up like Kirk, Checkov, Spock,
in a trailer that was modified inside to look like the old starship bridge. They would fly the glider around with on
board cameras, with touch screen controls on their console, just like Star Trek. I was with a group of
Trekkies, who absolutely love the Star Trek series. I never finished the glider, as the group was dissolved. :'(
But, ohh boy! was it fun to try! What would Commander Data think of me?   ;D ;D

 


Get Your Ad Here