nuplan-devkit
nuplan-devkit copied to clipboard
function _project_from_global_to_ego_centric_ds seems wrong about the y-axis direction
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)