function state = set_to_center(state, P)
% resets the state to the center of its current lane

if isnan(state.lane_id)
  state.ey = nan;
else
  state.ey = P.roads(state.road_id).lanes(state.lane_id).ey;
end
state.yaw = 0;
