motional / nuplan-devkit

The devkit of the nuPlan dataset.
https://www.nuplan.org
Other
682 stars 131 forks source link

function _project_from_global_to_ego_centric_ds seems wrong about the y-axis direction #373

Open Zigned opened 6 months ago

Zigned commented 6 months ago

Describe the bug

The function _project_from_global_to_ego_centric_ds in /nuplan/planning/simulation/planner/ml_planner/transform_utils.py seems wrong about the y-axis direction. This function is used to project value from the global xy frame to the ego centric ds frame (i.e., vehicle coordinate system, right?). However, the original code seems to assume left-handed coordinates: line 69, values_lat = values[:, :1] * np.sin(headings) - values[:, 1:2] * np.cos(headings) If I am right, the dynamic state in EgoState is in a right-handed frame. So, should this line be changed to the following? values_lat = - values[:, :1] * np.sin(headings) + values[:, 1:2] * np.cos(headings)