LaneChangeSimple.xosc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <?xml version="1.0"?>
  2. <OpenSCENARIO>
  3. <FileHeader revMajor="1" revMinor="0" date="2020-03-24T12:00:00" description="CARLA:LaneChangeSimple" author=""/>
  4. <ParameterDeclarations/>
  5. <CatalogLocations/>
  6. <RoadNetwork>
  7. <LogicFile filepath="Town04"/>
  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.lincoln.mkz_2017" vehicleCategory="car">
  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. <ScenarioObject name="standing">
  46. <Vehicle name="vehicle.volkswagen.t2" vehicleCategory="car">
  47. <ParameterDeclarations/>
  48. <Performance maxSpeed="69.444" maxAcceleration="200" maxDeceleration="10.0"/>
  49. <BoundingBox>
  50. <Center x="1.5" y="0.0" z="0.9"/>
  51. <Dimensions width="2.1" length="4.5" height="1.8"/>
  52. </BoundingBox>
  53. <Axles>
  54. <FrontAxle maxSteering="0.5" wheelDiameter="0.6" trackWidth="1.8" positionX="3.1" positionZ="0.3"/>
  55. <RearAxle maxSteering="0.0" wheelDiameter="0.6" trackWidth="1.8" positionX="0.0" positionZ="0.3"/>
  56. </Axles>
  57. <Properties>
  58. <Property name="type" value="simulation"/>
  59. </Properties>
  60. </Vehicle>
  61. </ScenarioObject>
  62. </Entities>
  63. <Storyboard>
  64. <Init>
  65. <Actions>
  66. <GlobalAction>
  67. <EnvironmentAction>
  68. <Environment name="Environment1">
  69. <TimeOfDay animation="false" dateTime="2019-06-25T12:00:00"/>
  70. <Weather cloudState="free">
  71. <Sun intensity="0.85" azimuth="0" elevation="1.31"/>
  72. <Fog visualRange="100000.0"/>
  73. <Precipitation precipitationType="dry" intensity="0.0"/>
  74. </Weather>
  75. <RoadCondition frictionScaleFactor="1.0"/>
  76. </Environment>
  77. </EnvironmentAction>
  78. </GlobalAction>
  79. <Private entityRef="hero">
  80. <PrivateAction>
  81. <TeleportAction>
  82. <Position>
  83. <WorldPosition x="-9.4" y="-152.8" z="0.5" h="1.57079632679"/>
  84. </Position>
  85. </TeleportAction>
  86. </PrivateAction>
  87. <PrivateAction>
  88. <ControllerAction>
  89. <AssignControllerAction>
  90. <Controller name="HeroAgent">
  91. <Properties>
  92. <Property name="module" value="external_control"/>
  93. </Properties>
  94. </Controller>
  95. </AssignControllerAction>
  96. <OverrideControllerValueAction>
  97. <Throttle value="0" active="false"/>
  98. <Brake value="0" active="false"/>
  99. <Clutch value="0" active="false"/>
  100. <ParkingBrake value="0" active="false"/>
  101. <SteeringWheel value="0" active="false"/>
  102. <Gear number="0" active="false"/>
  103. </OverrideControllerValueAction>
  104. </ControllerAction>
  105. </PrivateAction>
  106. </Private>
  107. <Private entityRef="adversary">
  108. <PrivateAction>
  109. <TeleportAction>
  110. <Position>
  111. <WorldPosition x="-9.4" y="-71.0" z="0.5" h="1.57079632679"/>
  112. </Position>
  113. </TeleportAction>
  114. </PrivateAction>
  115. </Private>
  116. <Private entityRef="standing">
  117. <PrivateAction>
  118. <TeleportAction>
  119. <Position>
  120. <WorldPosition x="-8.2" y="29.2" z="0.5" 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="ManeuverSequence">
  130. <Actors selectTriggeringEntities="false">
  131. <EntityRef entityRef="adversary"/>
  132. </Actors>
  133. <Maneuver name="LaneChangeSimpleManeuver">
  134. <Event name="AdversaryAccelerates" priority="overwrite">
  135. <Action name="AdversaryAccelerates">
  136. <PrivateAction>
  137. <LongitudinalAction>
  138. <SpeedAction>
  139. <SpeedActionDynamics dynamicsShape="step" value="50" dynamicsDimension="distance"/>
  140. <SpeedActionTarget>
  141. <AbsoluteTargetSpeed value="5.0"/>
  142. </SpeedActionTarget>
  143. </SpeedAction>
  144. </LongitudinalAction>
  145. </PrivateAction>
  146. </Action>
  147. <StartTrigger>
  148. <ConditionGroup>
  149. <Condition name="StartCondition" delay="0" conditionEdge="rising">
  150. <ByEntityCondition>
  151. <TriggeringEntities triggeringEntitiesRule="any">
  152. <EntityRef entityRef="hero"/>
  153. </TriggeringEntities>
  154. <EntityCondition>
  155. <RelativeDistanceCondition entityRef="adversary" relativeDistanceType="cartesianDistance" value="40.0" freespace="false" rule="lessThan"/>
  156. </EntityCondition>
  157. </ByEntityCondition>
  158. </Condition>
  159. </ConditionGroup>
  160. </StartTrigger>
  161. </Event>
  162. <Event name="AdversaryChangesLane" priority="overwrite">
  163. <Action name="AdversaryChangesLane">
  164. <PrivateAction>
  165. <LateralAction>
  166. <LaneChangeAction>
  167. <LaneChangeActionDynamics dynamicsShape="linear" value="25" dynamicsDimension="distance"/>
  168. <LaneChangeTarget>
  169. <RelativeTargetLane entityRef="adversary" value="-1"/>
  170. </LaneChangeTarget>
  171. </LaneChangeAction>
  172. </LateralAction>
  173. </PrivateAction>
  174. </Action>
  175. <StartTrigger>
  176. <ConditionGroup>
  177. <Condition name="AfterAdversaryAccelerates" delay="0" conditionEdge="rising">
  178. <ByValueCondition>
  179. <StoryboardElementStateCondition storyboardElementType="action" storyboardElementRef="AdversaryAccelerates" state="completeState"/>
  180. </ByValueCondition>
  181. </Condition>
  182. </ConditionGroup>
  183. </StartTrigger>
  184. </Event>
  185. </Maneuver>
  186. </ManeuverGroup>
  187. <StartTrigger>
  188. <ConditionGroup>
  189. <Condition name="OverallStartCondition" delay="0" conditionEdge="rising">
  190. <ByEntityCondition>
  191. <TriggeringEntities triggeringEntitiesRule="any">
  192. <EntityRef entityRef="hero"/>
  193. </TriggeringEntities>
  194. <EntityCondition>
  195. <TraveledDistanceCondition value="1.0"/>
  196. </EntityCondition>
  197. </ByEntityCondition>
  198. </Condition>
  199. <Condition name="StartTime" delay="0" conditionEdge="rising">
  200. <ByValueCondition>
  201. <SimulationTimeCondition value="0" rule="equalTo"/>
  202. </ByValueCondition>
  203. </Condition>
  204. </ConditionGroup>
  205. </StartTrigger>
  206. <StopTrigger>
  207. <ConditionGroup>
  208. <Condition name="EndCondition" delay="0" conditionEdge="rising">
  209. <ByEntityCondition>
  210. <TriggeringEntities triggeringEntitiesRule="any">
  211. <EntityRef entityRef="hero"/>
  212. </TriggeringEntities>
  213. <EntityCondition>
  214. <TraveledDistanceCondition value="200.0"/>
  215. </EntityCondition>
  216. </ByEntityCondition>
  217. </Condition>
  218. </ConditionGroup>
  219. </StopTrigger>
  220. </Act>
  221. </Story>
  222. <StopTrigger>
  223. <ConditionGroup>
  224. <Condition name="criteria_RunningStopTest" delay="0" conditionEdge="rising">
  225. <ByValueCondition>
  226. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  227. </ByValueCondition>
  228. </Condition>
  229. <Condition name="criteria_RunningRedLightTest" delay="0" conditionEdge="rising">
  230. <ByValueCondition>
  231. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  232. </ByValueCondition>
  233. </Condition>
  234. <Condition name="criteria_WrongLaneTest" delay="0" conditionEdge="rising">
  235. <ByValueCondition>
  236. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  237. </ByValueCondition>
  238. </Condition>
  239. <Condition name="criteria_OnSidewalkTest" delay="0" conditionEdge="rising">
  240. <ByValueCondition>
  241. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  242. </ByValueCondition>
  243. </Condition>
  244. <Condition name="criteria_KeepLaneTest" delay="0" conditionEdge="rising">
  245. <ByValueCondition>
  246. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  247. </ByValueCondition>
  248. </Condition>
  249. <Condition name="criteria_CollisionTest" delay="0" conditionEdge="rising">
  250. <ByValueCondition>
  251. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  252. </ByValueCondition>
  253. </Condition>
  254. <Condition name="criteria_DrivenDistanceTest" delay="0" conditionEdge="rising">
  255. <ByValueCondition>
  256. <ParameterCondition parameterRef="distance_success" value="100" rule="lessThan"/>
  257. </ByValueCondition>
  258. </Condition>
  259. </ConditionGroup>
  260. </StopTrigger>
  261. </Storyboard>
  262. </OpenSCENARIO>