meddiver仿真场景描述

scenario = {

    # ===== Meta data about the scenario =====
    # string. The name of the scenario
    "id": "Waymo-001",

    # string. The version of data format.
    "version": "MetaDrive v0.3.0.1",

    # int. The length of all trajectory and state arrays (T).
    "length": 200,

    # ===== Meta data ===
    "metadata": {

        # np.ndarray in (T, ). The time stamp of each time step.
        "ts": np.array([0.0, 0.1, 0.2, ...], dtype=np.float32),


        # bool. Whether the scenario is processed and exported by MetaDrive.
        # Some operations may be done, such as interpolating the lane to
        # make way points uniformly scattered in given interval.
        "metadrive_processed": True,

        # string. Coordinate system.
        "coordinate": "metadrive",

        # optional keys
        "source_file": "training_20s.tfrecord-00014-of-01000",
        "dataset": "waymo",
        "scenario_id": "dd0c8c27fdd6ef59",  # Used in Waymo dataset
        "seed": 512,
        "history_metadata": {},

        "sdc_id": "172",  # A key exists in tracks

    },

    # ===== Trajectories of active participants, e.g. vehicles, pedestrians =====
    # a dict mapping object ID to it's state dict.
    "tracks": {
        "vehicle1": {

            # The type string in metadrive.type.MetaDriveType
            "type": "VEHICLE",

            # The state dict. All values must have T elements.
            "state": {
                "position": np.ones([200, 3], dtype=np.float32),
                ...
            },

            # The meta data dict. Store useful information about the object. type in metadata could be those from
            # different dataset
            "metadata": {
                "type": "VEHICLE",
                "track_length": 200,
                "object_id": "vehicle1",

                # Optional keys
                "agent_name": "default_agent",
                "policy_spawn_info": {  # Information needed to re-instantiate the policy
                    "policy_class": ("metadrive.policy.idm_policy", "IDMPolicy"),
                    "args": ...,
                    "kwargs": ...,
                }
            }
        },

        "pedestrian1": ...
    },

    # ===== States sequence of dynamics objects, e.g. traffic light =====
    # a dict mapping object ID to it's state dict.
    "dynamic_map_states": {
        "trafficlight1": {

            # The type string in metadrive.type.MetaDriveType
            "type": "TRAFFIC_LIGHT",

            # The state dict. All values must have T elements.
            "state": {
                "object_state": np.ones([200, ], dtype=int),
                ...
            },

            # The meta data dict. Store useful information about the object
            "metadata": {
                "type": "TRAFFIC_LIGHT",
                "track_length": 200,
            }
    }

    # ===== Map features =====
    # A dict mapping from map feature ID to a line segment
    "map_features": {
        "219": {
            "type": "LANE_SURFACE_STREET",
            "polyline": np.array in [21, 2],  # A set of 2D points describing a line segment
            # optional, only works for lane
            "polygon": np.array in [N, 2] # A set of 2D points representing convexhull
        },
        "182": ...
        ...
    }
}

# Note: Example is from the docstring of metadrive/scenario/scenario_description.py

  1. 元数据 (Meta data about the scenario)

    • id: 场景的唯一标识符,这里是"Waymo-001"。
    • version: 数据格式的版本,这里是"MetaDrive v0.3.0.1"。
    • length: 所有轨迹和状态数组的长度,这里是200,表示时间步数为200。
  2. 元数据 (metadata)

    • ts: 一个长度为T(在这里是200)的numpy数组,存储每个时间步的时间戳。
    • metadrive_processed: 一个布尔值,表示该场景是否由MetaDrive处理并导出。
    • coordinate: 坐标系统,这里是"metadrive"。
    • 其他可选键,如source_filedatasetscenario_idseedhistory_metadatasdc_id,提供了关于场景来源、数据集、唯一标识符、随机种子、历史元数据和自动驾驶车辆ID的信息。
  3. 参与者轨迹 (tracks)

    • 这是一个字典,键是参与者的唯一标识符(如"vehicle1"),值是另一个字典,包含参与者的类型、状态和元数据。
    • 类型 (type): 参与者的类型,这里是"VEHICLE"。
    • 状态 (state): 一个字典,包含参与者在每个时间步的状态。例如,"position"键是一个形状为(200, 3)的numpy数组,表示每个时间步的三维位置。
    • 元数据 (metadata): 一个字典,包含关于参与者的有用信息。例如,"type"键再次表示参与者的类型,"track_length"表示轨迹的长度,"object_id"是参与者的唯一标识符。其他可选键,如"agent_name"和"policy_spawn_info",提供了关于代理名称和重新实例化策略所需的信息。

  • 10
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值