webstrider
Posts: 6
Joined: Sun May 11, 2014 5:21 pm

How to make complex ui in python for my raspberry pi project

Sun May 11, 2014 5:43 pm

I have asked this question on the yahoo answers but somebody recommended me this forum. So here is the copy from yahoo:

what im trying to do is make user interface for my future head-up display (see through display like is on google glass) using little pico/mini projector projecting on visor/goggles made of some kind of reflective glass or semi-transparent mirror and the raspberry pi. it is going to project informations like gps data, data from magnetometer, batery status, map and so one.
i want it to be in form like is hud in the crysis games (i know that its not possible to achive so pretty interface with python). I already have working python programms for my gps and magnetometer (adafruit ultimate gps breakout, hmv5883l). It needs to be in python 2.7 because the gps module im using (gpsd (gps daemon)) is only python 2.7 compatible. Im able to read all the data like longitude altitude and so one. I want to make it as console aplication.
For that purpouse i have tried to use urwid, but my programming and computer knowledge are not so good. The main problems are to make each part of programm run in other part of screen like: map on the bottom left corner, the gps data left upper corner, the battery status bottom right corner and so one. + i dont know how to make the map: i want that it will show your location on some offline (downloaded) map. I will add photo of the idea how i want the hud to look like. if you have any other advices f.e. for the visor pleace tell :)
Attachments
Crysis3.jpg
This is how the hud should look like.
Crysis3.jpg (54.37 KiB) Viewed 3909 times

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: How to make complex ui in python for my raspberry pi pro

Mon May 12, 2014 3:05 am

Python is slow and memory hungry but you can make a prototype quickly... I think QT4 would be the graphics tool of choice but you might also look Into abything else that can use the gpu on the pi... there may be a list somewhere...
SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

User avatar
Forrrge
Posts: 120
Joined: Fri Apr 27, 2012 6:07 am
Location: Gateshead, UK.

Re: How to make complex ui in python for my raspberry pi pro

Mon May 12, 2014 6:35 am

Also have you seen this? Looks to be very relevant to you.

http://www.raspberrypi.org/google-glass-pi-style/

toxibunny
Posts: 1382
Joined: Thu Aug 18, 2011 9:21 pm

Re: How to make complex ui in python for my raspberry pi pro

Mon May 12, 2014 7:54 am

python is easily capable of putting a few numbers and graphs on-screen. qt is a pain though - i'd recommend pygame or pi3d...
note: I may or may not know what I'm talking about...

webstrider
Posts: 6
Joined: Sun May 11, 2014 5:21 pm

Re: How to make complex ui in python for my raspberry pi pro

Mon May 12, 2014 8:53 am

Update 1:

thank you for your answers...ill try the pygame....but there is still the problem on how to make the map... ;)

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: How to make complex ui in python for my raspberry pi pro

Mon May 12, 2014 9:16 am

webstrider wrote:there is still the problem on how to make the map... ;)
One possibility - http://www.foxtrotgps.org/

It can be installed on Raspbian with a simple sudo apt-get install foxtrotgps

It is gpsd compatible. It is Open Source, so if it isn't what you need you could learn from how it has been implemented.

There are other 'geo-location' programs available - this just happens to be one that I have tried and found to work.
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

toxibunny
Posts: 1382
Joined: Thu Aug 18, 2011 9:21 pm

Re: How to make complex ui in python for my raspberry pi pro

Mon May 12, 2014 9:23 am

well, i'd start by having a .bmp of a map of the local area, for testing. then you'd need to know the gps location for some recognisable spots. from those, you can figure out the 'range' of your .bmp, in gps terms. it would be done in a similar way to writing the scale on a home-made thermometer by first measuring ice and boiling water for reference points. then you just copy a section of map to the screen centering on the current gps.

alternatively, I think google freely let you use their maps somehow...
note: I may or may not know what I'm talking about...

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: How to make complex ui in python for my raspberry pi pro

Mon May 12, 2014 9:29 am

toxibunny wrote: alternatively, I think google freely let you use their maps somehow...
Err, no. They don't.

The OpenStreetMap project (OSM) on the other hand does: www.osm.org

You can download map tiles (not too many- don't abuse the server) and you can download vector data to draw your own maps.

Take a look at Navit. It will draw maps based on OSM data downloads. However, once you have the vector data there's a whole bunch of things you can do with it. Most notably, you can do it *offline*.

webstrider
Posts: 6
Joined: Sun May 11, 2014 5:21 pm

Re: How to make complex ui in python for my raspberry pi pro

Wed May 14, 2014 12:14 pm

Update 2:

I just Need a map (f.e.the openstreetmap) that will Show in the bottom left Corner and because the map is going to be much larger that the actual frame in which the map is is going to be in, i Need to Center it by the (longitude and latitude) data coming out of the gps. i Need to Center the map that in the middle will be some dot or arrow presenting the Position. like on car Navigation (without the actual navigating) or on a map in a game. + must be in python

webstrider
Posts: 6
Joined: Sun May 11, 2014 5:21 pm

Re: How to make complex ui in python for my raspberry pi pro

Tue May 20, 2014 8:03 pm

ok im working with the pygame right now and it works fine...now im triing to solve a problem with syncing gps time with the raspi time...im tusing this code (https://www.wardriving-forum.de/forum/f ... 70459.html) , but its not working well...all the data are real...from gpsand compass...(its not finished yet) :) https://www.dropbox.com/s/mxn8t2g1dgt3f ... 200354.jpg
Last edited by webstrider on Thu May 22, 2014 2:37 pm, edited 1 time in total.

User avatar
topguy
Posts: 6464
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: How to make complex ui in python for my raspberry pi pro

Tue May 20, 2014 10:11 pm

Cool project btw.

Having a *huge* map image and only showing a small part of it might be quite wasteful of memory space and could slow down your application. Maybe pygame has good code for such cases, I dont know, but many programs showing maps uses tiles (smaller squares) and put them together to make a bigger image.
* http://wrobell.it-zone.org/geotiler/
* http://cbick.github.io/osmviz/html/index.html

How are your trying to read the time from the GPS ?

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: How to make complex ui in python for my raspberry pi pro

Tue May 20, 2014 10:48 pm

webstrider wrote:ok im working with the pygame right now and it works fine...now im triing to solve a problem with syncing gps time with the raspi time...im tusing this code, but its not working well...all the data are real...from gpsand compass...(its not finished yet) :) https://www.dropbox.com/s/mxn8t2g1dgt3f ... 200354.jpg
There are several examples on the web showing how to synchronise Linux time with a GPS. Best not to invent your own.

webstrider
Posts: 6
Joined: Sun May 11, 2014 5:21 pm

Re: How to make complex ui in python for my raspberry pi pro

Thu May 22, 2014 2:39 pm

topguy wrote:Cool project btw.

Having a *huge* map image and only showing a small part of it might be quite wasteful of memory space and could slow down your application. Maybe pygame has good code for such cases, I dont know, but many programs showing maps uses tiles (smaller squares) and put them together to make a bigger image.
* http://wrobell.it-zone.org/geotiler/
* http://cbick.github.io/osmviz/html/index.html

How are your trying to read the time from the GPS ?
actualy the the gps satelites also provide time (https://learn.adafruit.com/adafruit-ult ... g-your-gps)...but the sinchronizing is not such proble as the map...

webstrider
Posts: 6
Joined: Sun May 11, 2014 5:21 pm

Re: How to make complex ui in python for my raspberry pi pro

Thu May 22, 2014 7:37 pm

i dont know if its right to tell it in raspberry pi forum, but ill propably switch to another much more powerfull computer...but im still going to use raspi...im sorry if its not right to discuse this think in here but i think the main idea of raspberry pi is to learn young people use computers for other purpouses then playing games (btw. im 15 so that purpouse was achived ;) )...so here comes another question along with the about the map...what do you think about this beast (btw. my program runs on 0.2 fps now :D (1 frame per 5 sec)) http://shop.udoo.org/eu/product/udoo-quad.html ....ill also update the photo...there has nothing much changed...i have just added parts that were just copy and paste (of course with little bit of editing) of parts i have already done...but it looks pretty :) the data on the pic are inaccurate because im under roof...https://www.dropbox.com/s/xqxavcv4jujig ... 212018.jpg

Return to “General discussion”