Navit
From Openmoko
m (formatting code) |
m (→Navit on Debian: Since Debian 6.0 navit is on stable.) |
||
(204 intermediate revisions by 43 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{Application|Navit}} | |
− | + | As described on the [http://navit.sourceforge.net/ Navit home page], | |
+ | <i>"'''Navit''' is a car navigation system with routing engine. | ||
+ | |||
+ | Its modular design is capable of using vector maps of various formats for routing and rendering of the displayed map. It's even possible to use multiple maps at a time. | ||
+ | |||
+ | The GTK+ or SDL user interfaces are designed to work well with touch screen displays. Points of Interest of various formats are displayed on the map. | ||
+ | |||
+ | The current vehicle position is either read from gpsd or directly from NMEA GPS sensors."</i> | ||
+ | |||
+ | Some people say Navit is also a good choice for pedestrian and bicycle navigation. | ||
+ | |||
+ | [[Image:Navit-2241.png|thumb|Navit-r2241]] | ||
+ | |||
+ | == Acknowledgment == | ||
Thanks to [[User:Alessandro | Alessandro]], stefan_schmidt, cp15 and all Navit developers I have done a small ("not really working") preview of Navit on Neo1973 at [http://www.telemobilityforum.com/eng/ Telemobility Forum 2007]. Thanks to [http://gfoss.it GFoss] guys to invite me. | Thanks to [[User:Alessandro | Alessandro]], stefan_schmidt, cp15 and all Navit developers I have done a small ("not really working") preview of Navit on Neo1973 at [http://www.telemobilityforum.com/eng/ Telemobility Forum 2007]. Thanks to [http://gfoss.it GFoss] guys to invite me. | ||
Line 8: | Line 21: | ||
==Setting up Navit== | ==Setting up Navit== | ||
− | + | ||
− | + | ===Install Navit=== | |
− | + | ||
− | + | ==== Map Size ==== | |
− | + | Of you use e.g. entire Germany in an rectangle form it will have more than 500MB. | |
− | + | Navit on FR works with maps in the size of less that 350MB. So split the larger areas in portions with a smaller size than 350MB. Otherwise Navit will not be able to process the maps. | |
− | ** Here's an example | + | |
− | ** | + | Change navit.xml to modify the used map bin-file, e.g. germany1.bin to germany2.bin |
− | ** | + | |
− | + | ==== Navit on FSO (OM2008.x,SHR,...) ==== | |
− | + | ||
− | + | You can now simply add a feed from there : http://download.navit-project.org/navit/openmoko/svn/ | |
− | + | ||
− | * | + | Essentially, to enable this directory as [[Om_2008.8_Installer#How to add a Repository ?|feed]] and install or update navit do: |
− | + | * Only for the first time: | |
− | + | echo src navit http://download.navit-project.org/navit/openmoko/svn > /etc/opkg/navit-feed.conf | |
− | + | opkg update | |
− | + | ||
− | + | * Always: | |
− | <map type="binfile" enabled="yes" data="/ | + | opkg install navit |
+ | |||
+ | Navit will be auto-updated when you run opkg upgrade later | ||
+ | |||
+ | Navit might not be able to use gpsd at startup: | ||
+ | navit:plugin_load:can't load '/usr/lib/navit/vehicle/ | ||
+ | libvehicle_gpsd.so', Error 'libgps.so.16: cannot open shared object | ||
+ | file: No such file or directory' | ||
+ | navit:vehicle_new:invalid type 'gpsd' | ||
+ | |||
+ | to solve this issue (necessary for SHR): | ||
+ | |||
+ | opkg install libgps17 | ||
+ | ln -s /usr/lib/libgps.so.17 /usr/lib/libgps.so.16 | ||
+ | |||
+ | ====Navit on Debian==== | ||
+ | Navit is now (01.08.2011) in Debian [http://packages.debian.org/squeeze/navit stable], [http://packages.debian.org/source/testing/navit testing] and [http://packages.debian.org/source/unstable/navit unstable]. | ||
+ | |||
+ | Add the following line to <tt>/etc/apt/sources.list</tt> with e.g. editor <tt>vi</tt> or <tt>nano</tt>: | ||
+ | |||
+ | deb http://ftp.de.debian.org/debian stable main | ||
+ | |||
+ | Then update with apt-get: | ||
+ | |||
+ | apt-get update | ||
+ | |||
+ | The up-to-date source package is available through git at '''git://git.debian.org/git/collab-maint/navit.git''' ([http://git.debian.org/?p=collab-maint/navit.git;a=summary browse]). | ||
+ | |||
+ | ====Navit on Android==== | ||
+ | Download current version [http://download.navit-project.org/navit/android_armv4t/svn/ navit-current.apk] on your Android. See [[Android usage]] for installing Apps on your [http://code.google.com/p/android-on-freerunner/wiki/Applications Android on Freerunner]. | ||
+ | |||
+ | see [http://wiki.navit-project.org/index.php/Navit_on_Android Navit on Android] Navit Project Wiki | ||
+ | |||
+ | You can use one download map which you have to copy on the FAT32 partition of your SD card as '''<tt>navitmap.bin</tt>'''. | ||
+ | |||
+ | During first use after installation, navit for android will ask you, if you want to intall [http://espeak.sourceforge.net/ TTS] (Text to Speech [http://www.speech.cs.cmu.edu/flite/ festival-lite]). If you decide to install TTS then Navit crashes (with version [http://download.navit-project.org/navit/android_armv4t/svn/ navit-svn-3495.apk]). | ||
+ | |||
+ | ====Navit on QtMoko==== | ||
+ | You can find some information for installing Navit in the [[QtMoko]] article. | ||
+ | |||
+ | ===Set up the maps you want=== | ||
+ | |||
+ | ====The Easy Way==== | ||
+ | Use [http://maps.navit-project.org/download/ Navit Map Extractor] based on [http://www.openstreetmap.org OpenStreetMap]. Navigate to the region you want, and click "select" to select region, select the area you want, then click download. [[Image:osmdownload.jpg|200px|thumb|Download OpenStreetMaps]] | ||
+ | |||
+ | If you just want the entire planet (as of this writing, ~1.8 GB), it's [http://maps.navit-project.org/planet.bin here]. | ||
+ | |||
+ | [http://downloads.cloudmade.com/ CloudMade] also has up-to-date maps from OpenStreetMap by country (by state in the US). | ||
+ | |||
+ | {{Note|Be aware of the map size that can be used on your FR (On Android working with map sizes less than 350MB is O.K. on SHR 450MB also work, so SHR may not have a map size limit)}} | ||
+ | |||
+ | ====From the command line==== | ||
+ | '''OpenStreetMap''' - follow directions at http://wiki.navit-project.org/index.php/OpenStreetMaps | ||
+ | * There are some pre-processed, up-to-date maps that can be grabbed with wget: | ||
+ | |||
+ | <pre>wget -O germany.bin http://maps.navit-project.org/api/map/?bbox=5.185546875,46.845703125,15.46875,55.634765625</pre> | ||
+ | |||
+ | You can put a shell script into <tt>/usr/local/bin/update-maps</tt> | ||
+ | #!/bin/sh | ||
+ | echo "Update OpenstreetMaps" | ||
+ | echo "---------------------" | ||
+ | echo " download and store OSM maps on /media/card/maps" | ||
+ | wget -O /media/card/maps/germany.bin http://maps.navit-project.org/api/map/?bbox=5.185546875,46.845703125,15.46875,55.634765625 | ||
+ | echo "update germany.bin finished" | ||
+ | You have to make the script executable with: | ||
+ | chmod u+x /usr/local/bin/update-maps | ||
+ | Create a maps-directory (e.g. with path <tt>/media/card/maps/</tt>) on your SD-card: | ||
+ | mkdir /media/card/maps/ | ||
+ | Then you can update with this script all your maps on the SD-card if you have internet connection: | ||
+ | update-maps | ||
+ | * Here's an example to get the maps for the area around Seattle, WA: | ||
+ | ** Find the map coordinates using http://informationfreeway.org/?lat=47.520270037501454&lon=-122.20130713167327&zoom=9&layers=B000F000 | ||
+ | ** Download 4 regions from OpenStreetMaps ([[Navit#Script_to_download_OSM_maps|see below]] for a script to do this for you automatically for largish areas): | ||
+ | |||
+ | <pre>wget -O map1.osm http://www.openstreetmap.org/api/0.5/map?bbox=-122.2,47.5,-122,47.7 | ||
+ | wget -O map2.osm http://www.openstreetmap.org/api/0.5/map?bbox=-122.4,47.5,-122.2,47.7 | ||
+ | wget -O map3.osm http://www.openstreetmap.org/api/0.5/map?bbox=-122.4,47.3,-122.2,47.5 | ||
+ | wget -O map4.osm http://www.openstreetmap.org/api/0.5/map?bbox=-122.2,47.3,-122,47.5</pre> | ||
+ | |||
+ | * A binary Navit map file needs to be created. The following uses osm2navit, and it's recommended that this command be used on something more powerful than the Neo: | ||
+ | |||
+ | <pre>cat *.osm | osm2navit --dedupe-ways mymap.bin</pre> | ||
+ | |||
+ | ===Copy the map to the NEO=== | ||
+ | To copy the map using scp (replace ''/directory'' as is appropriate in the following): | ||
+ | <pre>scp mymap.bin root@neo:/directory</pre> | ||
+ | If you copy the map <tt>germany.bin</tt> to the SD card on the Neo use e.g. in the directory <tt>maps</tt>: | ||
+ | scp germany.bin root@neo:/media/card/maps | ||
+ | Once it's somewhere on the NEO, Navit needs to know that it's there. | ||
+ | <pre>mkdir ~/.navit | ||
+ | cp /usr/share/navit/navit.xml ~/.navit/navit.xml | ||
+ | vi ~/.navit/navit.xml</pre> | ||
+ | |||
+ | note that in some version navit includes other xml files from /usr/share/navit, for instance mapsets are now defined in maps.xml. | ||
+ | |||
+ | ===Enable Maps in Navit === | ||
+ | Now you must let Navit know the maps you want to use. Several disabled mapset-tags are predefined. | ||
+ | In the navit.xml file, put the following into a new <mapset> section (and disable the default <mapset> just above - or else it will not work): | ||
+ | <pre><map type="binfile" enabled="yes" data="/directory" /></pre> | ||
+ | For example with a <tt>germany.bin</tt> on the SD-card you use: | ||
+ | <mapset enabled="yes"> | ||
+ | <map type="binfile" enabled="yes" data="/media/card/maps/germany.bin" /> | ||
+ | </mapset> | ||
+ | or if you store all downloaded maps in the directory <tt>/media/card/maps</tt> then add the following lines to <tt>navit.xml</tt>. | ||
+ | <mapset enabled="yes"> | ||
+ | <map type="binfile" enabled="yes" data="/media/card/maps/*.bin"/> | ||
+ | </mapset> | ||
+ | {{Note|this will only load the first map that machtes *.bin (its a bug/feature)!}} | ||
+ | {{Note|that the bin-file and the map set both have to be enabled}} | ||
+ | |||
+ | Disable unused mapset sections by setting enabled to <tt>no</tt>, e.g. the pre-installed sample maps at line 370 in <tt>navit.xml</tt>. | ||
+ | <mapset enabled="no"> | ||
+ | <xi:include href="$NAVIT_SHAREDIR/maps/*.xml"/> | ||
+ | </mapset> | ||
+ | |||
+ | |||
* Run navit | * Run navit | ||
− | ** Start gllin | + | ** Start [[gllin]] (for GTA01) |
− | ** Start gpsd ( gpsd /tmp/nmeaNP ) | + | ** Start [[gpsd]] ( gpsd /tmp/nmeaNP ) |
** Start navit | ** Start navit | ||
+ | |||
+ | * The version of osm2navit with which you build the maps should match the version of navit you have. If in doubt, build the maps on the Openmoko. | ||
+ | |||
+ | ===Tips and Tricks=== | ||
+ | ====Center on Vehicle==== | ||
+ | Navit supports a "always center on vehicle" option. | ||
+ | |||
+ | To activate this add | ||
+ | follow="3" | ||
+ | to the <tt>vehicle</tt> tag in navit.xml. | ||
+ | <vehicle name="Local GPS" profilename="car" enabled="yes" active="1" follow="3" | ||
+ | source="gpsd://localhost" gpsd_query="w+xj" color="#0000ff"> | ||
+ | The "3" causes to give the gui time to do something between the repaints (drag the map or browse the menu). When its set to "1" navit does nothing more than repainting the map continuously. | ||
+ | ====Localize for Germany==== | ||
+ | * [http://www.freeyourphone.de/portal_v1/viewtopic.php?f=22&t=1039 SHR German] from freeyourphone.de | ||
+ | * Go to [[Configure_SHR_for_German-speaking_use]] download | ||
+ | http://work.zoff.cc/openmoko/shr/de_at/customize_pack_shr_no_maps.tar.gz | ||
+ | : extract <tt>init_shr_testing.sh</tt> and see what [[User:Zoff99|zoff99]] did to customize navit for German speaking. Search for <tt>glibc</tt> and <tt>navit</tt> in localization script for understanding the steps to be perform on your freerunner. | ||
+ | * [http://wiki.openmoko.org/wiki/Navit#Speech Speech Language]for more details. | ||
+ | * you can adapt these steps for other languages by replacing der_DE respective de parts to your favorite language setting. | ||
+ | http://wiki.openmoko.org/wiki/Navit#Speech | ||
+ | |||
+ | ==Routing== | ||
+ | [[Image:navit_main_menu.png|100px|thumb|Navit Main Menu]] | ||
+ | [[Image:navit_action_menu.png|100px|thumb|Navit Action Menu]] | ||
+ | The main menu has 4 submenus | ||
+ | * Action | ||
+ | * Settings | ||
+ | * Tools | ||
+ | * Route | ||
+ | Normally you would assume the entering a town can be found under the submenu Route, but Town is hidden under submenu Action. Route will provide the description of the route as text and a height profile of your trip. Tools was not working on 08/2009 Version of navit on SHR (see [[SHR User Manual]]). | ||
+ | |||
+ | ===Preselect Country of Destination=== | ||
+ | Normally you have to select the the country first before choosing the town and street name. It might be more convenient for you if you preselect the country already with your settings. | ||
+ | The article [[Configure SHR for German-speaking use]] had a preselection of the country "Austria" in Navit. Adapt the localization for your country and maps in Navit, so that do not need to select the country anymore. | ||
+ | |||
+ | Actually Navit derives the preselected country from the calling environments's locale (see [[Localization]]). Make sure, that LC_ALL ist '''not''' set though. Otherwise navit fails to interprete gpsd output and you end up with strange gps coordinates. When starting from gui (e.g. illume) you can achieve this by supplying an executable script /usr/local/bin/navit which might look like this: | ||
+ | <pre> | ||
+ | #!/bin/sh | ||
+ | #export LANG=xx_YY.UTF-8 # Uncomment this line and replace xx_YY, if | ||
+ | # your gui's locale is not setup accordingly. | ||
+ | unset LC_ALL | ||
+ | exec /usr/bin/navit | ||
+ | </pre> | ||
+ | So a valid locale environment preselecting search for German cities would look like this: | ||
+ | <pre> | ||
+ | root@om-gta02 ~ $ locale | ||
+ | LANG=de_DE.UTF-8 | ||
+ | LC_CTYPE="de_DE.UTF-8" | ||
+ | LC_NUMERIC="de_DE.UTF-8" | ||
+ | ... | ||
+ | LC_MEASUREMENT="de_DE.UTF-8" | ||
+ | LC_IDENTIFICATION="de_DE.UTF-8" | ||
+ | LC_ALL= | ||
+ | </pre> | ||
+ | Note that there's a limited number of [http://wiki.navit-project.org/index.php/OpenStreetMaps#Known_countries_by_osm2navit countries supported by osm2navit] and Navit's search function. | ||
+ | |||
+ | ===Select Destination=== | ||
+ | [[Image:navit_select_country.png|100px|thumb|Select Country]] | ||
+ | |||
+ | You can the select your destination in the main menu: | ||
+ | * via '''Bookmarks''', if you saved the previous location or | ||
+ | * via '''Town''', if you want to enter a new destination. If you use a destination more frequently, just save the location as bookmark. | ||
+ | |||
+ | When you click in the main menu on <i>Action</i> the <i>Action</i> menu appears with 4 subitems. | ||
+ | * Bookmarks of previous locations (stored in <tt>/home/root/.navit/destinations.txt</tt> | ||
+ | * a globe showing a location as destination, | ||
+ | * a vehicle that shows the current GPS position of the vehicle. If the freerunner receives no GPS signal the locations of the vehicle is set to 0.0.0N and 0.0.0E. | ||
+ | * Town is the action to enter a destination. | ||
+ | * Quit navit is the last action in this submenu. | ||
+ | |||
+ | Select the icon <i>Town</i> in the main menu (if you see the map, you can get to the main menu just by clicking on the map). | ||
+ | |||
+ | |||
+ | ====Select Country==== | ||
+ | [[Image:navit_country_selected.png|100px|thumb|Country Options]] | ||
+ | [[Image:navit_destination_details.png|100px|thumb|Enter Bookmark Details]] | ||
+ | |||
+ | Before you can search for City you have to select a Country. To do that, click on the icon in the left upper corner of the search field (could look like a white square with blue top-left quadrant). | ||
+ | |||
+ | Just type in the first letter of the country (e.g. "G") and Navit makes suggestions (e.g. Gabon, Germany). | ||
+ | |||
+ | ====Enter Town==== | ||
+ | |||
+ | When you have selected the country (e.g. Germany) the flag appears and you can select the town. | ||
+ | Then you can save the town as bookmark and enter more details like streets to the selected town. | ||
+ | |||
+ | The search is still a little buggy. | ||
+ | |||
+ | ====Enter Street==== | ||
+ | You can enter the street and streetnumber and save it as bookmark when you use the destination often. | ||
+ | |||
+ | ====Bookmarks==== | ||
+ | Navigation and planning of routes with Navit can be organized with bookmarks. | ||
+ | * set a bookmark as current position | ||
+ | * set a bookmark as destination | ||
+ | Then you can see the suggested route in blue on the map. | ||
+ | |||
+ | Bookmarks are stored in: | ||
+ | /home/root/.navit/bookmark.txt | ||
+ | |||
+ | The GPS-location (if GPS-signal is available) will be highlighted with a small blue circle. The color of the circle can be defined via editing the <tt>navit.xml</tt> (see [http://wiki.openmoko.org/wiki/Navit#Set_Cursor_Color select cursor color]). | ||
+ | * a dot in the blue circle is indicating that your are not moving, | ||
+ | * an arrowhead is indicating the direction, when you are moving. | ||
+ | Then routing can start and in the map the route is highlighted. | ||
+ | |||
+ | ====Screenshots in Navit Documentation==== | ||
+ | The screenshots are made with <tt>gpe-scap</tt>, that can be installed by: | ||
+ | opkg install gpe-scap | ||
+ | if not installed already. Navigation through your installed application navit and login via ssh on your Freerunner | ||
+ | ssh -l root 192.168.0.202 | ||
+ | assuming that your Freerunner has the IP 192.168.0.202. | ||
+ | Any time you want to make a screenshot just start via your desktop computer | ||
+ | gpe-scap | ||
+ | and save the screenshot to you freerunner. | ||
+ | Download the screenshot to your desktop computer with | ||
+ | desktop# sftp://root@192.168.0.202 | ||
== News == | == News == | ||
+ | A deeper look into configuring Navit can be found in the [http://wiki.navit-project.org/index.php/Configuring_Navit Navit-Wiki]. | ||
− | === | + | === Getting the display right === |
− | + | ||
− | + | If using SHR the keyboard in country/town/street search mode does not fit on the street, make sure your gui configuration is set to the following line: | |
− | + | ||
− | == | + | <gui type="internal" font_size="350"/> |
− | + | ||
− | + | The example line provided for freerunners hides some important icons. Namely, instead of typing your city name first, you will first have to click the button on the top left, to go into country search mode. Enter your country name, then the city name, in order to enable the search function. This requires your map data to be searchable. | |
− | + | ||
− | + | You can start in fullscreen mode with fullscreen="1" | |
− | http:// | + | <gui type="internal" font_size="350" fullscreen="1"/> |
+ | |||
+ | If you want to enable "+" and "-" as Zoom-In and Zoom-Out buttons on the bottom of the map enable the button with the following xml-tags: | ||
+ | <osd enabled="yes" type="button" x="-96" y="-96" command="zoom_in()" src="zoom_in.xpm"/> | ||
+ | <osd enabled="yes" type="button" x="0" y="-96" command="zoom_out()" src="zoom_out.xpm"/> | ||
+ | |||
+ | You can find sample Layouts here: | ||
+ | [http://wiki.navit-project.org/index.php/OSD_Layouts Sample Layouts from navit-wiki] | ||
+ | |||
+ | === Set Cursor Color === | ||
+ | [[Image:red_cursor.png|90px|thumb|Red Cursor]] | ||
+ | If you navigate, the route is marked in blue color on the map. The current position of the vehicle is displayed by a blue circle. The circle is sometimes difficult to see on the blue track. If you want to change the color, size of the vehicle cursor edit the vehicle XML-environment in navit.xml (e.g. replace blue color #0000FF with red color #FF0000 -- for details of [http://html-color-codes.info Color Codes] select color, copy and paste code in <tt>navit.xml</tt>) | ||
+ | |||
+ | <vehicle name="Local GPS" profilename="car" enabled="yes" active="1" source="gpsd://localhost" gpsd_query="w+xj" color="#0000ff"> | ||
+ | <!-- Navit can write a tracklog in several formats (gpx, nmea or textfile): --> | ||
+ | <!-- <log type="gpx" data="track_%Y%m%d-%i.gpx" flush_size="1000" flush_time="30"/> --> | ||
+ | <cursor w="56" h="56"> | ||
+ | <!-- tag defines the circle for the cursor --> | ||
+ | <itemgra> | ||
+ | <circle color="#ff0000" radius="42" width="6"> | ||
+ | <coord x="0" y="0"/> | ||
+ | </circle> | ||
+ | <circle color="#ffffff" radius="48" width="2"> | ||
+ | <coord x="0" y="0"/> | ||
+ | </circle> | ||
+ | <circle color="#ffffff" radius="36" width="2"> | ||
+ | <coord x="0" y="0"/> | ||
+ | </circle> | ||
+ | </itemgra> | ||
+ | <!-- tag defines the dot when the vehicle is not moving --> | ||
+ | <itemgra speed_range="-2"> | ||
+ | <polyline color="#ff0000" width="6"> | ||
+ | <coord x="1" y="1"/> | ||
+ | <coord x="1" y="-1"/> | ||
+ | <coord x="-1" y="-1"/> | ||
+ | <coord x="-1" y="-1"/> | ||
+ | </polyline> | ||
+ | <circle color="#ffffff" radius="9" width="2"> | ||
+ | <coord x="0" y="0"/> | ||
+ | </circle> | ||
+ | </itemgra> | ||
+ | <!-- This itemgra-tag defines the arrow when the vehicle moves --> | ||
+ | <itemgra speed_range="3-"> | ||
+ | <polyline color="#ff0000" width="6"> | ||
+ | <coord x="-7" y="-10"/> | ||
+ | <coord x="0" y="12"/> | ||
+ | <coord x="7" y="-10"/> | ||
+ | </polyline> | ||
+ | <polyline color="#ffffff" width="2"> | ||
+ | <coord x="+10" y="-10"/> | ||
+ | <coord x="3" y="15"/> | ||
+ | </polyline> | ||
+ | <polyline color="#ffffff" width="2"> | ||
+ | <coord x="-10" y="-10"/> | ||
+ | <coord x="-3" y="15"/> | ||
+ | </polyline> | ||
+ | </itemgra> | ||
+ | </cursor> | ||
+ | </vehicle> | ||
+ | The following screenshot show Navit with a red cursor on a blue track: | ||
+ | |||
+ | [[Image:navit_color_cursor.png|200px|thumb|Red Cursor Color on blue track - vehicle not moving]] | ||
=== Speech === | === Speech === | ||
− | Navit can speak if you install eSpeak + speech-dispatcher and updates your navit.xml file. | + | Navit can speak if you install [http://espeak.sourceforge.net/ eSpeak] + [http://www.freebsoft.org/speechd speech-dispatcher] and updates your navit.xml file. |
− | + | If you want navit using your language, and setting LC_MESSAGES fails due to missing glibc locale, set the enviroment variable LANGUAGE. For instance running | |
+ | LANGUAGE=de navit | ||
+ | will set the ui and output to german. | ||
− | + | For SHR there is a big german localization patch see [[Configure SHR for German-speaking use]]. | |
− | + | ||
− | + | One way to configure speech output: | |
− | + | ||
− | + | * mokoTTS aims to integrate these packages in OM: | |
− | + | http://projects.openmoko.org/projects/mokotts/ | |
− | + | ||
− | + | install espeak, dotconf, and then speech-dispatcher. | |
− | + | note: running 2008.8 updating from zecke's "testing" repo does not require "dotconf" | |
+ | |||
+ | ==== Speech Language ==== | ||
+ | To change the speech tag in navit.xml with speech dispatcher: | ||
+ | <speech type="cmdline" data="spd-say '%s'" /> | ||
+ | |||
+ | * "'''spd-say -l fr '%s''''" for using the French voice for example. | ||
+ | * "'''spd-say -l de '%s''''" for using the German voice for example. | ||
+ | |||
+ | {{Note|You can check speech dispatcher output from the shell.}} | ||
+ | Example for German: | ||
+ | spd-say -l=de "Dies ist die Winterstraße 23" | ||
+ | The speech-dispatcher is blocking the audio after suspend. So after a suspend you will hear no ringtone, when a phone call is coming in and you cannot listen do audio files. | ||
+ | A solution is to disable starting of speech-dispatcher with: | ||
+ | update-rc.d -f speech-dispatcher remove | ||
+ | Then the speech-dispatcher should be started if and only if navit is running and shut down when navit is closed. | ||
+ | |||
+ | Furthermore navit should be started indirect with a script <tt>navit.sh</tt> instead of a direct start with the binary located in <tt>/usr/bin/navit</tt>. The script <tt>navit.sh</tt> listed below starts speech-dispatcher before navit, and stops it afterwards. See http://lists.openmoko.org/nabble.html#nabble-td1088795 | ||
+ | |||
+ | The following script is doing the suggested procedure. This script includes a language fix for Austria (see [[Configure SHR for German-speaking use]]). | ||
+ | export LANG=de_AT.utf8<tt>spd-say --language=de Output-String</tt> You can replace the --language by -l } | ||
+ | Replace '''<tt>de_AT</tt>''' in this line with the appropriate language variable in the following script <tt>navit.sh</tt>. | ||
+ | <pre> | ||
+ | #! /bin/sh | ||
+ | # | ||
+ | # Copyright Matthias Hentges <devel@hentges.net> (c) 2008 | ||
+ | # License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license) | ||
+ | # | ||
+ | # Filename: navit.sh | ||
+ | # Date: 20080105 (YMD) | ||
+ | # | ||
+ | ################################################################################# | ||
+ | # | ||
+ | # 20080105 - v0.0.1 - Initial release | ||
+ | # 20090818 - - Zoff <zoff@zoff.cc> addons and fixes | ||
+ | # | ||
+ | # | ||
+ | ################################################################################# | ||
+ | |||
+ | |||
+ | ################################################################################# | ||
+ | # | ||
+ | # On devices with low memory (< 512Mb?) Navit will segfault on start. | ||
+ | # This can be worked around by doing | ||
+ | # "echo 1 > /proc/sys/vm/overcommit_memory" | ||
+ | # | ||
+ | ################################################################################# | ||
+ | |||
+ | |||
+ | . /etc/profile | ||
+ | |||
+ | set|grep LC | ||
+ | |||
+ | #### Stop the speech dispatcher #### | ||
+ | /etc/init.d/speech-dispatcher stop | ||
+ | |||
+ | #### Language Fix ################# | ||
+ | set|grep LC | ||
+ | |||
+ | |||
+ | export LC_ALL='' | ||
+ | unset LC_ALL | ||
+ | export LANG=de_AT.utf8 | ||
+ | |||
+ | set|grep LC | ||
+ | |||
+ | #### Start the speech dispatcher #### | ||
+ | /etc/init.d/speech-dispatcher start & | ||
+ | |||
+ | |||
+ | set|grep LC | ||
+ | |||
+ | |||
+ | # need cpu and display | ||
+ | mdbus -s org.freesmartphone.ousaged /org/freesmartphone/Usage org.freesmartphone.Usage.SetResourcePolicy Display enabled | ||
+ | |||
+ | |||
+ | if test "`cat /proc/meminfo | grep ^MemTotal | awk '{print $2}'`" -lt "500000" | ||
+ | then | ||
+ | if test "$USER" = "root" | ||
+ | then | ||
+ | echo "Enabling low-mem workaround..." | ||
+ | echo 1 > /proc/sys/vm/overcommit_memory | ||
+ | else | ||
+ | echo "I need root-privs to enable the low-mem workaround!" | ||
+ | fi | ||
+ | fi | ||
+ | |||
+ | ######### Start NAVIT NOW ############ | ||
+ | |||
+ | navit $* | ||
+ | |||
+ | #### Stop the speech dispatcher #### | ||
+ | |||
+ | /etc/init.d/speech-dispatcher stop | ||
+ | |||
+ | # release cpu and display | ||
+ | mdbus -s org.freesmartphone.ousaged /org/freesmartphone/Usage org.freesmartphone.Usage.SetResourcePolicy Display auto | ||
+ | |||
+ | </pre> | ||
+ | Save the <tt>navit.sh</tt> script in: | ||
+ | /usr/bin/navit.sh | ||
+ | Make the script executable: | ||
+ | chmod u+x /usr/bin/navit.sh | ||
+ | Now you have to edit the desktop icon, so that it starts this script <tt>navit.sh</tt> instead of the binary <tt>/usr/bin/navit</tt>. | ||
+ | nano /usr/share/applications/navit.desktop | ||
+ | Edit the line with <tt>Exec=...</tt>, so that it starts the script <tt>navit.sh</tt> instead of the navit binary. | ||
+ | <pre> | ||
+ | [Desktop Entry] | ||
+ | Version=1.0 | ||
+ | Name=Navit | ||
+ | Name[de]=Navit | ||
+ | Name[fr]=Navit | ||
+ | Comment=The open source vector based navigation program with routing engine | ||
+ | Comment[de]=Ein vektorbasiertes Navigationsprogramm | ||
+ | Comment[fr]=Le logiciel opensource de navigation vectorielle | ||
+ | Exec=/usr/bin/navit.sh | ||
+ | Icon=navit | ||
+ | StartupNotify=true | ||
+ | Terminal=false | ||
+ | Type=Application | ||
+ | Categories=GTK;Utility;Geography; | ||
+ | GenericName=Navit | ||
+ | GenericName[de]=Navit | ||
+ | |||
+ | </pre> | ||
+ | |||
+ | '''Alternatively''', you can make speech-dispatcher restart on resume, see http://trac.shr-project.org/trac/ticket/494 | ||
=== Script to download OSM maps === | === Script to download OSM maps === | ||
− | [[User:Wurp | + | [[User:Wurp|Wurp]] wrote a little python script to download all OSM maps within a lat/long rectangle. Just copy the script to a file called dlOSM.sh, chmod +x it, and run it like |
+ | dlOSM.sh <minimum latitude> <maximum latitude> <minimum longitude> <maximum longitude> | ||
− | It takes a long time for large maps. I could optimize it some by having it try to get a big section at once, then | + | It takes a long time for large maps. I could optimize it some by having it try to get a big section at once, then if it fails, break it into smaller pieces and recurse. I'm not sure when/if I'll get around to that... |
dlOSM.sh: | dlOSM.sh: | ||
<pre> | <pre> | ||
− | + | #!/usr/bin/python | |
− | + | ||
− | + | import os | |
− | + | import sys | |
− | + | #import math | |
− | + | ||
− | + | def doIt(cmd): | |
− | + | os.system(cmd) | |
− | + | ||
− | + | def getOsms(basename, minLat, maxLat, minLon, maxLon): | |
− | + | '''basename - base name of map, maps are named {basename}{count}.osm | |
− | + | minLat - latitude of the west side of the map | |
− | + | maxLat - latitude of the east side of the map | |
− | + | minLon - longitude of the north side of the map | |
− | + | maxLon - longitude of the south side of the map''' | |
− | + | ||
− | + | wgetCmdTemplate = 'wget -O %s%s.osm http://api.openstreetmap.org/api/0.6/map?bbox=%s,%s,%s,%s' | |
− | + | ||
− | + | currLat = minLat | |
− | + | mapCount = 0 | |
− | + | while currLat < maxLat: | |
− | + | nextLat = min(currLat + 0.1, maxLat) | |
− | + | ||
− | + | currLon = minLon | |
− | + | while currLon < maxLon: | |
− | + | nextLon = min(currLon + 0.1, maxLon) | |
− | + | ||
− | + | doIt(wgetCmdTemplate % (basename, mapCount, currLon, currLat, nextLon, nextLat)) | |
− | + | ||
− | + | currLon = nextLon | |
− | + | mapCount = mapCount + 1 | |
− | + | ||
− | + | currLat = nextLat | |
− | + | ||
− | + | (minLat, maxLat, minLon, maxLon) = map(float, sys.argv[1:]) | |
− | + | getOsms('map', minLat, maxLat, minLon, maxLon) | |
− | + | ||
− | + | ||
− | + | ||
</pre> | </pre> | ||
+ | |||
+ | <onlyinclude> | ||
+ | {{ApplicationBox| | ||
+ | Name=[[Navit]]| | ||
+ | Description=Navit is a car navigation system with routing engine.| | ||
+ | Screenshot=Screenshot-3.png| | ||
+ | Homepage=http://navit.sourceforge.net| | ||
+ | TestedOn=| | ||
+ | PackageName= | ||
+ | }} | ||
+ | </onlyinclude> | ||
+ | |||
+ | [[Category:GPS Applications]] |
Latest revision as of 15:05, 2 August 2011
Navit is one of the applications that runs on the Openmoko Phones. For a list of all applications, visit Applications
As described on the Navit home page,
"Navit is a car navigation system with routing engine.
Its modular design is capable of using vector maps of various formats for routing and rendering of the displayed map. It's even possible to use multiple maps at a time.
The GTK+ or SDL user interfaces are designed to work well with touch screen displays. Points of Interest of various formats are displayed on the map.
The current vehicle position is either read from gpsd or directly from NMEA GPS sensors."
Some people say Navit is also a good choice for pedestrian and bicycle navigation.
Contents |
[edit] Acknowledgment
Thanks to Alessandro, stefan_schmidt, cp15 and all Navit developers I have done a small ("not really working") preview of Navit on Neo1973 at Telemobility Forum 2007. Thanks to GFoss guys to invite me. Tyrael
[edit]
[edit]
[edit] Map Size
Of you use e.g. entire Germany in an rectangle form it will have more than 500MB. Navit on FR works with maps in the size of less that 350MB. So split the larger areas in portions with a smaller size than 350MB. Otherwise Navit will not be able to process the maps.
Change navit.xml to modify the used map bin-file, e.g. germany1.bin to germany2.bin
[edit]
You can now simply add a feed from there : http://download.navit-project.org/navit/openmoko/svn/
Essentially, to enable this directory as feed and install or update navit do:
- Only for the first time:
echo src navit http://download.navit-project.org/navit/openmoko/svn > /etc/opkg/navit-feed.conf opkg update
- Always:
opkg install navit
Navit will be auto-updated when you run opkg upgrade later
Navit might not be able to use gpsd at startup:
navit:plugin_load:can't load '/usr/lib/navit/vehicle/ libvehicle_gpsd.so', Error 'libgps.so.16: cannot open shared object file: No such file or directory' navit:vehicle_new:invalid type 'gpsd'
to solve this issue (necessary for SHR):
opkg install libgps17 ln -s /usr/lib/libgps.so.17 /usr/lib/libgps.so.16
[edit]
Navit is now (01.08.2011) in Debian stable, testing and unstable.
Add the following line to /etc/apt/sources.list with e.g. editor vi or nano:
deb http://ftp.de.debian.org/debian stable main
Then update with apt-get:
apt-get update
The up-to-date source package is available through git at git://git.debian.org/git/collab-maint/navit.git (browse).
[edit]
Download current version navit-current.apk on your Android. See Android usage for installing Apps on your Android on Freerunner.
see Navit on Android Navit Project Wiki
You can use one download map which you have to copy on the FAT32 partition of your SD card as navitmap.bin.
During first use after installation, navit for android will ask you, if you want to intall TTS (Text to Speech festival-lite). If you decide to install TTS then Navit crashes (with version navit-svn-3495.apk).
[edit]
You can find some information for installing Navit in the QtMoko article.
[edit] Set up the maps you want
[edit] The Easy Way
Use Navit Map Extractor based on OpenStreetMap. Navigate to the region you want, and click "select" to select region, select the area you want, then click download.If you just want the entire planet (as of this writing, ~1.8 GB), it's here.
CloudMade also has up-to-date maps from OpenStreetMap by country (by state in the US).
NOTE: Be aware of the map size that can be used on your FR (On Android working with map sizes less than 350MB is O.K. on SHR 450MB also work, so SHR may not have a map size limit) |
[edit] From the command line
OpenStreetMap - follow directions at http://wiki.navit-project.org/index.php/OpenStreetMaps
- There are some pre-processed, up-to-date maps that can be grabbed with wget:
wget -O germany.bin http://maps.navit-project.org/api/map/?bbox=5.185546875,46.845703125,15.46875,55.634765625
You can put a shell script into /usr/local/bin/update-maps
#!/bin/sh echo "Update OpenstreetMaps" echo "---------------------" echo " download and store OSM maps on /media/card/maps" wget -O /media/card/maps/germany.bin http://maps.navit-project.org/api/map/?bbox=5.185546875,46.845703125,15.46875,55.634765625 echo "update germany.bin finished"
You have to make the script executable with:
chmod u+x /usr/local/bin/update-maps
Create a maps-directory (e.g. with path /media/card/maps/) on your SD-card:
mkdir /media/card/maps/
Then you can update with this script all your maps on the SD-card if you have internet connection:
update-maps
- Here's an example to get the maps for the area around Seattle, WA:
- Find the map coordinates using http://informationfreeway.org/?lat=47.520270037501454&lon=-122.20130713167327&zoom=9&layers=B000F000
- Download 4 regions from OpenStreetMaps (see below for a script to do this for you automatically for largish areas):
wget -O map1.osm http://www.openstreetmap.org/api/0.5/map?bbox=-122.2,47.5,-122,47.7 wget -O map2.osm http://www.openstreetmap.org/api/0.5/map?bbox=-122.4,47.5,-122.2,47.7 wget -O map3.osm http://www.openstreetmap.org/api/0.5/map?bbox=-122.4,47.3,-122.2,47.5 wget -O map4.osm http://www.openstreetmap.org/api/0.5/map?bbox=-122.2,47.3,-122,47.5
- A binary Navit map file needs to be created. The following uses osm2navit, and it's recommended that this command be used on something more powerful than the Neo:
cat *.osm | osm2navit --dedupe-ways mymap.bin
[edit] Copy the map to the NEO
To copy the map using scp (replace /directory as is appropriate in the following):
scp mymap.bin root@neo:/directory
If you copy the map germany.bin to the SD card on the Neo use e.g. in the directory maps:
scp germany.bin root@neo:/media/card/maps
Once it's somewhere on the NEO, Navit needs to know that it's there.
mkdir ~/.navit cp /usr/share/navit/navit.xml ~/.navit/navit.xml vi ~/.navit/navit.xml
note that in some version navit includes other xml files from /usr/share/navit, for instance mapsets are now defined in maps.xml.
[edit]
Now you must let Navit know the maps you want to use. Several disabled mapset-tags are predefined. In the navit.xml file, put the following into a new <mapset> section (and disable the default <mapset> just above - or else it will not work):
<map type="binfile" enabled="yes" data="/directory" />
For example with a germany.bin on the SD-card you use:
<mapset enabled="yes"> <map type="binfile" enabled="yes" data="/media/card/maps/germany.bin" /> </mapset>
or if you store all downloaded maps in the directory /media/card/maps then add the following lines to navit.xml.
<mapset enabled="yes"> <map type="binfile" enabled="yes" data="/media/card/maps/*.bin"/> </mapset>
NOTE: this will only load the first map that machtes *.bin (its a bug/feature)! |
NOTE: that the bin-file and the map set both have to be enabled |
Disable unused mapset sections by setting enabled to no, e.g. the pre-installed sample maps at line 370 in navit.xml.
<mapset enabled="no"> <xi:include href="$NAVIT_SHAREDIR/maps/*.xml"/> </mapset>
- The version of osm2navit with which you build the maps should match the version of navit you have. If in doubt, build the maps on the Openmoko.
[edit] Tips and Tricks
[edit] Center on Vehicle
Navit supports a "always center on vehicle" option.
To activate this add
follow="3"
to the vehicle tag in navit.xml.
<vehicle name="Local GPS" profilename="car" enabled="yes" active="1" follow="3" source="gpsd://localhost" gpsd_query="w+xj" color="#0000ff">
The "3" causes to give the gui time to do something between the repaints (drag the map or browse the menu). When its set to "1" navit does nothing more than repainting the map continuously.
[edit] Localize for Germany
- SHR German from freeyourphone.de
- Go to Configure_SHR_for_German-speaking_use download
http://work.zoff.cc/openmoko/shr/de_at/customize_pack_shr_no_maps.tar.gz
- extract init_shr_testing.sh and see what zoff99 did to customize navit for German speaking. Search for glibc and navit in localization script for understanding the steps to be perform on your freerunner.
- Speech Languagefor more details.
- you can adapt these steps for other languages by replacing der_DE respective de parts to your favorite language setting.
http://wiki.openmoko.org/wiki/Navit#Speech
[edit] Routing
The main menu has 4 submenus
- Action
- Settings
- Tools
- Route
Normally you would assume the entering a town can be found under the submenu Route, but Town is hidden under submenu Action. Route will provide the description of the route as text and a height profile of your trip. Tools was not working on 08/2009 Version of navit on SHR (see SHR User Manual).
[edit] Preselect Country of Destination
Normally you have to select the the country first before choosing the town and street name. It might be more convenient for you if you preselect the country already with your settings. The article Configure SHR for German-speaking use had a preselection of the country "Austria" in Navit. Adapt the localization for your country and maps in Navit, so that do not need to select the country anymore.
Actually Navit derives the preselected country from the calling environments's locale (see Localization). Make sure, that LC_ALL ist not set though. Otherwise navit fails to interprete gpsd output and you end up with strange gps coordinates. When starting from gui (e.g. illume) you can achieve this by supplying an executable script /usr/local/bin/navit which might look like this:
#!/bin/sh #export LANG=xx_YY.UTF-8 # Uncomment this line and replace xx_YY, if # your gui's locale is not setup accordingly. unset LC_ALL exec /usr/bin/navit
So a valid locale environment preselecting search for German cities would look like this:
root@om-gta02 ~ $ locale LANG=de_DE.UTF-8 LC_CTYPE="de_DE.UTF-8" LC_NUMERIC="de_DE.UTF-8" ... LC_MEASUREMENT="de_DE.UTF-8" LC_IDENTIFICATION="de_DE.UTF-8" LC_ALL=
Note that there's a limited number of countries supported by osm2navit and Navit's search function.
[edit] Select Destination
You can the select your destination in the main menu:
- via Bookmarks, if you saved the previous location or
- via Town, if you want to enter a new destination. If you use a destination more frequently, just save the location as bookmark.
When you click in the main menu on Action the Action menu appears with 4 subitems.
- Bookmarks of previous locations (stored in /home/root/.navit/destinations.txt
- a globe showing a location as destination,
- a vehicle that shows the current GPS position of the vehicle. If the freerunner receives no GPS signal the locations of the vehicle is set to 0.0.0N and 0.0.0E.
- Town is the action to enter a destination.
- Quit navit is the last action in this submenu.
Select the icon Town in the main menu (if you see the map, you can get to the main menu just by clicking on the map).
[edit] Select Country
Before you can search for City you have to select a Country. To do that, click on the icon in the left upper corner of the search field (could look like a white square with blue top-left quadrant).
Just type in the first letter of the country (e.g. "G") and Navit makes suggestions (e.g. Gabon, Germany).
[edit] Enter Town
When you have selected the country (e.g. Germany) the flag appears and you can select the town. Then you can save the town as bookmark and enter more details like streets to the selected town.
The search is still a little buggy.
[edit] Enter Street
You can enter the street and streetnumber and save it as bookmark when you use the destination often.
[edit] Bookmarks
Navigation and planning of routes with Navit can be organized with bookmarks.
- set a bookmark as current position
- set a bookmark as destination
Then you can see the suggested route in blue on the map.
Bookmarks are stored in:
/home/root/.navit/bookmark.txt
The GPS-location (if GPS-signal is available) will be highlighted with a small blue circle. The color of the circle can be defined via editing the navit.xml (see select cursor color).
- a dot in the blue circle is indicating that your are not moving,
- an arrowhead is indicating the direction, when you are moving.
Then routing can start and in the map the route is highlighted.
[edit]
The screenshots are made with gpe-scap, that can be installed by:
opkg install gpe-scap
if not installed already. Navigation through your installed application navit and login via ssh on your Freerunner
ssh -l root 192.168.0.202
assuming that your Freerunner has the IP 192.168.0.202. Any time you want to make a screenshot just start via your desktop computer
gpe-scap
and save the screenshot to you freerunner. Download the screenshot to your desktop computer with
desktop# sftp://root@192.168.0.202
[edit] News
A deeper look into configuring Navit can be found in the Navit-Wiki.
[edit] Getting the display right
If using SHR the keyboard in country/town/street search mode does not fit on the street, make sure your gui configuration is set to the following line:
<gui type="internal" font_size="350"/>
The example line provided for freerunners hides some important icons. Namely, instead of typing your city name first, you will first have to click the button on the top left, to go into country search mode. Enter your country name, then the city name, in order to enable the search function. This requires your map data to be searchable.
You can start in fullscreen mode with fullscreen="1"
<gui type="internal" font_size="350" fullscreen="1"/>
If you want to enable "+" and "-" as Zoom-In and Zoom-Out buttons on the bottom of the map enable the button with the following xml-tags:
<osd enabled="yes" type="button" x="-96" y="-96" command="zoom_in()" src="zoom_in.xpm"/> <osd enabled="yes" type="button" x="0" y="-96" command="zoom_out()" src="zoom_out.xpm"/>
You can find sample Layouts here: Sample Layouts from navit-wiki
[edit] Set Cursor Color
If you navigate, the route is marked in blue color on the map. The current position of the vehicle is displayed by a blue circle. The circle is sometimes difficult to see on the blue track. If you want to change the color, size of the vehicle cursor edit the vehicle XML-environment in navit.xml (e.g. replace blue color #0000FF with red color #FF0000 -- for details of Color Codes select color, copy and paste code in navit.xml)
<vehicle name="Local GPS" profilename="car" enabled="yes" active="1" source="gpsd://localhost" gpsd_query="w+xj" color="#0000ff"> <cursor w="56" h="56"> <itemgra> <circle color="#ff0000" radius="42" width="6"> <coord x="0" y="0"/> </circle> <circle color="#ffffff" radius="48" width="2"> <coord x="0" y="0"/> </circle> <circle color="#ffffff" radius="36" width="2"> <coord x="0" y="0"/> </circle> </itemgra> <itemgra speed_range="-2"> <polyline color="#ff0000" width="6"> <coord x="1" y="1"/> <coord x="1" y="-1"/> <coord x="-1" y="-1"/> <coord x="-1" y="-1"/> </polyline> <circle color="#ffffff" radius="9" width="2"> <coord x="0" y="0"/> </circle> </itemgra> <itemgra speed_range="3-"> <polyline color="#ff0000" width="6"> <coord x="-7" y="-10"/> <coord x="0" y="12"/> <coord x="7" y="-10"/> </polyline> <polyline color="#ffffff" width="2"> <coord x="+10" y="-10"/> <coord x="3" y="15"/> </polyline> <polyline color="#ffffff" width="2"> <coord x="-10" y="-10"/> <coord x="-3" y="15"/> </polyline> </itemgra> </cursor> </vehicle>
The following screenshot show Navit with a red cursor on a blue track:
[edit] Speech
Navit can speak if you install eSpeak + speech-dispatcher and updates your navit.xml file.
If you want navit using your language, and setting LC_MESSAGES fails due to missing glibc locale, set the enviroment variable LANGUAGE. For instance running
LANGUAGE=de navit
will set the ui and output to german.
For SHR there is a big german localization patch see Configure SHR for German-speaking use.
One way to configure speech output:
- mokoTTS aims to integrate these packages in OM:
http://projects.openmoko.org/projects/mokotts/
install espeak, dotconf, and then speech-dispatcher. note: running 2008.8 updating from zecke's "testing" repo does not require "dotconf"
[edit] Speech Language
To change the speech tag in navit.xml with speech dispatcher:
<speech type="cmdline" data="spd-say '%s'" />
- "spd-say -l fr '%s'" for using the French voice for example.
- "spd-say -l de '%s'" for using the German voice for example.
NOTE: You can check speech dispatcher output from the shell. |
Example for German:
spd-say -l=de "Dies ist die Winterstraße 23"
The speech-dispatcher is blocking the audio after suspend. So after a suspend you will hear no ringtone, when a phone call is coming in and you cannot listen do audio files. A solution is to disable starting of speech-dispatcher with:
update-rc.d -f speech-dispatcher remove
Then the speech-dispatcher should be started if and only if navit is running and shut down when navit is closed.
Furthermore navit should be started indirect with a script navit.sh instead of a direct start with the binary located in /usr/bin/navit. The script navit.sh listed below starts speech-dispatcher before navit, and stops it afterwards. See http://lists.openmoko.org/nabble.html#nabble-td1088795
The following script is doing the suggested procedure. This script includes a language fix for Austria (see Configure SHR for German-speaking use).
export LANG=de_AT.utf8spd-say --language=de Output-String You can replace the --language by -l }
Replace de_AT in this line with the appropriate language variable in the following script navit.sh.
#! /bin/sh # # Copyright Matthias Hentges <devel@hentges.net> (c) 2008 # License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license) # # Filename: navit.sh # Date: 20080105 (YMD) # ################################################################################# # # 20080105 - v0.0.1 - Initial release # 20090818 - - Zoff <zoff@zoff.cc> addons and fixes # # ################################################################################# ################################################################################# # # On devices with low memory (< 512Mb?) Navit will segfault on start. # This can be worked around by doing # "echo 1 > /proc/sys/vm/overcommit_memory" # ################################################################################# . /etc/profile set|grep LC #### Stop the speech dispatcher #### /etc/init.d/speech-dispatcher stop #### Language Fix ################# set|grep LC export LC_ALL='' unset LC_ALL export LANG=de_AT.utf8 set|grep LC #### Start the speech dispatcher #### /etc/init.d/speech-dispatcher start & set|grep LC # need cpu and display mdbus -s org.freesmartphone.ousaged /org/freesmartphone/Usage org.freesmartphone.Usage.SetResourcePolicy Display enabled if test "`cat /proc/meminfo | grep ^MemTotal | awk '{print $2}'`" -lt "500000" then if test "$USER" = "root" then echo "Enabling low-mem workaround..." echo 1 > /proc/sys/vm/overcommit_memory else echo "I need root-privs to enable the low-mem workaround!" fi fi ######### Start NAVIT NOW ############ navit $* #### Stop the speech dispatcher #### /etc/init.d/speech-dispatcher stop # release cpu and display mdbus -s org.freesmartphone.ousaged /org/freesmartphone/Usage org.freesmartphone.Usage.SetResourcePolicy Display auto
Save the navit.sh script in:
/usr/bin/navit.sh
Make the script executable:
chmod u+x /usr/bin/navit.sh
Now you have to edit the desktop icon, so that it starts this script navit.sh instead of the binary /usr/bin/navit.
nano /usr/share/applications/navit.desktop
Edit the line with Exec=..., so that it starts the script navit.sh instead of the navit binary.
[Desktop Entry] Version=1.0 Name=Navit Name[de]=Navit Name[fr]=Navit Comment=The open source vector based navigation program with routing engine Comment[de]=Ein vektorbasiertes Navigationsprogramm Comment[fr]=Le logiciel opensource de navigation vectorielle Exec=/usr/bin/navit.sh Icon=navit StartupNotify=true Terminal=false Type=Application Categories=GTK;Utility;Geography; GenericName=Navit GenericName[de]=Navit
Alternatively, you can make speech-dispatcher restart on resume, see http://trac.shr-project.org/trac/ticket/494
[edit] Script to download OSM maps
Wurp wrote a little python script to download all OSM maps within a lat/long rectangle. Just copy the script to a file called dlOSM.sh, chmod +x it, and run it like dlOSM.sh <minimum latitude> <maximum latitude> <minimum longitude> <maximum longitude>
It takes a long time for large maps. I could optimize it some by having it try to get a big section at once, then if it fails, break it into smaller pieces and recurse. I'm not sure when/if I'll get around to that...
dlOSM.sh:
#!/usr/bin/python import os import sys #import math def doIt(cmd): os.system(cmd) def getOsms(basename, minLat, maxLat, minLon, maxLon): '''basename - base name of map, maps are named {basename}{count}.osm minLat - latitude of the west side of the map maxLat - latitude of the east side of the map minLon - longitude of the north side of the map maxLon - longitude of the south side of the map''' wgetCmdTemplate = 'wget -O %s%s.osm http://api.openstreetmap.org/api/0.6/map?bbox=%s,%s,%s,%s' currLat = minLat mapCount = 0 while currLat < maxLat: nextLat = min(currLat + 0.1, maxLat) currLon = minLon while currLon < maxLon: nextLon = min(currLon + 0.1, maxLon) doIt(wgetCmdTemplate % (basename, mapCount, currLon, currLat, nextLon, nextLat)) currLon = nextLon mapCount = mapCount + 1 currLat = nextLat (minLat, maxLat, minLon, maxLon) = map(float, sys.argv[1:]) getOsms('map', minLat, maxLat, minLon, maxLon)
![]() |
Navit
Navit is a car navigation system with routing engine.
|