leaderboard/scripts/set_new_scenarios.py
def save_from_dict(endpoint, wp):
    """
    Creates a mini json with the data from the scenario waypoint.
    used to copy paste it to the .json
    """
    with open(endpoint, mode='w') as fd:

        entry = {}
        transform = {
            "x": str(round(float(wp["x"]), 2)),
            "y": str(round(float(wp["y"]), 2)),
            "z": "1.0",
            "yaw": str(round(float(wp["yaw"]), 0)),
            "pitch": str(round(float(wp["pitch"]), 0)),
        }
        entry["transform"] = transform
        entry["other_actors"] = {}
        json.dump(entry, fd, indent=4)

    Creates a mini json with the data from the scenario waypoint.
    used to copy paste it to the .json
    
Creates a mini json with the data from the scenario waypoint.
used to copy paste it to the .json
Creates a mini json with the data from the scenario waypoint . used to copy paste it to the . json
def save_from_dict(endpoint, wp):
    with open(endpoint, mode='w') as fd:
        entry = {}
        transform = {
            "x": str(round(float(wp["x"]), 2)),
            "y": str(round(float(wp["y"]), 2)),
            "z": "1.0",
            "yaw": str(round(float(wp["yaw"]), 0)),
            "pitch": str(round(float(wp["pitch"]), 0)),
        }
        entry["transform"] = transform
        entry["other_actors"] = {}
        json.dump(entry, fd, indent=4)
def save_from_dict ( endpoint , wp ) : with open ( endpoint , mode = 'w' ) as fd : entry = { } transform = { "x" : str ( round ( float ( wp [ "x" ] ) , 2 ) ) , "y" : str ( round ( float ( wp [ "y" ] ) , 2 ) ) , "z" : "1.0" , "yaw" : str ( round ( float ( wp [ "yaw" ] ) , 0 ) ) , "pitch" : str ( round ( float ( wp [ "pitch" ] ) , 0 ) ) , } entry [ "transform" ] = transform entry [ "other_actors" ] = { } json . dump ( entry , fd , indent = 4 )
Creates a mini json with the data from the scenario waypoint.
Creates a mini json with the data from the scenario waypoint .
"""
    Creates a mini json with the data from the scenario waypoint.
    used to copy paste it to the .json
    """
endpoint
wp