- #1
NeoXx
- 22
- 0
Hi all,
I am writing a code for the Ultra Sonic Sensor for the car which will show if there is enough parking space for the car to park parallel.
Basically, the UltraSonicSensor starts recording values when the distance from the side of the car to some object is greater than the car width.
It stops recording values when its the opposite, that is when the distance from the side of the car to some object is smaller than the car width.
However, I am unsure how to find out the length of the car space, which is the same as the displacement of the car from the moment the sensor has started recording, and to the moment it has stopped.
I thought of using the equation v^2 = u^2 + 2as
As the car velocity and acceleration change all the time, would it be okay to use this equation?
Thus, the moment the sensor starts recording, it should save the initial velocity at that exact time, right?
And then it should record acceleration and velocity of the car many times until the sensor stops recording, and then calculate the average of both right? And those two averages should enter the equation alongside with initial velocity.
I would be grateful if someone could point out if I'm thinking the right way or I'm completely wrong :)
Thanks!
I am writing a code for the Ultra Sonic Sensor for the car which will show if there is enough parking space for the car to park parallel.
Basically, the UltraSonicSensor starts recording values when the distance from the side of the car to some object is greater than the car width.
It stops recording values when its the opposite, that is when the distance from the side of the car to some object is smaller than the car width.
However, I am unsure how to find out the length of the car space, which is the same as the displacement of the car from the moment the sensor has started recording, and to the moment it has stopped.
I thought of using the equation v^2 = u^2 + 2as
As the car velocity and acceleration change all the time, would it be okay to use this equation?
Thus, the moment the sensor starts recording, it should save the initial velocity at that exact time, right?
And then it should record acceleration and velocity of the car many times until the sensor stops recording, and then calculate the average of both right? And those two averages should enter the equation alongside with initial velocity.
I would be grateful if someone could point out if I'm thinking the right way or I'm completely wrong :)
Thanks!