Lamborghini AR Project

Spark Emerging Technogies

For my first semester I decided I wanted to gain first hand experience in the augmented reality industry. As a result I approched SPARK EMERGING TECHNOLOGY LAB who are the UK's leading augmented reailty agency, and I have been a huge admrier of theirs over the last couple of years within the AR agency.

Brief

Being an intern in SPARK, my role was to undertake AR projects that the developers did not have time to build/ update. My second project I undertook was to update Spark's Lamborghini Augmented Reality demonstration from it's previous build in Vuforia and update it to the latest build of AR foundation. The project would then be used to show clients for Spark what they can do.

Documents

  1. NLT 1 Document

Research and identified Problems

Despite the project needing major updating and altering with its UI, physics and basic coding, there was little research that needed to be conducted. However I started to look into how the aventador could be controlled as well as what physics systems could be implemented into the project. I came across Realistic Car Controller on the untiy asset store that enabled the model to have advanced control settings.

In order to input data into the realistic call controller, I start to look into the technical specifications that Lamborghini Aventador have such as the speed to which the gears operate in.

Due to the Lamborghini being built in the 2017 version of Vuforia, application had to be updated to the most recent version of ARFoundation, which would not be simple. The Lambo's physics would have to also be updated as well as intergrating a place to point script and reset script into the application.

The Solution ✅ Development- WEEK THREE 🗓️

I then started to input the data from the technical specifications, into the gear speed of each gear. This is to enable the augmented aventador to get up to the speed that the real version reaches too.

I also imported two other cars from the realistic car controller to compare the speeds to the Lamborghini. The two other cars were a Nissan Skyline and a Dune buggy both of which have very different speeds.

Next I entered in the engine torque, MaxSpeed, Downforce and Shift up RPM that the real Lamborghini has. This will enable the user to feel as if they are driving the real Lamborghini with its real specs, however it will be AR

After adding the data into the Lamborghini, I decided to drag race the three car models to see how the speed compared. As you can see the Lamborghini is quicker off the line than both the Dune buggy and the Skyline. This was good to see as it showed that the data I had inputted, was working. However I felt that the engine torque curve could be adjusted slightly.

I also altered the front and rear axle suspension springs, in order to make the car feel genuine when breaking and stopping, as the car will look forward slightly.

I therefore raised the curve to get to its highest tolerance at 5,000 RPM, with 400 Tourque applied.

Week 4- AR Intergration and Testing

Next I implemented the ARplacetopoint script, which enabled me to integrate augmented reality into the application using AR foundation. The script was initially taken from the Troll and Dragon project, but was updated to work with the Lamborghini. In order for the script to find a flat surface, I used the prexisitng vector two script that divided the screen into 2/2 on the X axis and Y axis to allow for a 3D Cube/ sphere to be placed in the center of the screen.

Next I implemented a scaling script which I located online from Youtube Pinch to Zoom. It allows for the model to be scaled to any size depending on the user's preference. As you can see the public class is 'Pinch ToZoomScript' with 'vector 3' targeted for scale of the model. 'SmoothTime = '0.3f' is the speed to which the model will reach the desired size of the target as a float (real number).

Inside unity after coding the ARplacetopoint script, I attached the 3-D Lamborghini Aventador model onto the Raycast manager.

AR Intergration and Testing

In order to add controls to the application, I added a reset and Aventador place button but I also brought in the Realistic of car controller's UI with the accelerator brake and left and right controls added. I also anchored the placement and reset button to the bottom left of the screen.

I then added a flat plane for the Lamborghini to drive over and on for the initial testing.

After all of the augmented reality scripts and functions had been added, I decided to test the first version outside. As you can see the great plane is still visible as that was the boundary to which the Lamborghini could drive. The Lamborghini successfully turns and drives around: however it disappears near the end of the clip. This was due to the Lamborghini reaching the end of the flat plane. It had then changed its position to inside the hedge where it quickly reversed out in a funny fashion.

Week 5- Scaling Physics problems

After testing the augmented reality side of the Lamborghini Aventador, I decided to test out the pinch to zoom script. This however did not work at all on the Lamborghini, as upon scaling the model would land and flip vertically when I tried to change the size of the model.

In order to attempt to fix this, I went back into the realistic car controls and altered the axles and wheel colliders on the model. This however was not affective when trying to scale the model down, as the wheels went inwards upon pinching and making the model smaller, causing the car to pitch vertically.

In this case the model was able to be smaller, however the model simply could not move forward or backwards without bunny hopping. Upon trial and error of altering the physics and pinch to zoom script, I really struggled to understand why this was occurring, and so did the rest of the team.

We decided alongside the developers in Spark, that the best solution would be to remove the ability for the Lamborghini model to scale up and down, as the model could not cope with the scaling, as it affected all of the 3-D parts. As a solution we decided to only have one size of Lamborghini that would stay one size. Despite this being a disappointment, it would be more professional for the model to do well at the driving around aspect, rather than risking it malfunctioning when the user changes its size.

Week 6- Test Driving, Adding Engine Sounds and Cones

I then went back into unity, and removed the grey plane to allow the Lamborghini to be placed on real-world flat surfaces as I had done in the two clips above. Upon controlling the car, I also altered the speed to which the car could be controlled as I felt it was too excessive and quick for the user to control. This allows for a smoother user experience.

One of the final alterations I made to the model, was implementing car lights and engine sounds. This was done through the realistic car controller, to give the model a very realistic sound and feel when controlling.

After adding the sounds and lights, I finally exported the model onto my chosen iOS device via Xcode. The model was ready to be fully tested.

Final Outcome 🏆

Upon driving the car around, the Lamborghini responds to the increase of acceleration with the sound of the revs increasing. The model also successfully turns around when pressed left or right on the control UI, as well as when cones are placed on the ground the car is able to drive over them or knock them away upon collision. The edition of the cones allow for the user to test their driving capability, as well as the models turning circles which creates a more engaging experience.

Work place reference

Here is my workplace reference from Spark:

Refrence

Reflection and Analysis

To reflect on this project, I found it to be one of the most challenging augmented reality projects I have ever developed due to the physics implemented into the Lamborghini. This was exacerbated due to the inability for the model to be scaled up and down which was frustrating as I could not understand or work out why the car was not responding correctly. However my skills in dealing with this has been dramatically improved with my understanding of augmented reality and physics, C sharp development and alterations. The project also created a very enjoyable sense of controlling a vehicle in augmented reality, which is an element I have never experienced before with the added benefits of the realistic car engine and cone placement to challenge my driving. Despite not being able to implement all of the features, the feedback from the team was very positive as they are now able to showcase the Lamborghini Aventador application to potential clients in real time on the latest version of augmented reality in AR foundation.

Time Management

I structured my time management on a week by week basis, where I made sure that I took each stage into account.The Troll and Dragon project only consisted of three weeks, with a Lamborghini project consisting of four. This was down to the amount of development work required to build out the application. The Funko pops however stretched between week seven and week twelve, as it was far more in-depth and required many more C sharp scripts and development work to occur to it. Overall I was happy in the way I managed my workload and found it to be a success.

Handover information

Upon handing in the augmented reality application, the relevant files were all stored on Spark labs computers. As Spark own the projects and the files are on their computers/ databases, they do not need handover documentation.

References

  1. Spark Lab- https://www.spark-lab.co.uk/

  2. Vuforia- https://www.ptc.com/en/products/vuforia

  3. Smooth damp- https://docs.unity3d.com
    /ScriptReference/Vector3.SmoothDamp.html

  4. Rotation- https://stackoverflow.com/questions/
    57790059/rotating-an-object-at-which-i-am-looking-arfoundation