Calculating Speed Between Two Cars

In summary: Can you clarify?Theta is the movement direction relative to the chase car based on : theta = atan2(Vyi,Vxi) Vx and Vy are the speeds of the ego vehicle and the ground object, respectively.In summary, the program calculates the speed of two cars by estimating the speed of the lead car with radar and then applying the atan2 function to calculate the heading angle and lateral ground speed.
  • #1
kacem
2
0
Hi,
I found a programming problem that calculated the speed between two cars as below and I would like to know how the calculation is done.
it is about determining the speed of two cars. The coordinate reference system (y,x) is attached to the ego vehicle (as shown in the attached figure).
The speed of the lead car is estimated with the radar of the ego vehicle.
As mentioned in the program reference: The true ground speed of a radar-reported object from the relative speed and the ego vehicle speed is calculated as follows:
(Vxi,Vyi) : relative object speed
egoSpeed : ego vehicle speed
[Vx,Vy] : ground object speed

Vx = Vxi + egoSpeed :Calculate longitudinal ground speed
theta = atan2(Vyi,Vxi) :Calculate heading angle
Vy = Vx * tan(theta) :Calculate lateral ground speed

Is there anyone who can explain how Vx and Vy are calculated? and why he uses the term "ground"?
Thank you.
 

Attachments

  • prob.png
    prob.png
    2.7 KB · Views: 167
Physics news on Phys.org
  • #2
Welcome to the PF. :smile:
kacem said:
Is there anyone who can explain how Vx and Vy are calculated? and why he uses the term "ground"?
Those equations are just showing the vector addition of the two vehicle speeds to get the speed of the front vehicle with respect to the ground.

Have you learned any vector math in your schoolwork so far? If not, we can probably suggest some learning resources to help you get up to speed on these kinds of questions. :smile:
 
  • #3
kacem said:
I found a programming problem ...
Where is the code from? It seems wrong:
Theta is the movement direction relative to the chase car based on : theta = atan2(Vyi,Vxi)
But it is used to relate the velocity components relative to ground : Vy = Vx * tan(theta)
 
  • #4
  • #5

FAQ: Calculating Speed Between Two Cars

How do you calculate the speed between two cars?

To calculate the speed between two cars, you will need to measure the distance between the two cars and the time it takes for one car to reach the other. Then, divide the distance by the time to get the average speed in meters per second (m/s).

What units should be used to measure the distance and time?

The distance should be measured in meters (m) and the time should be measured in seconds (s) for accurate calculations of speed.

Can the speed between two cars be calculated if the cars are moving at different speeds?

Yes, the speed between two cars can still be calculated if the cars are moving at different speeds. However, the calculation will result in an average speed between the two cars, rather than the individual speeds of each car.

How accurate are the calculations of speed between two cars?

The accuracy of the calculations will depend on the accuracy of the measurements taken for distance and time. The more precise the measurements, the more accurate the calculated speed will be.

Are there any other factors that can affect the speed between two cars?

Yes, there are other factors that can affect the speed between two cars, such as the road conditions, traffic, and weather. These factors can impact the distance and time measurements, resulting in a slightly different calculated speed.

Back
Top