How to simulate live updates for Trips and Mileage?

August 7, 2023
Testing and debugging applications that incorporate live vehicle data can pose significant challenges. One notable hurdle arises from the fact that the test object, a connected car, is decoupled from the test environment. However, addressing this concern, High Mobility has recently unveiled a novel feature that enables the direct simulation of both short and long distance trips, all accessible directly from a web browser.

Generate Trip Data using our Simulation Studio

Within the High Mobility Simulation Studio, developers and engineers are able to manipulate each individual data point provided by collaborating brands. This empowerment facilitates thorough testing of the integration process. 

Trip recordings, which encompass updates regarding vehicle location and mileage, serve as indispensable components within fleet management tools, digital logbook solutions and offerings related to connected insurance. Since real vehicles do not update data points in a sporadic manner we have introduced an innovative simulation feature tailored to streamline the process of generating sequential test data. This enhancement ensures a more coherent and representative simulation of real-world scenarios, contributing to a more reliable testing environment.

In order to start simulating trips with our vehicle emulator, we are recommending going through each of the following steps. Every underlying aspect will be explained in more detail both in the video of our 12th Open Dev Talk and this blog post.

  • Create a new simulator
  • Add a new simulation
  • Generate trip data via GeoJSON
  • Replay and adjust simulation

Setting-up a car simulator

To access our High Mobility platform, you can either register for free or log in to your existing account. Once logged in, navigate to the "Simulation studio" section, where you can create a new car emulator.

During the creation process, you will have the option to designate whether the virtual car is privately owned or part of a commercial fleet. This choice influences the availability of data points per brand, although it does not impose any restrictions on the functionality of the trip simulation feature itself.

The trip simulation feature seamlessly integrates with previously generated car simulators. This compatibility ensures that you can apply the simulation to car simulators you have already used. Moreover, the platform also supports parallel simulations of trips, allowing you to initiate identical or distinct trips using multiple virtual vehicles. This flexibility permits the creation of numerous car simulators, each equipped with its own unique virtual Vehicle Identification Number. 

Managing all these car simulators is made convenient through the centralised Simulation Studio module, which provides a full overview of all created simulators at any time. With the help of the Scenes feature brands can be changed with just a click and by adjusting the Simulator ID at the top of the console the name can be freely changed to facilitate identifying the selected virtual car. 

Managing stored simulations

To initiate a new simulation, access your simulator and navigate to the simulations menu. Upon reaching this section, the view will either be empty if you've never created a simulation before or display a list of existing trips. For each trip, you will find details such as its name, description, and an estimated duration for completing the simulation.

Every simulation, whether previously established or freshly created, can be easily managed from this overview as you can initiate, rename, or delete simulations directly from here. In case of a shared workspace, simulations will be visible to all team members, promoting seamless collaboration.

To personalise and introduce a new simulation, simply click on the "Create new" button. This action will enable you to specify a simulation name and provide a descriptive overview of the trip. This information aids in better identification and recollection of past configurations.

Once the simulation is generated, the editing view presents a JSON snippet on the left side and a corresponding map view on the right side. Situated in the middle of this layout, you will find a toolbar that facilitates tasks such as saving, copying, and pasting the configured trip data.

Furthermore, it allows for manual adjustments to the frequency of data generation updates. The corresponding dropdown menu lists various frequency options, aligning with the update intervals offered by OEMs and the real-world vehicles. For a comprehensive understanding of these frequencies, you can consult our data catalogue. However, it's important to note that we've intentionally maintained flexibility regarding the frequency selection. In contrast to the Scenes menu, frequencies are not rigidly tied to specific brands in order to grant developers more freedom and adaptability throughout the testing and simulation process.

Generating trips visually using GeoJSON

High Mobility's trip simulation feature is underpinned by the open protocol GeoJSON, a common format used when working with geographic data structures. This format has extensive support from a diverse array of tools available in the industry. An exemplary illustration of such a tool is geojson.io, a platform that enables users to visualise trips on a map and subsequently generate the corresponding GeoJSON data structure.

Within GeoJSON, a versatile assortment of drawing tools is at your disposal, all compatible with the format. We have initially chosen to support the LineString tool, owing to its straightforward nature and efficiency in swiftly outlining a car's route. Additional tool support may be introduced in subsequent updates.

Using GeoJSON.io, you can leverage the search bar to automatically zoom in on your intended trip starting point. Subsequently, applying the LineString tool empowers you to redraw the desired route for the virtual car. Each plotted step on the map signifies a data point update, which forms the foundation of the information supplied via our connected car API.

Upon selecting the final waypoint and concluding the route design, the web application generates the GeoJSON structure. This structure then needs to be pasted into the code pane of the simulator. After having saved the changes, the view will refresh and dynamically showcase all location updates on the map. This interactive representation enhances your ability to comprehend and evaluate the simulated trip's progression.

Play and adapt simulated trips

As soon as you hit the play button, the High Mobility simulator will generate trip updates encompassing the geolocation and odometer data points. The odometer data point is an automated approximation, calculated based on the initial value preset within the car simulator. Ignition start and stop events are also dispatched, marking the commencement and conclusion of each simulated trip.

For real-time monitoring of all data value modifications, you can conveniently inspect the changes using the console view located below the main view. To regulate the pace at which subsequent data point updates are generated, you can modify and adjust the corresponding frequency dropdown menu. This feature proves particularly useful when assessing data consumption during extended trips that mirror real-world conditions.

The data point update stream can be consumed through our MQTT Broker or AWS S3 integration. Alternatively, data snapshots can be requested via pull APIs.

Even during active simulation playback, all other data points can be manually manipulated through the Capabilities module. All data point updates are consequently propagated to the data feed.

One noteworthy advantage of simulated trips is the capability to execute them in the background. Even if the browser window is closed, new data point updates will continue to be generated. This feature proves advantageous when testing extended trips or validating the stability of multiple vehicles concurrently transmitting data.


-------------------------------
High Mobility Open Dev Talks 

At High Mobility, we are passionate about new technology. We offer free open source tools and developer friendly documentation for any projects to be integrated smoothly. More than 800 developers and product managers have already signed up for our moderated community platform and we are hosting connected car competitions for your innovative, connected car ideas. 

Join our community on Slack

Read Next