The Development of E-Bike Navigation Technology Based on an OpenStreetMap

Abstract Currently, most E-Bike services rely on networks to complete the real time and turn-by-turn navigation. However, some users or situations without network may experience trouble in relation to navigation. Hence, our aim is to develop a low cost navigation system with offline and turn-by-turn navigation services. OpenStreetMap (OSM) is a collaborative project whose goal is to create a free editable map of the world. This means that the combined maps need to be more detailed than Google Maps. While Google Map is free to download and use, its offline functionality is restricted. Users cannot perform any searching or routing tasks without an internet connection, which means that when they are abroad or in low signal areas they either have to pay expensive roaming costs or spend a significant amount of time without map coverage, limiting its usability while traveling. For many developers, OSM has become a clear alternative to Google Maps. We used OSM-based Skobbler software to develop our navigation system. Google Maps Place APIs were also included in the system to help users search for nearby well-known places or stores.


Introduction
In recent years, with the proliferation of smart mobile devices, mobile applications have grown rapidly on Google Play and Apple Store [1]. Its usage in regard to electric bicycles has also become more sophisticated. Users can use E-Bike APP (hereafter APP) directly through Bluetooth transmission to adjust the various motor parameters of E-Bikes, including torque and acceleration curve. Smart mobile devices, which have built-in GPS cellular network services, are suitable for replacing the traditional E-Bike display instrument.
Although the E-Bike APP has integrated a navigation service, it only provides a simple navigation function and lacks complete offline navigation resources [2][3][4][5]. It requires a long period of time to update nearby information through the network to navigate as desired. However, a user with no network and who is unfamiliar with the local area can experience problems. If users rely on third-party software, such as Google Maps and Here Map, switching the APP to the third-party software is an inconvenience and will not provide the current battery status and speed of the electric bicycle. In order to overcome these problems, the E-Bike APP should have the function of controlling the electric bikes, and also provide an offline navigation service. In addition, when users have the internet function, they should be able to use Google CONTACT chia-chi chang ccchang@cyut.edu.tw, ccwei@cyut.edu.tw the pairing, the packet from the controller will be sent to the APP for analysis. One column of the packet is the Modbus CRC-16 (Cyclic Redundancy Check) encoding; it can determine whether the packet is damaged or if the controller itself is functioning abnormally [15,16]. If no problems are evident in the packet, the APP will display the status values for the E-Bike, and can change the controlling parameters of E-Bike. Actually, the APP cannot directly issue instructions to the controller, but when the controller asks the APP device, it can supply the instructions, as shown in Figure 2.
Currently, available map customizations on the market have become quite extensive, for example, the famous Google Map Engine. This is available to developers to set their style. In this paper, the graph framework is based on OSM. Then, through the free SDK suite provided by Skobbler, .so, .zip, and .jar files can form a customized map, as shown in Figure 3. A zip compression file was used to load OSM map-related configurations, such as landmarks, map images, text packets, POI pictures, voice packets, and so on. The .so file was used to solve the problem of maps zooming out of the frame. When users zoom in on the map on the OSM, the fluency can be significantly inadequate and will not reach the update frequency of 60 fps, which will negatively affect the user's experience. Incorporating the Native Development Kit (NDK) of an Android allows us to directly use the C and C++ code when the APP uses OpenGL ES to draw the image, thus avoiding the use of Android's Java API [17,18]. In addition to solving the cumbersome problem of transforming Java to C syntax, we also actually prevented opening the JVM to improve performance, thus avoiding memory leaks (OOM) [19]. Finally, the fluency of the operating map was corrected (for ×86 or ARM-based mobile devices). The Skobbler API provides the .jar file as an offline navigation module. Developers do not need to spend a lot of Search as an aid to access locally relevant information on important features in their vicinity.
OpenStreetMap (OSM) is a free world map for anyone to edit, as well as an inexpensive mobile device navigation solution [6,7]. OSM has a broad range of users in different areas, while focusing on the collection of updated local data and live data [8][9][10][11]. This not only greatly increases the speed of data collection, but also allows land data to be efficiently digitized.
Skobbler APIs are based on architecture developed by OSM, with an efficacious offline turn-by-turn navigation technology. They provide free voice packets as well as geographic packages compatible with custom map images and custom points of interest [12,13]. The procedure is flexible, allowing users to expand or change the geographical information, regardless of the IOS or Android platform for any supported versions. In this paper, location searching is based on the Google web service. Google Maps Place APIs provide more than 100 million locations with detailed information to help users search for and locate local businesses and points of interest, while adding locally relevant information or street view images [14].
This paper uses the Android App as the primary development platform, and discusses how to build the Skobbler OSM map structure and how to implement the offline navigation services in the APP provided by Skobbler geographic packages.

Framework
The system is divided into three parts: the E-Bike controller, offline navigation based on Skobbler OSM and location searching based on Google Maps Place APIs, as shown in Figure 1.
First, The APP will provide Bluetooth matching with the electric bicycle controller. After the completion of time to build it and can freely edit map navigation events, environmental triggering and other complex operational processes.
Skobbler offers free offline geo-packages that can be downloaded through the APP and server requests with their validated Skobbler API key. When the user first enters the download page, the APP will pre-request the server to download the XML file. The file shows which countries have offline geography package resources available, and then displays the list to users so that they can make a choice. Offline geo-packages are made up of skm files, txg files, and POI text files (ngi, ngi.dat files, etc.). When the APP is offline, offline navigation is available through offline geography packages.
Google Places API Web Service is the primary location search. Google Places APIs are subdivided into nearby location search, text search, and radar search. We mainly operate the search engine in areas close by. Latitude and longitude, distance range and other geographical information constitute the URL string. Communicating with the server through the internet and web, the server will use the JSON format to provide users with rich information about the site, video navigation, addresses, contact details and various service locations. Some advanced search options, such as car parking lots or food services can also be explored. In addition, searching the location name supports the phone's default language. The APP does not need to judge the language of the country to query, thus reducing difficulties in the translation of names. With the Google Maps Android API, the APP also provides street view services with a 360-degree view, making the users feel as if they are going to an address on the map and providing meaningful content about the destination or any point of interest [20].
Our system provides a service that records the user's ride track. The mobile APP records the status and values of the user who is riding and converts them into a gpx format. A user can simply register with the system by providing his/her Google account. After registration, the mobile APP communicates with the server over the internet using the HTTP protocol via the mobile network and Wi-Fi. The data contain the electronic bicycle's associated values and geocodes via the PHP script running in the Apache server, we can store the data in the MSSQL database. The user's trips are shown using a web interface, where the user can view individual trips on a map. The APP needs to reduce the number of times the record is updated to keep power consumption low. Every 30 s, if the GPS accuracy is higher than 500 meters, the APP records a geographic node increasing the phone's battery life.

Experiment
Based on the above framework, we have implemented a navigation structure based on OSM Skobbler on an Android platform. The APP has also been successfully uploaded to the Google Play store for users.

Electric Vehicle Control Interface
We use the APP with a Bluetooth function to retrieve E-Bike information and to send the data to the controller of the electric bicycle. After matching and confirming the communication code's abnormality, the main screen of the APP is brightened to alert the user that the APP controller has obtained the appropriate information, as shown in Figure 4. The user can then direct the controller to change the motor torque, acceleration curve and the primary values of the relevant E-Bike parameters. In the set mode, we can check the communication code received by the APP, so that the developers can effectively test whether the controller is damaged. Consequently, developers can reduce the redundant debugging time. Figure 5 shows a screenshot of an Android APP. The APP can set relevant parameters for the E-Bike controller, such as acceleration curves, speed limit, torque, motor pulse, external sensor, and more; it is convenient for users to change.

Custom Map and Turn-by-turn Navigation Services
In Figure 6, the OSM shows the POI node in detail, but in the metropolitan area this can be very messy. The    customized map is based on a simple interface. When the map is enlarged, the map shows the complete POI information, making it easy for the user to read.
When users use the navigation service and the network is connected, the APP will continue to update road traffic information to the server at any time so that the user can keep abreast of road conditions. When entering a remote or isolated area, users can download the geography package, as shown in Figure 7. The APP will calculate the route through the offline geography package and provide complete offline turn-by-turn voice guidance, as shown in Figure 8.

Geographic Search Service
When the network is connected, the user can use the Google Place API's service to find nearby attractions and stores. Clicking the marker will display the store's details for reference, as shown in Figure 9. A 360-degree view of street view helps the user understand the area. Figure 10 shows a screenshot of street view.

Conclusion
In this paper, we proposed the OSM-based Skobbler platform that was implemented in the E-Bike APP. The offline navigation service provides a great deal of convenience. The OSM framework makes the map more flexible. The map can be combined with the bicycle lanes in the area, so that the route can be clearer for riders. Through Google's ability to provide attractions and business information in nearby areas, people who love to travel can become familiar with the local culture faster.

Disclosure Statement
No potential conflict of interest was reported by the authors.