PedestrianCrossingFront.xosc 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  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. <CatalogLocations/>
  6. <RoadNetwork>
  7. <LogicFile filepath="Town02"/>
  8. <SceneGraphFile filepath=""/>
  9. </RoadNetwork>
  10. <Entities>
  11. <ScenarioObject name="hero">
  12. <Vehicle name="vehicle.volkswagen.t2" vehicleCategory="car">
  13. <ParameterDeclarations/>
  14. <Performance maxSpeed="69.444" maxAcceleration="200" maxDeceleration="10.0"/>
  15. <BoundingBox>
  16. <Center x="1.5" y="0.0" z="0.9"/>
  17. <Dimensions width="2.1" length="4.5" height="1.8"/>
  18. </BoundingBox>
  19. <Axles>
  20. <FrontAxle maxSteering="0.5" wheelDiameter="0.6" trackWidth="1.8" positionX="3.1" positionZ="0.3"/>
  21. <RearAxle maxSteering="0.0" wheelDiameter="0.6" trackWidth="1.8" positionX="0.0" positionZ="0.3"/>
  22. </Axles>
  23. <Properties>
  24. <Property name="type" value="ego_vehicle"/>
  25. </Properties>
  26. </Vehicle>
  27. </ScenarioObject>
  28. <ScenarioObject name="adversary">
  29. <Pedestrian model="walker.pedestrian.0001" mass="90.0" name="walker.pedestrian.0001" pedestrianCategory="pedestrian">
  30. <ParameterDeclarations/>
  31. <BoundingBox>
  32. <Center x="1.5" y="0.0" z="0.9"/>
  33. <Dimensions width="2.1" length="4.5" height="1.8"/>
  34. </BoundingBox>
  35. <Properties>
  36. <Property name="type" value="simulation"/>
  37. </Properties>
  38. </Pedestrian>
  39. </ScenarioObject>
  40. </Entities>
  41. <Storyboard>
  42. <Init>
  43. <Actions>
  44. <GlobalAction>
  45. <EnvironmentAction>
  46. <Environment name="Environment1">
  47. <TimeOfDay animation="false" dateTime="2019-06-25T12:00:00"/>
  48. <Weather cloudState="free">
  49. <Sun intensity="0.35" azimuth="0" elevation="1.31"/>
  50. <Fog visualRange="100000.0"/>
  51. <Precipitation precipitationType="rain" intensity="0.2"/>
  52. </Weather>
  53. <RoadCondition frictionScaleFactor="1.0"/>
  54. </Environment>
  55. </EnvironmentAction>
  56. </GlobalAction>
  57. <Private entityRef="hero">
  58. <PrivateAction>
  59. <TeleportAction>
  60. <Position>
  61. <WorldPosition x="28.7" y="302.5" z="0.4" h="3.14159265359"/>
  62. </Position>
  63. </TeleportAction>
  64. </PrivateAction>
  65. <PrivateAction>
  66. <ControllerAction>
  67. <AssignControllerAction>
  68. <Controller name="HeroAgent">
  69. <Properties>
  70. <Property name="module" value="external_control"/>
  71. </Properties>
  72. </Controller>
  73. </AssignControllerAction>
  74. <OverrideControllerValueAction>
  75. <Throttle value="0" active="false"/>
  76. <Brake value="0" active="false"/>
  77. <Clutch value="0" active="false"/>
  78. <ParkingBrake value="0" active="false"/>
  79. <SteeringWheel value="0" active="false"/>
  80. <Gear number="0" active="false"/>
  81. </OverrideControllerValueAction>
  82. </ControllerAction>
  83. </PrivateAction>
  84. </Private>
  85. <Private entityRef="adversary">
  86. <PrivateAction>
  87. <TeleportAction>
  88. <Position>
  89. <RelativeRoadPosition entityRef="hero" ds="2" dt="0.0"/>
  90. <!-- <WorldPosition x="110" y="52" z="0.3" h="1.57079632679"/> -->
  91. </Position>
  92. </TeleportAction>
  93. </PrivateAction>
  94. </Private>
  95. </Actions>
  96. </Init>
  97. <Story name="MyStory">
  98. <Act name="Behavior">
  99. <ManeuverGroup maximumExecutionCount="1" name="ManeuverSequence">
  100. <Actors selectTriggeringEntities="false">
  101. <EntityRef entityRef="adversary"/>
  102. </Actors>
  103. <Maneuver name="PedestrianCrossingManeuver">
  104. <Event name="PedestrianStartsWalking" priority="overwrite">
  105. <Action name="PedestrianStartsWalking">
  106. <PrivateAction>
  107. <LongitudinalAction>
  108. <SpeedAction>
  109. <SpeedActionDynamics dynamicsShape="step" value="1.5" dynamicsDimension="distance"/>
  110. <SpeedActionTarget>
  111. <AbsoluteTargetSpeed value="10.0"/>
  112. </SpeedActionTarget>
  113. </SpeedAction>
  114. </LongitudinalAction>
  115. </PrivateAction>
  116. </Action>
  117. <StartTrigger>
  118. <ConditionGroup>
  119. <Condition name="StartCondition" delay="0" conditionEdge="rising">
  120. <ByEntityCondition>
  121. <TriggeringEntities triggeringEntitiesRule="any">
  122. <EntityRef entityRef="hero"/>
  123. </TriggeringEntities>
  124. <EntityCondition>
  125. <ReachPositionCondition tolerance="2.0">
  126. <Position>
  127. <WorldPosition x="140" y="55" z="0" h="180"/>
  128. </Position>
  129. </ReachPositionCondition>
  130. </EntityCondition>
  131. </ByEntityCondition>
  132. </Condition>
  133. </ConditionGroup>
  134. </StartTrigger>
  135. </Event>
  136. <Event name="PedestrianStopsAndWaits" priority="overwrite">
  137. <Action name="PedestrianStopsAndWaits">
  138. <PrivateAction>
  139. <LongitudinalAction>
  140. <SpeedAction>
  141. <SpeedActionDynamics dynamicsShape="step" value="10" dynamicsDimension="time"/>
  142. <SpeedActionTarget>
  143. <AbsoluteTargetSpeed value="0.0"/>
  144. </SpeedActionTarget>
  145. </SpeedAction>
  146. </LongitudinalAction>
  147. </PrivateAction>
  148. </Action>
  149. <StartTrigger>
  150. <ConditionGroup>
  151. <Condition name="AfterPedestrianWalks" delay="0" conditionEdge="rising">
  152. <ByValueCondition>
  153. <StoryboardElementStateCondition storyboardElementType="action" storyboardElementRef="PedestrianStartsWalking" state="completeState"/>
  154. </ByValueCondition>
  155. </Condition>
  156. </ConditionGroup>
  157. </StartTrigger>
  158. </Event>
  159. <Event name="PedestrianWalksAway" priority="overwrite">
  160. <Action name="PedestrianStartsWalkingAway">
  161. <PrivateAction>
  162. <LongitudinalAction>
  163. <SpeedAction>
  164. <SpeedActionDynamics dynamicsShape="step" value="6.5" dynamicsDimension="distance"/>
  165. <SpeedActionTarget>
  166. <AbsoluteTargetSpeed value="2.0"/>
  167. </SpeedActionTarget>
  168. </SpeedAction>
  169. </LongitudinalAction>
  170. </PrivateAction>
  171. </Action>
  172. <StartTrigger>
  173. <ConditionGroup>
  174. <Condition name="StartCondition" delay="0" conditionEdge="rising">
  175. <ByEntityCondition>
  176. <TriggeringEntities triggeringEntitiesRule="any">
  177. <EntityRef entityRef="hero"/>
  178. </TriggeringEntities>
  179. <EntityCondition>
  180. <StandStillCondition duration="0.1"/>
  181. </EntityCondition>
  182. </ByEntityCondition>
  183. </Condition>
  184. <Condition name="AfterPedestrianStopsAndWaits" delay="0" conditionEdge="rising">
  185. <ByValueCondition>
  186. <StoryboardElementStateCondition storyboardElementType="action" storyboardElementRef="PedestrianStopsAndWaits" state="completeState"/>
  187. </ByValueCondition>
  188. </Condition>
  189. </ConditionGroup>
  190. </StartTrigger>
  191. </Event>
  192. <Event name="PedestrianWaits" priority="overwrite">
  193. <Action name="PedestrianWaits">
  194. <PrivateAction>
  195. <LongitudinalAction>
  196. <SpeedAction>
  197. <SpeedActionDynamics dynamicsShape="step" value="10" dynamicsDimension="time"/>
  198. <SpeedActionTarget>
  199. <AbsoluteTargetSpeed value="0.0"/>
  200. </SpeedActionTarget>
  201. </SpeedAction>
  202. </LongitudinalAction>
  203. </PrivateAction>
  204. </Action>
  205. <StartTrigger>
  206. <ConditionGroup>
  207. <Condition name="StartCondition" delay="0" conditionEdge="rising">
  208. <ByEntityCondition>
  209. <TriggeringEntities triggeringEntitiesRule="any">
  210. <EntityRef entityRef="adversary"/>
  211. </TriggeringEntities>
  212. <EntityCondition>
  213. <StandStillCondition duration="0.1"/>
  214. </EntityCondition>
  215. </ByEntityCondition>
  216. </Condition>
  217. <Condition name="AfterPedestrianStartsWalking" delay="0" conditionEdge="rising">
  218. <ByValueCondition>
  219. <StoryboardElementStateCondition storyboardElementType="action" storyboardElementRef="PedestrianStartsWalkingAway" state="completeState"/>
  220. </ByValueCondition>
  221. </Condition>
  222. </ConditionGroup>
  223. </StartTrigger>
  224. </Event>
  225. </Maneuver>
  226. </ManeuverGroup>
  227. <StartTrigger>
  228. <ConditionGroup>
  229. <Condition name="OverallStartCondition" delay="0" conditionEdge="rising">
  230. <ByEntityCondition>
  231. <TriggeringEntities triggeringEntitiesRule="any">
  232. <EntityRef entityRef="hero"/>
  233. </TriggeringEntities>
  234. <EntityCondition>
  235. <TraveledDistanceCondition value="10.0"/>
  236. </EntityCondition>
  237. </ByEntityCondition>
  238. </Condition>
  239. </ConditionGroup>
  240. </StartTrigger>
  241. <StopTrigger>
  242. <ConditionGroup>
  243. <Condition name="EndCondition" delay="0" conditionEdge="rising">
  244. <ByEntityCondition>
  245. <TriggeringEntities triggeringEntitiesRule="any">
  246. <EntityRef entityRef="hero"/>
  247. </TriggeringEntities>
  248. <EntityCondition>
  249. <TraveledDistanceCondition value="200.0"/>
  250. </EntityCondition>
  251. </ByEntityCondition>
  252. </Condition>
  253. </ConditionGroup>
  254. </StopTrigger>
  255. </Act>
  256. </Story>
  257. <StopTrigger>
  258. <ConditionGroup>
  259. <Condition name="criteria_RunningStopTest" delay="0" conditionEdge="rising">
  260. <ByValueCondition>
  261. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  262. </ByValueCondition>
  263. </Condition>
  264. <Condition name="criteria_RunningRedLightTest" delay="0" conditionEdge="rising">
  265. <ByValueCondition>
  266. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  267. </ByValueCondition>
  268. </Condition>
  269. <Condition name="criteria_WrongLaneTest" delay="0" conditionEdge="rising">
  270. <ByValueCondition>
  271. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  272. </ByValueCondition>
  273. </Condition>
  274. <Condition name="criteria_OnSidewalkTest" delay="0" conditionEdge="rising">
  275. <ByValueCondition>
  276. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  277. </ByValueCondition>
  278. </Condition>
  279. <Condition name="criteria_KeepLaneTest" delay="0" conditionEdge="rising">
  280. <ByValueCondition>
  281. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  282. </ByValueCondition>
  283. </Condition>
  284. <Condition name="criteria_CollisionTest" delay="0" conditionEdge="rising">
  285. <ByValueCondition>
  286. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  287. </ByValueCondition>
  288. </Condition>
  289. <Condition name="criteria_DrivenDistanceTest" delay="0" conditionEdge="rising">
  290. <ByValueCondition>
  291. <ParameterCondition parameterRef="distance_success" value="100" rule="lessThan"/>
  292. </ByValueCondition>
  293. </Condition>
  294. </ConditionGroup>
  295. </StopTrigger>
  296. </Storyboard>
  297. </OpenSCENARIO>