CatalogExample.xosc 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <?xml version="1.0"?>
  2. <OpenSCENARIO>
  3. <FileHeader revMajor="1" revMinor="0" date="2020-03-24T12:00:00" description="CARLA:PedestrianCrossing" author=""/>
  4. <ParameterDeclarations>
  5. <ParameterDeclaration name="weather" parameterType="string" value="ClearNoon" />
  6. <ParameterDeclaration name="carcolor" parameterType="string" value="122,122,122" />
  7. </ParameterDeclarations>
  8. <CatalogLocations>
  9. <VehicleCatalog>
  10. <Directory path="catalogs"/>
  11. </VehicleCatalog>
  12. <PedestrianCatalog>
  13. <Directory path="catalogs"/>
  14. </PedestrianCatalog>
  15. <MiscObjectCatalog>
  16. <Directory path="catalogs"/>
  17. </MiscObjectCatalog>
  18. <EnvironmentCatalog>
  19. <Directory path="catalogs"/>
  20. </EnvironmentCatalog>
  21. <ManeuverCatalog>
  22. <Directory path="catalogs"/>
  23. </ManeuverCatalog>
  24. <ControllerCatalog>
  25. <Directory path="catalogs"/>
  26. </ControllerCatalog>
  27. </CatalogLocations>
  28. <RoadNetwork>
  29. <LogicFile filepath="Town01"/>
  30. <SceneGraphFile filepath=""/>
  31. </RoadNetwork>
  32. <Entities>
  33. <ScenarioObject name="hero">
  34. <CatalogReference catalogName="VehicleCatalog" entryName="vehicle.volkswagen.t2"/>
  35. </ScenarioObject>
  36. <ScenarioObject name="vehicle">
  37. <CatalogReference catalogName="VehicleCatalog" entryName="vehicle.tesla.model3">
  38. <ParameterAssignments>
  39. <ParameterAssignment parameterRef="carcolor" value="255,255,0" />
  40. </ParameterAssignments>
  41. </CatalogReference>
  42. </ScenarioObject>
  43. <ScenarioObject name="vehicle2">
  44. <CatalogReference catalogName="VehicleCatalog" entryName="vehicle.tesla.model3">
  45. <ParameterAssignments>
  46. <ParameterAssignment parameterRef="carcolor" value="122,122,122" />
  47. </ParameterAssignments>
  48. </CatalogReference>
  49. </ScenarioObject>
  50. <ScenarioObject name="adversary">
  51. <CatalogReference catalogName="PedestrianCatalog" entryName="Pedestrian1"/>
  52. </ScenarioObject>
  53. <ScenarioObject name="barrier1">
  54. <CatalogReference catalogName="MiscObjectCatalog" entryName="Barrier1"/>
  55. </ScenarioObject>
  56. </Entities>
  57. <Storyboard>
  58. <Init>
  59. <Actions>
  60. <GlobalAction>
  61. <EnvironmentAction>
  62. <CatalogReference catalogName="EnvironmentCatalog" entryName="$weather"/>
  63. </EnvironmentAction>
  64. </GlobalAction>
  65. <Private entityRef="hero">
  66. <PrivateAction>
  67. <TeleportAction>
  68. <Position>
  69. <WorldPosition x="170" y="55" z="0" h="3.14159265359"/>
  70. </Position>
  71. </TeleportAction>
  72. </PrivateAction>
  73. <PrivateAction>
  74. <ControllerAction>
  75. <AssignControllerAction>
  76. <CatalogReference catalogName="ControllerCatalog" entryName="ExternalControl"/>
  77. </AssignControllerAction>
  78. <OverrideControllerValueAction>
  79. <Throttle value="0" active="false"/>
  80. <Brake value="0" active="false"/>
  81. <Clutch value="0" active="false"/>
  82. <ParkingBrake value="0" active="false"/>
  83. <SteeringWheel value="0" active="false"/>
  84. <Gear number="0" active="false"/>
  85. </OverrideControllerValueAction>
  86. </ControllerAction>
  87. </PrivateAction>
  88. </Private>
  89. <Private entityRef="vehicle">
  90. <PrivateAction>
  91. <TeleportAction>
  92. <Position>
  93. <WorldPosition x="150" y="55" z="0" h="3.14159265359"/>
  94. </Position>
  95. </TeleportAction>
  96. </PrivateAction>
  97. </Private>
  98. <Private entityRef="vehicle2">
  99. <PrivateAction>
  100. <TeleportAction>
  101. <Position>
  102. <WorldPosition x="150" y="60" z="0" h="3.14159265359"/>
  103. </Position>
  104. </TeleportAction>
  105. </PrivateAction>
  106. </Private>
  107. <Private entityRef="adversary">
  108. <PrivateAction>
  109. <TeleportAction>
  110. <Position>
  111. <WorldPosition x="110" y="52" z="0.3" h="1.57079632679"/>
  112. </Position>
  113. </TeleportAction>
  114. </PrivateAction>
  115. </Private>
  116. <Private entityRef="barrier1">
  117. <PrivateAction>
  118. <TeleportAction>
  119. <Position>
  120. <WorldPosition x="100" y="58" z="0" h="1.57079632679"/>
  121. </Position>
  122. </TeleportAction>
  123. </PrivateAction>
  124. </Private>
  125. </Actions>
  126. </Init>
  127. <Story name="MyStory">
  128. <Act name="Behavior">
  129. <ManeuverGroup maximumExecutionCount="1" name="AutopilotSequence">
  130. <Actors selectTriggeringEntities="false">
  131. <EntityRef entityRef="vehicle"/>
  132. </Actors>
  133. <CatalogReference catalogName="ManeuverCatalog" entryName="Autopilot"/>
  134. </ManeuverGroup>
  135. <ManeuverGroup maximumExecutionCount="1" name="PedestrianCrossingSequence">
  136. <Actors selectTriggeringEntities="false">
  137. <EntityRef entityRef="adversary"/>
  138. </Actors>
  139. <Maneuver name="PedestrianCrossingManeuver">
  140. <Event name="PedestrianStartsWalking" priority="overwrite">
  141. <Action name="PedestrianStartsWalking">
  142. <PrivateAction>
  143. <LongitudinalAction>
  144. <SpeedAction>
  145. <SpeedActionDynamics dynamicsShape="step" value="3" dynamicsDimension="distance"/>
  146. <SpeedActionTarget>
  147. <AbsoluteTargetSpeed value="10.0"/>
  148. </SpeedActionTarget>
  149. </SpeedAction>
  150. </LongitudinalAction>
  151. </PrivateAction>
  152. </Action>
  153. <StartTrigger>
  154. <ConditionGroup>
  155. <Condition name="StartCondition" delay="0" conditionEdge="rising">
  156. <ByEntityCondition>
  157. <TriggeringEntities triggeringEntitiesRule="any">
  158. <EntityRef entityRef="vehicle"/>
  159. </TriggeringEntities>
  160. <EntityCondition>
  161. <ReachPositionCondition tolerance="1.0">
  162. <Position>
  163. <WorldPosition x="140" y="55" z="0"/>
  164. </Position>
  165. </ReachPositionCondition>
  166. </EntityCondition>
  167. </ByEntityCondition>
  168. </Condition>
  169. </ConditionGroup>
  170. </StartTrigger>
  171. </Event>
  172. <Event name="PedestrianStopsAndWaits" priority="overwrite">
  173. <Action name="PedestrianStopsAndWaits">
  174. <PrivateAction>
  175. <LongitudinalAction>
  176. <SpeedAction>
  177. <SpeedActionDynamics dynamicsShape="step" value="5" dynamicsDimension="time"/>
  178. <SpeedActionTarget>
  179. <AbsoluteTargetSpeed value="0.0"/>
  180. </SpeedActionTarget>
  181. </SpeedAction>
  182. </LongitudinalAction>
  183. </PrivateAction>
  184. </Action>
  185. <StartTrigger>
  186. <ConditionGroup>
  187. <Condition name="StartCondition" delay="0" conditionEdge="rising">
  188. <ByEntityCondition>
  189. <TriggeringEntities triggeringEntitiesRule="any">
  190. <EntityRef entityRef="adversary"/>
  191. </TriggeringEntities>
  192. <EntityCondition>
  193. <StandStillCondition duration="1"/>
  194. </EntityCondition>
  195. </ByEntityCondition>
  196. </Condition>
  197. <Condition name="AfterPedestrianWalks" delay="0" conditionEdge="rising">
  198. <ByValueCondition>
  199. <StoryboardElementStateCondition storyboardElementType="action" storyboardElementRef="PedestrianStartsWalking" state="completeState"/>
  200. </ByValueCondition>
  201. </Condition>
  202. </ConditionGroup>
  203. </StartTrigger>
  204. </Event>
  205. <Event name="PedestrianWalksAway" priority="overwrite">
  206. <Action name="PedestrianStartsWalkingAway">
  207. <PrivateAction>
  208. <LongitudinalAction>
  209. <SpeedAction>
  210. <SpeedActionDynamics dynamicsShape="step" value="6.5" dynamicsDimension="distance"/>
  211. <SpeedActionTarget>
  212. <AbsoluteTargetSpeed value="2.0"/>
  213. </SpeedActionTarget>
  214. </SpeedAction>
  215. </LongitudinalAction>
  216. </PrivateAction>
  217. </Action>
  218. <StartTrigger>
  219. <ConditionGroup>
  220. <Condition name="StartCondition" delay="0" conditionEdge="rising">
  221. <ByEntityCondition>
  222. <TriggeringEntities triggeringEntitiesRule="any">
  223. <EntityRef entityRef="vehicle"/>
  224. </TriggeringEntities>
  225. <EntityCondition>
  226. <StandStillCondition duration="0.1"/>
  227. </EntityCondition>
  228. </ByEntityCondition>
  229. </Condition>
  230. <Condition name="AfterPedestrianStopsAndWaits" delay="0" conditionEdge="rising">
  231. <ByValueCondition>
  232. <StoryboardElementStateCondition storyboardElementType="action" storyboardElementRef="PedestrianStopsAndWaits" state="completeState"/>
  233. </ByValueCondition>
  234. </Condition>
  235. </ConditionGroup>
  236. </StartTrigger>
  237. </Event>
  238. <Event name="PedestrianWaits" priority="overwrite">
  239. <Action name="PedestrianWaits">
  240. <PrivateAction>
  241. <LongitudinalAction>
  242. <SpeedAction>
  243. <SpeedActionDynamics dynamicsShape="step" value="10" dynamicsDimension="time"/>
  244. <SpeedActionTarget>
  245. <AbsoluteTargetSpeed value="0.0"/>
  246. </SpeedActionTarget>
  247. </SpeedAction>
  248. </LongitudinalAction>
  249. </PrivateAction>
  250. </Action>
  251. <StartTrigger>
  252. <ConditionGroup>
  253. <Condition name="StartCondition" delay="0" conditionEdge="rising">
  254. <ByEntityCondition>
  255. <TriggeringEntities triggeringEntitiesRule="any">
  256. <EntityRef entityRef="adversary"/>
  257. </TriggeringEntities>
  258. <EntityCondition>
  259. <StandStillCondition duration="0.1"/>
  260. </EntityCondition>
  261. </ByEntityCondition>
  262. </Condition>
  263. <Condition name="AfterPedestrianStartsWalking" delay="0" conditionEdge="rising">
  264. <ByValueCondition>
  265. <StoryboardElementStateCondition storyboardElementType="action" storyboardElementRef="PedestrianStartsWalkingAway" state="completeState"/>
  266. </ByValueCondition>
  267. </Condition>
  268. </ConditionGroup>
  269. </StartTrigger>
  270. </Event>
  271. </Maneuver>
  272. </ManeuverGroup>
  273. <StartTrigger>
  274. <ConditionGroup>
  275. <Condition name="OverallStartCondition" delay="0" conditionEdge="rising">
  276. <ByValueCondition>
  277. <SimulationTimeCondition value="0" rule="greaterThan"/>
  278. </ByValueCondition>
  279. </Condition>
  280. </ConditionGroup>
  281. </StartTrigger>
  282. <StopTrigger>
  283. <ConditionGroup>
  284. <Condition name="EndCondition" delay="0" conditionEdge="rising">
  285. <ByValueCondition>
  286. <SimulationTimeCondition value="20.0" rule="greaterThan"/>
  287. </ByValueCondition>
  288. </Condition>
  289. </ConditionGroup>
  290. </StopTrigger>
  291. </Act>
  292. </Story>
  293. <StopTrigger>
  294. <ConditionGroup>
  295. <Condition name="criteria_CollisionTest" delay="0" conditionEdge="rising">
  296. <ByValueCondition>
  297. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  298. </ByValueCondition>
  299. </Condition>
  300. </ConditionGroup>
  301. </StopTrigger>
  302. </Storyboard>
  303. </OpenSCENARIO>