简介
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文件。