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

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

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