Closed alantes closed 1 year ago
If I calculate velocity by magnitude and heading, the graphs seem much more correct:
import numpy as np
velocity_x = []
velocity_y = []
for i in range(len(scenarios_list)):
scenario = get_default_scenario_from_token(
NUPLAN_DATA_ROOT, log_db, scenarios_list[i]["token"].hex(), NUPLAN_MAPS_ROOT, NUPLAN_MAP_VERSION
)
heading = scenario.initial_ego_state.rear_axle.heading
velocity = scenario.initial_ego_state.dynamic_car_state.rear_axle_velocity_2d.magnitude()
# velocity_x.append(scenario.initial_ego_state.dynamic_car_state.center_acceleration_2d.x)
# velocity_y.append(scenario.initial_ego_state.dynamic_car_state.center_acceleration_2d.y)
velocity_x.append(velocity * np.cos(heading))
velocity_y.append(velocity * np.sin(heading))
v_x:
v_y:
Hi @alantes,
Sorry for the delay. The reason that the velocity_y is small is that the velocities are in the ego's frame. velocity_x is the longitudinal direction and velocity_y is the lateral direction. Hope this clears up some of your confusions
Hello, developers! Thank you for your data and dev-kit!
In "2021.10.15.02.36.56_veh-53_02020_02442.db" of Singapore split, the ego vehicle ran a route like this:
But the corresponding velocity_x among the way is like:
While the velocity_y is like:
To me, velocity_y is like noise rather than normal speed.
Here is my code: