美文网首页
openscenario文件解析

openscenario文件解析

作者: wangafu | 来源:发表于2020-04-10 09:55 被阅读0次

简介

Openscenario是德国vtk公司推出的一些列用于自动驾驶仿真的标准之一。如其名字所示,openscenario使用与描述自动驾驶场景的标准化文件格式。目前carla等开源平台也支持openscenario文件格式的导入。
openscenario文件后缀为.xosc,其中xo表示x-open,sc表示scenario。其文本内容是xml格式,主要内容有以下几部分。

具体格式解析如下:

FileHeader

<?xml version="1.0" encoding="utf-8"?>
<OpenSCENARIO>
    
<FileHeader revMajor="0" revMinor="9" date="2016-10-18T10:00:00" description="Sample Scenario - Lane Changer" author="Andreas Biehn"/>

FileHeader中描述了版本、日期、描述、作者等信息。

ParameterDeclaration

<ParameterDeclaration/>

OSC参数声明

Catalogs 路径

<Catalogs>
    <VehicleCatalog>
        <Directory path="Catalogs/VehicleCatalogs"/>
    </VehicleCatalog>
    <DriverCatalog>
        <Directory path="Catalogs/DriverCatalogs"/>
    </DriverCatalog>
    <PedestrianCatalog>
        <Directory path="Catalogs/ObserverCatalogs"/>
    </PedestrianCatalog>
    <PedestrianControllerCatalog>
        <Directory path="Catalogs/PedestrianCatalogs"/>
    </PedestrianControllerCatalog>
    <MiscObjectCatalog>
        <Directory path="Catalogs/MiscObjectCatalogs"/>
    </MiscObjectCatalog>
    <EnvironmentCatalog>
        <Directory path="Catalogs/EnvironmentCatalogs"/>
    </EnvironmentCatalog>
    <ManeuverCatalog>
        <Directory path="Catalogs/ManeuverCatalogs"/>
    </ManeuverCatalog>
    <TrajectoryCatalog>
        <Directory path="Catalogs/TrajectoryCatalog"/>
    </TrajectoryCatalog>
    <RouteCatalog>
        <Directory path="Catalogs/RoutingCatalog"/>
    </RouteCatalog>
</Catalogs>

文件路径

RoadNetwork 路网

<RoadNetwork>
    <Logics filepath="Tracks/Bin/RQ31_130Limit/RQ31_130Limit.xodr"/>
    <SceneGraph filepath="Tracks/Bin/RQ31_130Limit/RQ31_130Limit.opt.osgb"/>
</RoadNetwork>

直接使用xodr格式的opendrive文件

Storyboard 故事板

<Storyboard>
    <Init>
        <Actions>
            <Private object="Ego">
                <Action>
                    <Longitudinal>
                        <Speed>
                            <Dynamics shape="step" rate="0"/>
                            <Target>
                                <Absolute value="36.1"/>
                            </Target>
                        </Speed>
                    </Longitudinal>
                </Action>
                <Action>
                    <Position>
                        <World x="0" y="10" z="9.5" h="0" p="0" r="0"/>
                    </Position>
                </Action>
            </Private>
            <Private object="Target1">
                <Action>
                    <Longitudinal>
                        <Speed>
                            <Dynamics shape="step" rate="0"/>
                            <Target>
                                <Absolute value="36.1"/>
                            </Target>
                        </Speed>
                    </Longitudinal>
                </Action>
                <Action>
                    <Position>
                        <World x="200" y="10" z="9.5" h="0" p="0" r="0"/>
                    </Position>
                </Action>
            </Private>
            <Private object="Target2">
                <Action>
                    <Longitudinal>
                        <Speed>
                            <Dynamics shape="step" rate="0"/>
                            <Target>
                                <Absolute value="36.1"/>
                            </Target>
                        </Speed>
                    </Longitudinal>
                </Action>
                <Action>
                    <Position>
                        <World x="100" y="10" z="9.5" h="0" p="0" r="0"/>
                    </Position>
                </Action>
            </Private>
        </Actions>
    </Init>
    <Story name="MyStory" owner="Target2">
        <Act name="MyAct">
            <Sequence name="MySequence" numberOfExecutions="1">
                <Actors>
                    <Entity name="$owner"/>
                </Actors>
                <Maneuver name="MyLaneChangeManeuver">
                    <Event name="MyLaneChangeEvent" priority="overwrite">
                        <Action name="MyLaneChangeAction">
                            <Private>
                                <Routing>
                                    <FollowTrajectory>
                                        <CatalogReference catalogName="TrajectoryCatalog" entryName="MyLaneChangeTrajectory"/>
                                        <Longitudinal>
                                            <None/>
                                        </Longitudinal>
                                        <Lateral purpose="steering"/>
                                    </FollowTrajectory>
                                </Routing>
                            </Private>
                        </Action>
                        <Conditions>
                            <Start>
                                <ConditionGroup>
                                    <Condition name="MyStartCondition" delay="0" edge="rising">
                                        <ByState>
                                            <AtStart type="act" name="MyAct"/>
                                        </ByState>
                                    </Condition>
                                </ConditionGroup>
                            </Start>
                        </Conditions>
                    </Event>
                </Maneuver>
            </Sequence>
            <Conditions>
                <Start>
                    <ConditionGroup>
                        <Condition name="" delay="0" edge="rising">
                            <ByValue>
                                <SimulationTime value="0" rule="equal-to"/>
                            </ByValue>
                        </Condition>
                    </ConditionGroup>
                </Start>
            </Conditions>
        </Act>
    </Story>
    <End>
    </End>
</Storyboard>

描述场景动态内容

总结

具有以上几个要素,便可形成一个openscenario文件。

相关文章

  • openscenario文件解析

    简介 Openscenario是德国vtk公司推出的一些列用于自动驾驶仿真的标准之一。如其名字所示,opensce...

  • Django处理Excel,CSV文件

    1 .处理Excel文件: 通过前台传入Excel文件进行解析 2. 处理CSV文件: 解析本地文件 解析前台传入...

  • opendrive与openscenario

    opendrive OpenDrive地图解析代码可以参考,https://github.com/liuyf523...

  • nodejs 实现文件上传

    文件上传需要解析文件,之前我们解析数据使用body-parser,解析文件可以用multer。body-parse...

  • node.js fade

    解析字符串 解析文件

  • 中间件漏洞

    一.本文介绍 1、本文介绍IIS5.x-6.x目录解析漏洞、文件解析、解析文件类型、7.5解析漏洞;Apache后...

  • Android源码(4) --- 系统 Mainfest 文件解

    系统 Mainfest 文件解析流程 为什么要看 Mainfest 文件解析流程呢,因为解析来分析apk的安装流程...

  • 10 android网络编程

    HTTP请求方式:HttpURLConnection XML数据解析 JSON数据解析 文件上传 文件下载 调用 ...

  • 2019-04-05 android 签名 相关知识

    anroid 签名文件 解析命令 从 apk 里面进行解析 cert.RSA文件

  • RN-Taro语法转换分享

    一.整体流程 文件输入-->解析-->转换-->生成-->文件输出 解析将代码解析成抽象语法树(AST),每个js...

网友评论

      本文标题:openscenario文件解析

      本文链接:https://www.haomeiwen.com/subject/althmhtx.html