OpenDriveLab / UniAD

[CVPR'23 Best Paper Award] Planning-oriented Autonomous Driving
Apache License 2.0
3.15k stars 341 forks source link

Deriving command from ego trajectory for planning GT #110

Open xinshuoweng opened 11 months ago

xinshuoweng commented 11 months ago

Hi team,

Would you mind double-checking the following code block on why using the index of 0 to derive the command?

    mask = planning_mask_all[0].any(axis=1)
    if mask.sum() == 0:
        command = 2 #'FORWARD'
    elif planning_all[0, mask][-1][0] >= 2:
        command = 0 #'RIGHT' 
    elif planning_all[0, mask][-1][0] <= -2:
        command = 1 #'LEFT'
    else:
        command = 2 #'FORWARD'

My understanding is that planning_all has a shape of 1 x 6 x 3, where the last column has x, y and yaw. So planning_all[0, mask][-1][0] means using x at the future frame to determine the command. Shouldn't it be planning_all[0, mask][-1][-1] so we use the yaw in the last future frame to determine the command?

https://github.com/OpenDriveLab/UniAD/blob/main/projects/mmdet3d_plugin/datasets/data_utils/trajectory_api.py#L271

Thanks! Xinshuo

Yihanhu commented 11 months ago

Hi @xinshuoweng , Our definition follows ST-P3 , which uses the future x to determine the command.