更新时间:2024-08-09 GMT+08:00
分享

仿真场景终止条件有几种?

仿真终止的条件有以下几种:

  1. 超时。

    创建任务时设置的“最大运行时长”,超过运行时间时,仿真任务停止。

    图1 超时
  2. 场景文件中设置终点。
    1. xml类型场景。
      Read the destination of Ego in xml end triggers。
      <Scenario>
        ...
        <Action Name="ReachPositionCondition">
          <PosAbsolute
              CounterID=""
              CounterComp="COMP_EQ"
              Radius="8.0000000000000000e+00"      (关键行,检测半径)
              X="2.4439516235319047e+02"           (关键行,x坐标)
              Y="-9.1187807788708923e+00"          (关键行,y坐标)
              Z="0"                                (关键行,z坐标)
              NetDist="false"
              CounterVal="0"
              Pivot="Ego"
          />
          <SCP
              ExecutionTimes="1"
              ActiveOnEnter="true"
              DelayTime="5.0000000000000000e+00"    (关键行,延时执行,建议5s)
            ><![CDATA[<SimCtrl><Stop/></SimCtrl>]]></SCP
          >
        </Action>
        ...
      </Scenario>

      为了到达终点的评测,一般建议延迟5s执行,等待评测检测成功。此处对应前文中的DelayTime。

    2. xosc类型场景,OpenSCENARIO 1.0版本如下:

      Read the destination of Ego in xosc end triggers。

      <StopTrigger>
        <ConditionGroup>
          <Condition
              name=""
              delay="0.000000"     (关键行,延时执行,建议5s)
              conditionEdge="rising">
            <ByEntityCondition>
              <TriggeringEntities triggeringEntitiesRule="any">
                <EntityRef entityRef="Ego"/>
              </TriggeringEntities>
              <EntityCondition>
                <ReachPositionCondition tolerance="2.000000"> (关键行,检测半径)
                  <Position>
                    <WorldPosition
                      x="0.178000"    (关键行,x坐标)
                      y="5.621000"    (关键行,y坐标)
                      z="0.000000"    (关键行,z坐标)
                      h="0.000000"
                      p="0.000000"
                      r="0.000000"/>
                  </Position>
                </ReachPositionCondition>
              </EntityCondition>
            </ByEntityCondition>
          </Condition>
        </ConditionGroup>
      </StopTrigger>

      为了到达终点的评测,一般建议延迟5s执行,等待评测检测成功。此处对应前文中的DelayTime。

    3. xosc类型场景,OpenSCENARIO 0.9.1的示例如下:
      Read the expected destination of Ego in xosc。
      <OpenSCENARIO>
          <FileHeader author="Octopus/Simulation" date="2022-07-07T07:27:18" description="AcquirePositionExample" revMajor="0" revMinor="9"/>
          <Catalogs>
              <VehicleCatalog>
                  <Directory path="Distros/Current/Config/Players/Vehicles"/>
              </VehicleCatalog>
              <DriverCatalog>
                  <Directory path="Distros/Current/Config/Players/driverCfg.xml"/>
              </DriverCatalog>
              <PedestrianCatalog>
                  <Directory path=""/>
              </PedestrianCatalog>
              <PedestrianControllerCatalog>
                  <Directory path=""/>
              </PedestrianControllerCatalog>
              <MiscObjectCatalog>
                  <Directory path="Distros/Current/Config/Players/Objects"/>
              </MiscObjectCatalog>
              <EnvironmentCatalog>
                  <Directory path=""/>
              </EnvironmentCatalog>
              <ManeuverCatalog>
                  <Directory path=""/>
              </ManeuverCatalog>
              <TrajectoryCatalog>
                  <Directory path=""/>
              </TrajectoryCatalog>
              <RouteCatalog>
                  <Directory path=""/>
              </RouteCatalog>
          </Catalogs>
          <RoadNetwork>
              <Logics filepath="Projects/Current/Databases/Germany.2018/Germany_2018.xodr"/>
              <SceneGraph filepath="Projects/Current/Databases/Germany.2018/Germany_2018.opt.osgb"/>
          </RoadNetwork>
          <Entities>
          </Entities>
          <Storyboard>
              <Init>
                  <Actions>
                  </Actions>
              </Init>
              <EndConditions>
                  <ConditionGroup>
                      <Condition delay="0" edge="rising" name="End Condition">
                          <ByEntity>
                              <TriggeringEntities rule="any">
                                  <Entity name="Ego"/>
                              </TriggeringEntities>
                              <EntityCondition>
                                  <ReachPosition tolerance="10">
                              <Position>
                                 <World h="3" p="1" r="2" x="100" y="200" z="300"/>
                              </Position>
                           </ReachPosition>
                              </EntityCondition>
                          </ByEntity>
                      </Condition>
                  </ConditionGroup>
              </EndConditions>
          </Storyboard>
      </OpenSCENARIO>

相关文档