自动驾驶云服务 OCTOPUS-静态场景样例

时间:2024-05-11 16:52:48

静态场景样例

下文提供keep创建和create创建两种写法.

声明所有要泛化的变量,即为本例中第2-4行.

关键字merge 说明是匝道合流的种子场景,即为本例中的第6行.

明确本场景中所有参数的具体值,即为本例中的第7行到最后.
scenario HighwayMerge:
    lane_width: length = [3m, 4m]
    left_lane_num: int = [0]
    ramp_length: length = [200m, 500m]
    road_aids_type: road_aids_type == "DType-1"

    merge_1: merge with:
        keep(it.lane_width == lane_width)
        keep(it.left_lane_num == left_lane_num)
        keep(it.right_lane_num == 2)
        keep(it.ramp_lane_num == 1)
        keep(it.main_speed == 120kph)
        keep(it.ramp_speed == 60kph)
        keep(it.radius_of_curvature == 200m)
        keep(it.ramp_length == ramp_length)
        keep(it.road_aids_type == road_aids_type)

声明本场景为静态场景,即为本例中第2行.

声明所有要泛化的变量,即为本例中第4行.

create_merge说明是匝道合流的种子场景,即为本例中的第6行.

函数create_merge的入参即指定本场景中的所有参数具体值,即为本例中的第6-7行.
scenario Merge:
    m_scene: scenery

    lane_width: length = [3m, 4m]
    my_road_aids_type: road_aids_type == "DType-1"

    m_straight: merge = m_scene.create_merge(lane_width: lane_width, left_lane_num: 0, right_lane_num: 2, main_speed: 120kph, ramp_speed: 60kph, radius_of_curvature: 200m, ramp_length: 300m, ramp_lane_num: 1, road_aids_type: my_road_aids_type)
support.huaweicloud.com/usermanual-octopus/octopus-03-0182.html