Get the velocity of the ego vehicle

I am trying to Analyse the ego vehicles velocity at different instants in time. For a particular scene, I can get the ego_pose for different sample_data for a particular sensor, and get the instantaneous velocity by (distance travelled by time interval between the two timestamps. However for the first_sample token, I will nto be able to figure out the initial position and the initial timestamp. Is it alright to assume the vehicle stars from (0, 0) and initial time being 0 ?

thanks
Vignesh

Hi, sorry, we missed this message. It depends what you are using the velocity for. I’m not sure whether you mean a velocity or a location by (0, 0). Both would be bad assumptions. (0, 0) as a location is the outermost corner of the map. We don’t drive there. (0, 0) as a velocity would mean the car is stopped beforehand, which is also not true.
Instead you can just compute the velocity between first and second frame and assign it to the first frame.

Thanks for the reply. Initially I though of computing the velocity of the ego vehicle sample by sample, by taking the instantaneous velocity (sqrt((x2 - x1)^2 + (y2 - y1)^2)) but thats again a very bad assumption for my study. So i decided to use the velocity parameter from the CAN message directly.

1 Like