## Inspiration

We thought GM teen driver technology was a good start to improving the skills of teen drivers, but wanted to show real-time data to the driver for direct and actionable feedback.

## What it does

SafeTrip helps new drivers learn to gradually accelerate and brake, and take turns at a safe speed.

## How we built it

An app built for GM infotainment systems, the app engine was written in JavaScript. Here, we take data on the car’s speed and steering wheel position to calculate centripetal acceleration when taking a turn, and linear acceleration when applying the gas or brakes. We then check these values for accelerations outside of our comfort threshold (0.5Gs) and use this to calculate the user’s driving score accordingly. The UI is an HTML page rendered in the car’s operating system.

## Challenges we ran into

Calculating the feeling that the driver feels when turning proved to be initially difficult. There was no API available for this so we had to calculate it ourselves. As the user increases in speed, an increase in the degree of turn is felt more by people in the car. Conversely, the same acceleration can be felt at a lower speed but with a sharper turn. We tried several different relationships to model this feeling before deciding to calculate centripetal acceleration. Measuring the force was ruled out because it is dependent on the mass of the thing being accelerated which isn’t constant or known. Acceleration on the other hand could be represented in Gs which is something most people are familiar with.

We initially tried calculating turning radius based on the angular velocity (yaw), linear velocity of the car, and time to take a 360 degree turn, but we couldn’t get all of these data points without data from an actual car so we used a representative turning radius of 10m (~35ft). From this value, we then decided to take the ratio of the steering wheel angle to the maximum steering angle to calculate effective turning radius. Once this is calculated we were finally able to calculate the centripetal acceleration because it is proportional to the square of the linear (tangential) velocity and inversely proportional to the turning radius. Accomplishments that we're proud of

We are proud of our app’s ability to calculate both accelerations that can be felt. This helps notify the user when their driving is likely uncomfortable to passengers, or just plain unsafe, and in turn help make new drivers better and safer.

## What we learned

Physics and why everyone hates math in JavaScript. What's next for SafeTrip

Pivoting the focus to not just new drivers but also more experienced or T&LC drivers looking to maintain a high level of passenger comfort.