Wrong reference point in roadmap_layer in raster feature
Describe the bug
In the raster feature, all layers are computed taking the ego vehicles rear axle as center point.
Only the roadmap layer is inconsistent with this.
While this inconsistency is a problem in itsself, it also leads to faulty visualizations when using get_raster_with_trajectories_as_rgb from nuplan.planning.training.callbacks.utils.visualization_utils. More precisely, the visualized roadmap layer is shifted in the backwards direction (negative x-direction in the local coordinate frame). This can be observed easily when ego is making a turn. Due to the shift of the roadmap layer, the ground truth trajectory seems to leave the driveable surface.
Steps To Reproduce
Visualize the scenario e8b3bed019f953e6 with the above mentioned function (best viewed with pixel size 0.2 and raster height / width = 512) and also with the nuboard.
Possible Solution
This can be solved rather easily, by using the ego_state instead of ego_state.agent here.
Then this line has to be changed to global_transform = np.linalg.inv(ego_state.rear_axle.as_matrix()).
Note that consequently this line should also be changed accordingly.
Screenshots
Unfortunately, there seems to be a problem with uploading screenshots. Once this is solved, i will add some examples for easier understanding