RL-Tutorial 2 Attribute Error:Velocity

Hi there,

I’ve been working on the motion planning problem with only statistic obstacles. During the Tutorial 2 Vanilla Learning, I received the Attribute Error:Velocity, pointed to

gym_commonroad/observation/surrounding_observation.py in get_rel_v_p_follow_leading(distance_sign, distance_abs, p_rel_follow, p_rel_lead, v_rel_follow, v_rel_lead, obs_state, obstacle, ego_state, o_follow, o_lead, obstacle_follow, obstacle_lead)
    767                 ego_state.velocity_y, ego_state.velocity)
    768             delta_orientation = obs_state.orientation - ego_state_orientation
--> 769             v_rel_lead = obs_state.velocity * np.cos(delta_orientation) - ego_state.velocity
    770             p_rel_lead = distance_abs
    771             o_lead = obs_state

I tried to set the obs and ego velocity before it, but the result is still the same. The difference between tutorial scenarios with mine, is that tutorial scenarios have multiple dynamic obs,but mine only static obstacles. Also for my case, I modify the obs_id into 3 digits. Does the RL method only work for dynamic obstacles now? Or is there other rules I haven’t obey when generating the xmls?

BR
Joanne

Dear Joanne,

Are you using the latest version of CommonRoad-RL? Here should set the velocity of StaticObstacle to zero. Your error message has a different line number as the current version so I guess you have to update your installation.

Best,
Xiao