Calculating Speed Between Two Cars

  • Context: Undergrad 
  • Thread starter Thread starter kacem
  • Start date Start date
  • Tags Tags
    Cars Speed
Click For Summary

Discussion Overview

The discussion revolves around the calculation of the speed between two cars using a programming problem related to radar measurements and vector mathematics. Participants are exploring the equations provided for determining the ground speed of a lead car relative to an ego vehicle, as well as the implications of the terms used in the calculations.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant requests clarification on the calculation of Vx and Vy, specifically questioning the use of the term "ground."
  • Another participant suggests that the equations represent vector addition of the two vehicle speeds to derive the speed of the lead vehicle relative to the ground.
  • Concerns are raised about the correctness of the code, particularly regarding the calculation of theta and its application in determining Vy.
  • A participant expresses confusion over the necessity of calculating the angle theta when simple vector addition could suffice.
  • Reference is made to the source of the code from the Matlab Mathworks Website, indicating it is part of a section on calculating ground speed.

Areas of Agreement / Disagreement

Participants express differing views on the correctness of the equations and the necessity of calculating the angle theta. There is no consensus on the validity of the approach or the interpretation of the terms used.

Contextual Notes

There are unresolved questions regarding the assumptions behind the calculations, the definitions of the inputs and outputs, and the relationship between the velocities relative to the chase car and the ground.

kacem
Messages
2
Reaction score
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: 226
Physics news on Phys.org
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:
 
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)
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 20 ·
Replies
20
Views
4K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 7 ·
Replies
7
Views
12K
Replies
3
Views
1K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K