gdlg / simple-waymo-open-dataset-reader

Simple Waymo Open Dataset Reader
Apache License 2.0
120 stars 20 forks source link

how to get the alpha using the heading #11

Open sunjieee opened 4 years ago

sunjieee commented 4 years ago

hello, I have a question about the way to get the alpha using the heading in your examples, the groundtruth_extraction.py file, the code is 126 pos = (label.box.center_x,label.box.center_y,label.box.center_z,1) 127 pos = np.matmul(camera_extrinsic_inv, pos) 130 alpha = label.box.heading - math.atan2(pos[2],pos[0])

the pos[2] and pos[0] is center_z and center_x in the camera frame however in the camera frame of Waymo Dataset, z points up, so I think maybe the code change to alpha = label.box.heading - math.atan2(pos[1],pos[0]) Is it right or wrong? and another question: label.box.heading is in the vehicle frame , math.atan2(pos[2],pos[0]) is in the camera frame. so the alpha is camera frame or not?

gdlg commented 4 years ago

Hi @sunjieee ,

Thanks for reporting, yes, the code sounds wrong. I used the heading but didn’t rely on the alpha so I might not have noticed the wrong value. I haven’t used the dataset in a while so if you have tested the fix, feel free to do a pull request. Otherwise I can have a look when I have got some spare time.