seed_0_0_4.xosc 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <OpenSCENARIO>
  3. <FileHeader revMajor="1" revMinor="0" date="2020-03-20T12:00:00" description="CARLA:FollowLeadingVehicle" author=""/>
  4. <ParameterDeclarations>
  5. <ParameterDeclaration name="leadingSpeed" parameterType="double" value="8.0"/>
  6. </ParameterDeclarations>
  7. <CatalogLocations/>
  8. <RoadNetwork>
  9. <LogicFile filepath="Town07"/>
  10. <SceneGraphFile filepath=""/>
  11. </RoadNetwork>
  12. <Entities>
  13. <ScenarioObject name="hero">
  14. <Vehicle name="vehicle.lincoln.mkz_2017" vehicleCategory="car">
  15. <ParameterDeclarations/>
  16. <Performance maxSpeed="69.444" maxAcceleration="200" maxDeceleration="10.0"/>
  17. <BoundingBox>
  18. <Center x="1.5" y="0.0" z="0.9"/>
  19. <Dimensions width="2.1" length="4.5" height="1.8"/>
  20. </BoundingBox>
  21. <Axles>
  22. <FrontAxle maxSteering="0.5" wheelDiameter="0.6" trackWidth="1.8" positionX="3.1" positionZ="0.3"/>
  23. <RearAxle maxSteering="0.0" wheelDiameter="0.6" trackWidth="1.8" positionX="0.0" positionZ="0.3"/>
  24. </Axles>
  25. <Properties>
  26. <Property name="type" value="ego_vehicle"/>
  27. <Property name="color" value="0,0,255"/>
  28. </Properties>
  29. </Vehicle>
  30. </ScenarioObject>
  31. <ScenarioObject name="adversary">
  32. <Vehicle name="vehicle.tesla.model3" vehicleCategory="car">
  33. <ParameterDeclarations/>
  34. <Performance maxSpeed="69.444" maxAcceleration="200" maxDeceleration="10.0"/>
  35. <BoundingBox>
  36. <Center x="1.5" y="0.0" z="0.9"/>
  37. <Dimensions width="2.1" length="4.5" height="1.8"/>
  38. </BoundingBox>
  39. <Axles>
  40. <FrontAxle maxSteering="0.5" wheelDiameter="0.6" trackWidth="1.8" positionX="3.1" positionZ="0.3"/>
  41. <RearAxle maxSteering="0.0" wheelDiameter="0.6" trackWidth="1.8" positionX="0.0" positionZ="0.3"/>
  42. </Axles>
  43. <Properties>
  44. <Property name="type" value="simulation"/>
  45. <Property name="color" value="255,0,0"/>
  46. </Properties>
  47. </Vehicle>
  48. </ScenarioObject>
  49. </Entities>
  50. <Storyboard>
  51. <Init>
  52. <Actions>
  53. <GlobalAction>
  54. <EnvironmentAction>
  55. <Environment name="Environment1">
  56. <TimeOfDay animation="true" dateTime="2020-03-20T12:00:00"/>
  57. <Weather cloudState="free">
  58. <Sun intensity="0.85" azimuth="0" elevation="1.31"/>
  59. <Fog visualRange="200.0"/>
  60. <Precipitation precipitationType="rain" intensity="0.0"/>
  61. </Weather>
  62. <RoadCondition frictionScaleFactor="1.0"/>
  63. </Environment>
  64. </EnvironmentAction>
  65. </GlobalAction>
  66. <Private entityRef="hero">
  67. <PrivateAction>
  68. <TeleportAction>
  69. <Position>
  70. <!-- <RoadPosition roadId="21" s="0" t="1.60"/> -->
  71. <LanePosition roadId="21" laneId="-1" offset="0.0" s="90"/>
  72. <!-- <LanePosition roadId="4" laneId="-1" offset="1.0" s="48.58"/>-->
  73. </Position>
  74. </TeleportAction>
  75. </PrivateAction>
  76. <PrivateAction>
  77. <ControllerAction>
  78. <AssignControllerAction>
  79. <Controller name="HeroAgent">
  80. <Properties>
  81. <Property name="module" value="external_control"/>
  82. </Properties>
  83. </Controller>
  84. </AssignControllerAction>
  85. <OverrideControllerValueAction>
  86. <Throttle value="0" active="false"/>
  87. <Brake value="0" active="false"/>
  88. <Clutch value="0" active="false"/>
  89. <ParkingBrake value="0" active="false"/>
  90. <SteeringWheel value="0" active="false"/>
  91. <Gear number="0" active="false"/>
  92. </OverrideControllerValueAction>
  93. </ControllerAction>
  94. </PrivateAction>
  95. </Private>
  96. <Private entityRef="adversary">
  97. <PrivateAction>
  98. <TeleportAction>
  99. <Position>
  100. <!-- <RelativeRoadPosition entityRef="hero" ds="30" dt="0.0"/> -->
  101. <LanePosition roadId="21" laneId="-1" offset="0.0" s="115"/>
  102. <!-- <WorldPosition x="190" y="133" z="0" h="0"/>-->
  103. </Position>
  104. </TeleportAction>
  105. </PrivateAction>
  106. </Private>
  107. </Actions>
  108. </Init>
  109. <Story name="MyStory">
  110. <Act name="Behavior">
  111. <ManeuverGroup name="ManeuverSequence" maximumExecutionCount="1">
  112. <Actors selectTriggeringEntities="false">
  113. <EntityRef entityRef="adversary"/>
  114. </Actors>
  115. <Maneuver name="FollowLeadingVehicleManeuver">
  116. <Event name="LeadingVehicleKeepsVelocity" priority="overwrite">
  117. <Action name="LeadingVehicleKeepsVelocity">
  118. <PrivateAction>
  119. <LongitudinalAction>
  120. <SpeedAction>
  121. <SpeedActionDynamics dynamicsShape="step" value="300" dynamicsDimension="distance"/>
  122. <SpeedActionTarget>
  123. <AbsoluteTargetSpeed value="$leadingSpeed"/>
  124. </SpeedActionTarget>
  125. </SpeedAction>
  126. </LongitudinalAction>
  127. </PrivateAction>
  128. </Action>
  129. <StartTrigger>
  130. <ConditionGroup>
  131. <Condition name="StartConditionLeadingVehicleKeepsVelocity" delay="0" conditionEdge="rising">
  132. <ByEntityCondition>
  133. <TriggeringEntities triggeringEntitiesRule="any">
  134. <EntityRef entityRef="hero"/>
  135. </TriggeringEntities>
  136. <EntityCondition>
  137. <!-- <RelativeDistanceCondition entityRef="adversary" relativeDistanceType="cartesianDistance" value="40.0" freespace="false" rule="lessThan"/>-->
  138. <RelativeDistanceCondition entityRef="adversary" relativeDistanceType="longitudinal" value="30.0" freespace="true" rule="lessThan"/>
  139. </EntityCondition>
  140. </ByEntityCondition>
  141. </Condition>
  142. </ConditionGroup>
  143. </StartTrigger>
  144. </Event>
  145. <Event name="LeadingVehicleWaits" priority="overwrite">
  146. <Action name="LeadingVehicleWaits">
  147. <PrivateAction>
  148. <LongitudinalAction>
  149. <SpeedAction>
  150. <SpeedActionDynamics dynamicsShape="step" value="20" dynamicsDimension="time"/>
  151. <SpeedActionTarget>
  152. <AbsoluteTargetSpeed value="0.0"/>
  153. </SpeedActionTarget>
  154. </SpeedAction>
  155. </LongitudinalAction>
  156. </PrivateAction>
  157. </Action>
  158. <StartTrigger>
  159. <ConditionGroup>
  160. <Condition name="AfterLeadingVehicleKeepsVelocity" delay="0" conditionEdge="rising">
  161. <ByValueCondition>
  162. <StoryboardElementStateCondition storyboardElementType="action" storyboardElementRef="LeadingVehicleKeepsVelocity" state="endTransition"/>
  163. </ByValueCondition>
  164. </Condition>
  165. </ConditionGroup>
  166. </StartTrigger>
  167. </Event>
  168. </Maneuver>
  169. </ManeuverGroup>
  170. <StartTrigger>
  171. <ConditionGroup>
  172. <Condition name="OverallStartCondition" delay="0" conditionEdge="rising">
  173. <ByEntityCondition>
  174. <TriggeringEntities triggeringEntitiesRule="any">
  175. <EntityRef entityRef="hero"/>
  176. </TriggeringEntities>
  177. <EntityCondition>
  178. <TraveledDistanceCondition value="0.1"/>
  179. </EntityCondition>
  180. </ByEntityCondition>
  181. </Condition>
  182. <Condition name="StartTime" delay="0" conditionEdge="rising">
  183. <ByValueCondition>
  184. <SimulationTimeCondition value="0" rule="equalTo"/>
  185. </ByValueCondition>
  186. </Condition>
  187. </ConditionGroup>
  188. </StartTrigger>
  189. <StopTrigger>
  190. <ConditionGroup>
  191. <Condition name="EndCondition" delay="3" conditionEdge="rising">
  192. <ByEntityCondition>
  193. <TriggeringEntities triggeringEntitiesRule="any">
  194. <EntityRef entityRef="hero"/>
  195. </TriggeringEntities>
  196. <EntityCondition>
  197. <TraveledDistanceCondition value="800.0"/>
  198. </EntityCondition>
  199. </ByEntityCondition>
  200. </Condition>
  201. </ConditionGroup>
  202. </StopTrigger>
  203. </Act>
  204. </Story>
  205. <StopTrigger>
  206. <ConditionGroup>
  207. <Condition name="criteria_RunningStopTest" delay="0" conditionEdge="rising">
  208. <ByValueCondition>
  209. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  210. </ByValueCondition>
  211. </Condition>
  212. <Condition name="criteria_RunningRedLightTest" delay="0" conditionEdge="rising">
  213. <ByValueCondition>
  214. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  215. </ByValueCondition>
  216. </Condition>
  217. <Condition name="criteria_WrongLaneTest" delay="0" conditionEdge="rising">
  218. <ByValueCondition>
  219. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  220. </ByValueCondition>
  221. </Condition>
  222. <Condition name="criteria_OnSidewalkTest" delay="0" conditionEdge="rising">
  223. <ByValueCondition>
  224. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  225. </ByValueCondition>
  226. </Condition>
  227. <Condition name="criteria_KeepLaneTest" delay="0" conditionEdge="rising">
  228. <ByValueCondition>
  229. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  230. </ByValueCondition>
  231. </Condition>
  232. <Condition name="criteria_CollisionTest" delay="0" conditionEdge="rising">
  233. <ByValueCondition>
  234. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  235. </ByValueCondition>
  236. </Condition>
  237. <Condition name="criteria_DrivenDistanceTest" delay="0" conditionEdge="rising">
  238. <ByValueCondition>
  239. <ParameterCondition parameterRef="distance_success" value="100" rule="lessThan"/>
  240. </ByValueCondition>
  241. </Condition>
  242. </ConditionGroup>
  243. </StopTrigger>
  244. </Storyboard>
  245. </OpenSCENARIO>