waymo-research / waymo-open-dataset

Waymo Open Dataset
https://www.waymo.com/open
Other
2.62k stars 605 forks source link

velocity is zero in dataset #133

Open NullCodex opened 4 years ago

NullCodex commented 4 years ago

I am currently trying to fetch the velocity related to each data via:

FILENAME = 'training_0000/segment-1005081002024129653_5313_150_5333_150_with_camera_labels.tfrecord'

dataset = tf.data.TFRecordDataset(FILENAME, compression_type='')

for data in dataset:
    byte_array = bytearray(data.numpy())
    # grab the velocity
    velocity = open_dataset.Velocity()
    velocity.ParseFromString(byte_array)

however, all attributes to velocity such as velocity.v_x and velocity.w_x are all zero. Is there a reason why these attributes are zero?

peisun1115 commented 4 years ago

you need to parse the frame and get velocity from it.

` for data in dataset: byte_array = bytearray(data.numpy())

grab the velocity

frame = open_dataset.Frame()
frame.ParseFromString(byte_array)`
     // then iterate all labels and print their velocity. 
NullCodex commented 4 years ago

I am not sure i follow, how does iterating the labels help in this case. Looking at https://github.com/waymo-research/waymo-open-dataset/blob/master/waymo_open_dataset/dataset.proto the velocity attribute isn't part of label.

peisun1115 commented 4 years ago

you can real a little more about protobuf https://developers.google.com/protocol-buffers/docs/pythontutorial

A frame is a class that contains a lot of information. Label is part of it. Label contains velocity.

NullCodex commented 4 years ago

Ah, my bad i didn't see that. This might be a dumb question but how do I get the velocity of the current vehicle?

peisun1115 commented 4 years ago

First, note that the velocity we release are in global frame. In order to get velocity in vehicle frame, you need to rotate the velocity vector by pose though the norm of velocity should remain the same.

For SDC's velocity, you can either get it by taking derivates of the poses we released (we release position of the SDC at each time).

Alternatively, you can also get that by looking at this field . It is the velocity of the SDC at the image center time .

tianweiy commented 4 years ago

@peisun1115 How do we get the ground truth velocity for each object? Do you use some radar / estimate from hand labeled location? Thanks!

https://github.com/waymo-research/waymo-open-dataset/blob/dc5db38eb67898bf98c45e710291b62181998efe/waymo_open_dataset/label.proto#L52-L55

peisun1115 commented 4 years ago

It is estimated from hand labeled location

tianweiy commented 4 years ago

thanks!

ConnorKevin commented 2 weeks ago

@peisun1115 Could we know the details about the velocity estimation process? Is it just calculated the distance between the centers of the same bounding box in neighboring frames and divided by the sample time interval?