Dev tips

Feeding your AAOS Emulator

Learn how to use RemotiveLabs tooling to inject recorded vehicle data into your Android Automotive OS emulator. Test your apps in a realistic environment, collaborate seamlessly and skip the need for physical hardware—all in just a few steps.

How to feed your AAOS Emulator with real vehicle data
December 5, 2024
Ola Nilsson
Infotainment

Share

Fake Cars, Real Signals!

Integrating recorded vehicle signal data into the Android Automotive OS (AAOS) emulator can significantly enhance the development and testing of your Android Automotive applications. By utilizing RemotiveCloud and RemotiveBroker from RemotiveLabs, developers can inject authentic vehicle data into the AAOS Emulator, facilitating a more realistic and efficient development environment.

Understanding the tools

  • RemotiveCloud: A collaborative platform that allows users to upload, share, visualize, and stream real vehicle signal data. It enables seamless collaboration among teams by providing access to authentic vehicle data without the need for physical hardware.
  • RemotiveBroker: A software ECU that reads and writes to most vehicle buses supporting automotive protocols. It serves as a versatile developer tool for tasks such as prototyping new ECUs, driving verification by providing stimuli, and simulating parts of the vehicle architecture.

4 simple steps to feed recorded signal data into AAOS Emulator

This guide will take you through the 4 simple steps required to send location data from a recorded drive cycle in RemotiveCloud to an AAOS Emulator. To set any VHAL properties you want, check out this more advanced example.

Prerequisites

  • A free account in RemotiveCloud, create it here
  • Git, download it here
  • Android Studio, see step 1
  • Python 3.x, see this guide

Step 1. Configure and start the AAOS Emulator

  • Download and install the Android Studio Preview version here to access the latest AAOS Emulator. Ensure that you select an appropriate system image that supports the necessary features. For example, if your machine is ARM-based, you can use the “Automotive 12L with Play Store ARM 64 v8a System Image,” which is a user build with Google Automotive Services (GAS).
  • Start Android Studio
  • When inside the Android Studio application, go to Projects in the sidebar menu and on the main page select More Actions -> Virtual Device Manager
  • In the Virtual Device Manager, press the plus icon in the top left and then select Automotive in the category table to the left. Select whatever device you want and finish the guided setup.

Step 2. Clone our AAOS Emulator integration repository

Clone our remotivelabs-android-emulator repository from GitHub and install the required Python dependencies by running the command below.

$ git clone git@github.com:remotivelabs/remotivelabs-android-emulator.git
$ cd remotivelabs-android-emulator
$ pip install -r requirements.txt

Step 3. Connect RemotiveCloud to your AAOS Emulator

With the emulator running, execute the provided Python script br_location_to_emu.py to connect the RemotiveBroker that is running in RemotiveCloud to the AAOS Emulator. This script will stream the latitude and longitude signals from the recorded data into the emulator, allowing applications within the emulator to process real-world location data.

  • Either set the environment variables or replace $REMOTIVE_BROKER_URL and $REMOTIVE_BROKER_API_KEY in the command below with the credentials obtained from RemotiveCloud.
  • Run command:
$ python3 br_location_to_emu.py --url $REMOTIVE_BROKER_URL --x_api_key $REMOTIVE_BROKER_API_KEY --namespace android --signal LATITUDE --signal LONGITUDE

Step 4.  Select recording to feed into your AAOS Emulator

Now that everything is prepared, we are ready to select what recording data to feed into the AAOS Emulator. In this example we will use the sample recording City drive to Turning Torso

  • Go to Recordings in the side bar menu and select City drive to Turning Torso in the list. N.B If you don’t see the City drive to Turning Torso recording, you can import it by clicking the import icon in the upper right corner of the recordings page.
  • Once the recording details page has loaded, you will be on the Playback tab. Change the signal transformation from default to configuration_android to send VHAL properties instead of CAN signal data. 
  • Simply press Play and check your AAOS Emulator to see the magic happen!

Benefits of this integration

  • Realistic Testing Environment: By feeding authentic vehicle data into the AAOS Emulator, developers can test applications under conditions that closely mimic real-world scenarios, leading to more robust and reliable software.
  • Hardware Independence: This setup eliminates the need for physical vehicle hardware during the initial stages of development, reducing costs and accelerating the development process.
  • Enhanced Collaboration: RemotiveCloud facilitates seamless sharing of vehicle data among team members, promoting collaborative development and efficient debugging.

By leveraging RemotiveCloud and RemotiveBroker, developers can create a comprehensive and efficient development environment for their AAOS applications, ultimately leading to higher-quality automotive software solutions.

See more AAOS and AOSP use cases under the Android Automotive Applications page.