seed_0_0_2.xosc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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="Town04"/>
  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="31" s="-0.5" t="-1.75"/> -->
  71. <!-- <WorldPosition x="28.7" y="302.5" z="0.4" h="3.14159265359"/> -->
  72. <LanePosition roadId="31" laneId="2" offset="0.0" s="175"/>
  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="-25" dt="2.0"/> -->
  101. <LanePosition roadId="31" laneId="2" offset="0.0" s="150"/>
  102. <!-- <WorldPosition x="28.7" y="342.5" z="0.4" h="3.14159265359"/> -->
  103. <!-- <WorldPosition x="190" y="133" z="0" h="0"/>-->
  104. </Position>
  105. </TeleportAction>
  106. </PrivateAction>
  107. </Private>
  108. </Actions>
  109. </Init>
  110. <Story name="MyStory">
  111. <Act name="Behavior">
  112. <ManeuverGroup name="ManeuverSequence" maximumExecutionCount="1">
  113. <Actors selectTriggeringEntities="false">
  114. <EntityRef entityRef="adversary"/>
  115. </Actors>
  116. <Maneuver name="FollowLeadingVehicleManeuver">
  117. <Event name="LeadingVehicleKeepsVelocity" priority="overwrite">
  118. <Action name="LeadingVehicleKeepsVelocity">
  119. <PrivateAction>
  120. <LongitudinalAction>
  121. <SpeedAction>
  122. <SpeedActionDynamics dynamicsShape="step" value="300" dynamicsDimension="distance"/>
  123. <SpeedActionTarget>
  124. <AbsoluteTargetSpeed value="$leadingSpeed"/>
  125. </SpeedActionTarget>
  126. </SpeedAction>
  127. </LongitudinalAction>
  128. </PrivateAction>
  129. </Action>
  130. <StartTrigger>
  131. <ConditionGroup>
  132. <Condition name="StartConditionLeadingVehicleKeepsVelocity" delay="0" conditionEdge="rising">
  133. <ByEntityCondition>
  134. <TriggeringEntities triggeringEntitiesRule="any">
  135. <EntityRef entityRef="hero"/>
  136. </TriggeringEntities>
  137. <EntityCondition>
  138. <!-- <RelativeDistanceCondition entityRef="adversary" relativeDistanceType="cartesianDistance" value="40.0" freespace="false" rule="lessThan"/>-->
  139. <RelativeDistanceCondition entityRef="adversary" relativeDistanceType="longitudinal" value="30.0" freespace="true" rule="lessThan"/>
  140. </EntityCondition>
  141. </ByEntityCondition>
  142. </Condition>
  143. </ConditionGroup>
  144. </StartTrigger>
  145. </Event>
  146. <Event name="LeadingVehicleWaits" priority="overwrite">
  147. <Action name="LeadingVehicleWaits">
  148. <PrivateAction>
  149. <LongitudinalAction>
  150. <SpeedAction>
  151. <SpeedActionDynamics dynamicsShape="step" value="20" dynamicsDimension="time"/>
  152. <SpeedActionTarget>
  153. <AbsoluteTargetSpeed value="0.0"/>
  154. </SpeedActionTarget>
  155. </SpeedAction>
  156. </LongitudinalAction>
  157. </PrivateAction>
  158. </Action>
  159. <StartTrigger>
  160. <ConditionGroup>
  161. <Condition name="AfterLeadingVehicleKeepsVelocity" delay="0" conditionEdge="rising">
  162. <ByValueCondition>
  163. <StoryboardElementStateCondition storyboardElementType="action" storyboardElementRef="LeadingVehicleKeepsVelocity" state="endTransition"/>
  164. </ByValueCondition>
  165. </Condition>
  166. </ConditionGroup>
  167. </StartTrigger>
  168. </Event>
  169. </Maneuver>
  170. </ManeuverGroup>
  171. <StartTrigger>
  172. <ConditionGroup>
  173. <Condition name="OverallStartCondition" delay="0" conditionEdge="rising">
  174. <ByEntityCondition>
  175. <TriggeringEntities triggeringEntitiesRule="any">
  176. <EntityRef entityRef="hero"/>
  177. </TriggeringEntities>
  178. <EntityCondition>
  179. <TraveledDistanceCondition value="0.1"/>
  180. </EntityCondition>
  181. </ByEntityCondition>
  182. </Condition>
  183. <Condition name="StartTime" delay="0" conditionEdge="rising">
  184. <ByValueCondition>
  185. <SimulationTimeCondition value="0" rule="equalTo"/>
  186. </ByValueCondition>
  187. </Condition>
  188. </ConditionGroup>
  189. </StartTrigger>
  190. <StopTrigger>
  191. <ConditionGroup>
  192. <Condition name="EndCondition" delay="3" conditionEdge="rising">
  193. <ByEntityCondition>
  194. <TriggeringEntities triggeringEntitiesRule="any">
  195. <EntityRef entityRef="hero"/>
  196. </TriggeringEntities>
  197. <EntityCondition>
  198. <TraveledDistanceCondition value="800.0"/>
  199. <!-- origin 200 -->
  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>