IntersectionCollisionAvoidance.xosc 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <?xml version="1.0"?>
  2. <OpenSCENARIO>
  3. <FileHeader revMajor="1" revMinor="0" date="2020-03-24T12:00:00" description="CARLA:SynchronizeIntersectionEntry" author=""/>
  4. <ParameterDeclarations/>
  5. <CatalogLocations/>
  6. <RoadNetwork>
  7. <LogicFile filepath="Town01"/>
  8. <SceneGraphFile filepath=""/>
  9. </RoadNetwork>
  10. <Entities>
  11. <ScenarioObject name="hero">
  12. <Vehicle name="vehicle.tesla.model3" 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. <Vehicle name="vehicle.audi.tt" vehicleCategory="bicycle">
  30. <ParameterDeclarations/>
  31. <Performance maxSpeed="69.444" maxAcceleration="200" maxDeceleration="10.0"/>
  32. <BoundingBox>
  33. <Center x="1.5" y="0.0" z="0.9"/>
  34. <Dimensions width="2.1" length="4.5" height="1.8"/>
  35. </BoundingBox>
  36. <Axles>
  37. <FrontAxle maxSteering="0.5" wheelDiameter="0.6" trackWidth="1.8" positionX="3.1" positionZ="0.3"/>
  38. <RearAxle maxSteering="0.0" wheelDiameter="0.6" trackWidth="1.8" positionX="0.0" positionZ="0.3"/>
  39. </Axles>
  40. <Properties>
  41. <Property name="type" value="simulation"/>
  42. </Properties>
  43. </Vehicle>
  44. </ScenarioObject>
  45. </Entities>
  46. <Storyboard>
  47. <Init>
  48. <Actions>
  49. <GlobalAction>
  50. <EnvironmentAction>
  51. <Environment name="Environment1">
  52. <TimeOfDay animation="false" dateTime="2019-06-25T12:00:00"/>
  53. <Weather cloudState="free">
  54. <Sun intensity="0.85" azimuth="0" elevation="1.31"/>
  55. <Fog visualRange="100000.0"/>
  56. <Precipitation precipitationType="dry" intensity="0.0"/>
  57. </Weather>
  58. <RoadCondition frictionScaleFactor="1.0"/>
  59. </Environment>
  60. </EnvironmentAction>
  61. </GlobalAction>
  62. <Private entityRef="hero">
  63. <PrivateAction>
  64. <TeleportAction>
  65. <Position>
  66. <WorldPosition x="140" y="55" z="0" h="3.14159265359"/>
  67. </Position>
  68. </TeleportAction>
  69. </PrivateAction>
  70. <PrivateAction>
  71. <ControllerAction>
  72. <AssignControllerAction>
  73. <Controller name="HeroAgent">
  74. <Properties>
  75. <Property name="module" value="external_control"/>
  76. </Properties>
  77. </Controller>
  78. </AssignControllerAction>
  79. <OverrideControllerValueAction>
  80. <Throttle value="0" active="false"/>
  81. <Brake value="0" active="false"/>
  82. <Clutch value="0" active="false"/>
  83. <ParkingBrake value="0" active="false"/>
  84. <SteeringWheel value="0" active="false"/>
  85. <Gear number="0" active="false"/>
  86. </OverrideControllerValueAction>
  87. </ControllerAction>
  88. </PrivateAction>
  89. </Private>
  90. <Private entityRef="adversary">
  91. <PrivateAction>
  92. <TeleportAction>
  93. <Position>
  94. <WorldPosition x="92.5" y="91" z="0.2" h="-1.56"/>
  95. </Position>
  96. </TeleportAction>
  97. </PrivateAction>
  98. <PrivateAction>
  99. <ControllerAction>
  100. <AssignControllerAction>
  101. <Controller name="AdversaryAgent">
  102. <Properties>
  103. <Property name="module" value="npc_vehicle_control"/>
  104. </Properties>
  105. </Controller>
  106. </AssignControllerAction>
  107. <OverrideControllerValueAction>
  108. <Throttle value="0" active="false"/>
  109. <Brake value="0" active="false"/>
  110. <Clutch value="0" active="false"/>
  111. <ParkingBrake value="0" active="false"/>
  112. <SteeringWheel value="0" active="false"/>
  113. <Gear number="0" active="false"/>
  114. </OverrideControllerValueAction>
  115. </ControllerAction>
  116. </PrivateAction>
  117. </Private>
  118. </Actions>
  119. </Init>
  120. <Story name="MyStory">
  121. <Act name="Behavior">
  122. <ManeuverGroup maximumExecutionCount="1" name="ManeuverSequence">
  123. <Actors selectTriggeringEntities="false">
  124. <EntityRef entityRef="adversary"/>
  125. </Actors>
  126. <Maneuver name="SynchronizeManeuver">
  127. <Event name="RouteCreation" priority="overwrite">
  128. <Action name="RouteCreation">
  129. <PrivateAction>
  130. <RoutingAction>
  131. <AcquirePositionAction>
  132. <Position>
  133. <WorldPosition x="92" y="13.5" z="0" h="0"/>
  134. </Position>
  135. </AcquirePositionAction>
  136. </RoutingAction>
  137. </PrivateAction>
  138. </Action>
  139. <StartTrigger>
  140. <ConditionGroup>
  141. <Condition name="StartCondition" delay="0" conditionEdge="rising">
  142. <ByValueCondition>
  143. <SimulationTimeCondition value="0.1" rule="greaterThan"/>
  144. </ByValueCondition>
  145. </Condition>
  146. </ConditionGroup>
  147. </StartTrigger>
  148. </Event>
  149. <Event name="ActorSynchronization" priority="overwrite">
  150. <Action name="ActorSynchronization">
  151. <PrivateAction>
  152. <SynchronizeAction masterEntityRef="hero">
  153. <TargetPositionMaster>
  154. <WorldPosition x="103" y="55" z="0" h="3.14159"/>
  155. </TargetPositionMaster>
  156. <TargetPosition>
  157. <WorldPosition x="92" y="63.8" z="0" h="-1.56"/>
  158. </TargetPosition>
  159. <FinalSpeed>
  160. <RelativeSpeedToMaster value='3' speedTargetValueType='delta'/>
  161. </FinalSpeed>
  162. </SynchronizeAction>
  163. </PrivateAction>
  164. </Action>
  165. <StartTrigger>
  166. <ConditionGroup>
  167. <Condition name="StartCondition" delay="0" conditionEdge="rising">
  168. <ByValueCondition>
  169. <SimulationTimeCondition value="0.1" rule="greaterThan"/>
  170. </ByValueCondition>
  171. </Condition>
  172. </ConditionGroup>
  173. </StartTrigger>
  174. </Event>
  175. </Maneuver>
  176. </ManeuverGroup>
  177. <StartTrigger>
  178. <ConditionGroup>
  179. <Condition name="OverallStartCondition" delay="0" conditionEdge="rising">
  180. <ByEntityCondition>
  181. <TriggeringEntities triggeringEntitiesRule="any">
  182. <EntityRef entityRef="hero"/>
  183. </TriggeringEntities>
  184. <EntityCondition>
  185. <TraveledDistanceCondition value="0.1"/>
  186. </EntityCondition>
  187. </ByEntityCondition>
  188. </Condition>
  189. </ConditionGroup>
  190. </StartTrigger>
  191. <StopTrigger>
  192. <ConditionGroup>
  193. <Condition name="EndCondition" delay="0" conditionEdge="rising">
  194. <ByEntityCondition>
  195. <TriggeringEntities triggeringEntitiesRule="any">
  196. <EntityRef entityRef="hero"/>
  197. </TriggeringEntities>
  198. <EntityCondition>
  199. <TraveledDistanceCondition value="200.0"/>
  200. </EntityCondition>
  201. </ByEntityCondition>
  202. </Condition>
  203. </ConditionGroup>
  204. </StopTrigger>
  205. </Act>
  206. </Story>
  207. <StopTrigger>
  208. <ConditionGroup>
  209. <Condition name="criteria_RunningStopTest" delay="0" conditionEdge="rising">
  210. <ByValueCondition>
  211. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  212. </ByValueCondition>
  213. </Condition>
  214. <Condition name="criteria_RunningRedLightTest" delay="0" conditionEdge="rising">
  215. <ByValueCondition>
  216. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  217. </ByValueCondition>
  218. </Condition>
  219. <Condition name="criteria_WrongLaneTest" delay="0" conditionEdge="rising">
  220. <ByValueCondition>
  221. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  222. </ByValueCondition>
  223. </Condition>
  224. <Condition name="criteria_OnSidewalkTest" delay="0" conditionEdge="rising">
  225. <ByValueCondition>
  226. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  227. </ByValueCondition>
  228. </Condition>
  229. <Condition name="criteria_KeepLaneTest" delay="0" conditionEdge="rising">
  230. <ByValueCondition>
  231. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  232. </ByValueCondition>
  233. </Condition>
  234. <Condition name="criteria_CollisionTest" delay="0" conditionEdge="rising">
  235. <ByValueCondition>
  236. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  237. </ByValueCondition>
  238. </Condition>
  239. <Condition name="criteria_DrivenDistanceTest" delay="0" conditionEdge="rising">
  240. <ByValueCondition>
  241. <ParameterCondition parameterRef="distance_success" value="100" rule="lessThan"/>
  242. </ByValueCondition>
  243. </Condition>
  244. </ConditionGroup>
  245. </StopTrigger>
  246. </Storyboard>
  247. </OpenSCENARIO>