leaderboard/scripts/set_new_scenarios.py
def apart_enough(world, _waypoint, scenario_waypoint):
    """
    Uses the same condition as in route_scenario to see if they will
    be differentiated
    """
    TRIGGER_THRESHOLD = 4.0
    TRIGGER_ANGLE_THRESHOLD = 10

    dx = float(_waypoint["x"]) - scenario_waypoint.transform.location.x
    dy = float(_waypoint["y"]) - scenario_waypoint.transform.location.y
    distance = math.sqrt(dx * dx + dy * dy)

    dyaw = float(_waypoint["yaw"]) - scenario_waypoint.transform.rotation.yaw
    dist_angle = math.sqrt(dyaw * dyaw)

    if distance < TRIGGER_THRESHOLD and dist_angle < TRIGGER_ANGLE_THRESHOLD:
    # if distance < TRIGGER_THRESHOLD:
        world.debug.draw_point(scenario_waypoint.transform.location + carla.Location(z=1),
                               size=float(0.15), color=carla.Color(255, 0, 0))
    else:
        world.debug.draw_point(scenario_waypoint.transform.location + carla.Location(z=1),
                               size=float(0.15), color=carla.Color(0, 255, 0))

    Uses the same condition as in route_scenario to see if they will
    be differentiated
    
Uses the same condition as in route_scenario to see if they will
be differentiated
Uses the same condition as in route_scenario to see if they will be differentiated
def apart_enough(world, _waypoint, scenario_waypoint):
    TRIGGER_THRESHOLD = 4.0
    TRIGGER_ANGLE_THRESHOLD = 10
    dx = float(_waypoint["x"]) - scenario_waypoint.transform.location.x
    dy = float(_waypoint["y"]) - scenario_waypoint.transform.location.y
    distance = math.sqrt(dx * dx + dy * dy)
    dyaw = float(_waypoint["yaw"]) - scenario_waypoint.transform.rotation.yaw
    dist_angle = math.sqrt(dyaw * dyaw)
    if distance < TRIGGER_THRESHOLD and dist_angle < TRIGGER_ANGLE_THRESHOLD:
        world.debug.draw_point(scenario_waypoint.transform.location + carla.Location(z=1),
                               size=float(0.15), color=carla.Color(255, 0, 0))
    else:
        world.debug.draw_point(scenario_waypoint.transform.location + carla.Location(z=1),
                               size=float(0.15), color=carla.Color(0, 255, 0))
def apart_enough ( world , _waypoint , scenario_waypoint ) : TRIGGER_THRESHOLD = 4.0 TRIGGER_ANGLE_THRESHOLD = 10 dx = float ( _waypoint [ "x" ] ) - scenario_waypoint . transform . location . x dy = float ( _waypoint [ "y" ] ) - scenario_waypoint . transform . location . y distance = math . sqrt ( dx * dx + dy * dy ) dyaw = float ( _waypoint [ "yaw" ] ) - scenario_waypoint . transform . rotation . yaw dist_angle = math . sqrt ( dyaw * dyaw ) if distance < TRIGGER_THRESHOLD and dist_angle < TRIGGER_ANGLE_THRESHOLD : world . debug . draw_point ( scenario_waypoint . transform . location + carla . Location ( z = 1 ) , size = float ( 0.15 ) , color = carla . Color ( 255 , 0 , 0 ) ) else : world . debug . draw_point ( scenario_waypoint . transform . location + carla . Location ( z = 1 ) , size = float ( 0.15 ) , color = carla . Color ( 0 , 255 , 0 ) )
Uses the same condition as in route_scenario to see if they will
be differentiated
Uses the same condition as in route_scenario to see if they will be differentiated
"""
    Uses the same condition as in route_scenario to see if they will
    be differentiated
    """ # if distance < TRIGGER_THRESHOLD:
world
_waypoint
scenario_waypoint