[ English | 简体中文 ]
“X-TRACK Demo” comes from the open source project X-TRACK. Thanks to the original author of X-TRACK, FASTSHIFT, the migration is completed.
It’s a bike computer with features like speed display, distance statistics and real-time track display, with a display resolution of 240x320 pixels, using touch screen interaction.
The code directory is located at: “apps/packages/demos/x_track”
This article describes how to run the example on openvela Emulator.
-
Set up the development environment. Refer to Environment Setup.
-
Download the source code. Refer to Download openvela source code.
-
Switch to the root directory of openvela repository and run the following command to start compiling and configuring the project:
./build.sh vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap menuconfig
-
Modify the following configurations in order.
LIB_PNG = y LV_USE_LIBPNG = y NETUTILS_CJSON = y UIKIT = y UIKIT_FONT_MANAGER = y LVX_USE_DEMO_X_TRACK = y
How to enable “LIB_PNG” configuration is shown as an example. Other configuration operations are the same.
-
Press the “/” button on the keyboard to enter the search mode, type “LIB_PNG” in the search field, use the arrow keys to move the cursor to “LIB_PNG”, and press Enter to confirm.
-
Press the “space bar” for the “Enable libpng” option to turn this option on, and a * that appears in [ ] indicates that this configuration is turned on.
-
The other configurations are turned on in the same way.
-
-
Run the following command to start compiling.
# Clean up build artifacts ./build.sh vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap distclean -j$(nproc) # Start to build ./build.sh vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap -j$(nproc)
-
After successful compilation, the following files are generated in the "nuttx" directory.
./nuttx ├── vela_ap.elf ├── vela_ap.bin
-
Switch to the root directory of openvela repository and start the emulator:
./emulator.sh vela
-
Push resources to the device by using emulator-supported ADB. Open a new terminal in the root directory of openvela repository, type “adb push” followed by the file path to transfer the resources to the appropriate location.
# Install adb sudo apt install android-tools-adb # Push resources adb push apps/packages/demos/x_track/resource/font /data adb push apps/packages/demos/x_track/resource/images /data adb push apps/packages/demos/x_track/resource/track /data
-
To enable the “X-TRACK” program, enter the following command in the emulator's terminal environment “openvela-ap”:
x_track &
-
This happens after execution:
The three function buttons below are used for jumping to different function pages:
-
Motion tracking page
The bottom left corner of this page shows the general information of the current movement. The middle part shows the current movement direction and the past trajectory. You can swipe right to return to the previous page.
-
Shutdown page
This page mimics the shutdown page of a mobile phone. Hold and drag the yellow scroll bar up to the end and then release it to turn off the machine. Click somewhere or swipe right to return to the previous page.
-
System information page
This page shows detailed system information. Swipe up or down or click the corresponding icons to see different information. Swipe right to return to the previous page.
Shut down the emulator to exit Demo, as shown below:
The "adb" tool is not installed.
Install “adb” and execute the following command:
sudo apt install android-tools-adb
Font resources are not loaded correctly.
Follow Step 3 to push resources.
Due to the copyright issues for commercial maps, maps can’t be provided. Only the track display function is available.
With significant adjustments to the code of the original version, this demo is somewhat different in respect of function and display.
This is normal because the battery level on an emulator is just randomly simulated.
Yes. It accesses a GPX file for track replay and simulates GNSS to generate data.
Rename your track file (GPX format) as “TRK_EXAMPLE.gpx”, and push it to the “/data/Track” directory with the “adb” tool.