CyclistCrossing.xosc 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. <?xml version="1.0"?>
  2. <OpenSCENARIO>
  3. <FileHeader revMajor="1" revMinor="0" date="2020-03-24T12:00:00" description="CARLA:CyclistCrossing" 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.diamondback.century" 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="130" 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="95.5" y="41" z="0.2" h="3.14159265359"/>
  95. </Position>
  96. </TeleportAction>
  97. </PrivateAction>
  98. <PrivateAction>
  99. <ControllerAction>
  100. <AssignControllerAction>
  101. <Controller name="AdversaryAgent">
  102. <Properties>
  103. <Property name="module" value="vehicle_longitudinal_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="CyclistCrossingManeuver">
  127. <Event name="CyclistStartsWalking" priority="overwrite">
  128. <Action name="CyclistStartsWalking">
  129. <PrivateAction>
  130. <LongitudinalAction>
  131. <SpeedAction>
  132. <SpeedActionDynamics dynamicsShape="step" value="1.5" dynamicsDimension="distance"/>
  133. <SpeedActionTarget>
  134. <AbsoluteTargetSpeed value="2.0"/>
  135. </SpeedActionTarget>
  136. </SpeedAction>
  137. </LongitudinalAction>
  138. </PrivateAction>
  139. </Action>
  140. <StartTrigger>
  141. <ConditionGroup>
  142. <Condition name="StartCondition" delay="0" conditionEdge="rising">
  143. <ByEntityCondition>
  144. <TriggeringEntities triggeringEntitiesRule="any">
  145. <EntityRef entityRef="hero"/>
  146. </TriggeringEntities>
  147. <EntityCondition>
  148. <RelativeDistanceCondition entityRef="adversary" relativeDistanceType="cartesianDistance" value="14.0" freespace="false" rule="lessThan"/>
  149. </EntityCondition>
  150. </ByEntityCondition>
  151. </Condition>
  152. </ConditionGroup>
  153. </StartTrigger>
  154. </Event>
  155. <Event name="CyclistStopsAndWaits" priority="overwrite">
  156. <Action name="CyclistStopsAndWaits">
  157. <PrivateAction>
  158. <LongitudinalAction>
  159. <SpeedAction>
  160. <SpeedActionDynamics dynamicsShape="step" value="10" dynamicsDimension="time"/>
  161. <SpeedActionTarget>
  162. <AbsoluteTargetSpeed value="0.0"/>
  163. </SpeedActionTarget>
  164. </SpeedAction>
  165. </LongitudinalAction>
  166. </PrivateAction>
  167. </Action>
  168. <StartTrigger>
  169. <ConditionGroup>
  170. <Condition name="StartCondition" delay="0" conditionEdge="rising">
  171. <ByEntityCondition>
  172. <TriggeringEntities triggeringEntitiesRule="any">
  173. <EntityRef entityRef="adversary"/>
  174. </TriggeringEntities>
  175. <EntityCondition>
  176. <StandStillCondition duration="0.1"/>
  177. </EntityCondition>
  178. </ByEntityCondition>
  179. </Condition>
  180. <Condition name="AfterCyclistStartsWalking" delay="0" conditionEdge="rising">
  181. <ByValueCondition>
  182. <StoryboardElementStateCondition storyboardElementType="action" storyboardElementRef="CyclistStartsWalking" state="completeState"/>
  183. </ByValueCondition>
  184. </Condition>
  185. </ConditionGroup>
  186. </StartTrigger>
  187. </Event>
  188. <Event name="CyclistWalksAway" priority="overwrite">
  189. <Action name="CyclistStartsWalkingAway">
  190. <PrivateAction>
  191. <LongitudinalAction>
  192. <SpeedAction>
  193. <SpeedActionDynamics dynamicsShape="step" value="6.5" dynamicsDimension="distance"/>
  194. <SpeedActionTarget>
  195. <AbsoluteTargetSpeed value="2.0"/>
  196. </SpeedActionTarget>
  197. </SpeedAction>
  198. </LongitudinalAction>
  199. </PrivateAction>
  200. </Action>
  201. <StartTrigger>
  202. <ConditionGroup>
  203. <Condition name="StartCondition" delay="0" conditionEdge="rising">
  204. <ByEntityCondition>
  205. <TriggeringEntities triggeringEntitiesRule="any">
  206. <EntityRef entityRef="hero"/>
  207. </TriggeringEntities>
  208. <EntityCondition>
  209. <StandStillCondition duration="0.1"/>
  210. </EntityCondition>
  211. </ByEntityCondition>
  212. </Condition>
  213. <Condition name="AfterCyclistStopsAndWaits" delay="0" conditionEdge="rising">
  214. <ByValueCondition>
  215. <StoryboardElementStateCondition storyboardElementType="action" storyboardElementRef="CyclistStopsAndWaits" state="completeState"/>
  216. </ByValueCondition>
  217. </Condition>
  218. </ConditionGroup>
  219. </StartTrigger>
  220. </Event>
  221. <Event name="CyclistWaits" priority="overwrite">
  222. <Action name="CyclistWaits">
  223. <PrivateAction>
  224. <LongitudinalAction>
  225. <SpeedAction>
  226. <SpeedActionDynamics dynamicsShape="step" value="10" dynamicsDimension="time"/>
  227. <SpeedActionTarget>
  228. <AbsoluteTargetSpeed value="0.0"/>
  229. </SpeedActionTarget>
  230. </SpeedAction>
  231. </LongitudinalAction>
  232. </PrivateAction>
  233. </Action>
  234. <StartTrigger>
  235. <ConditionGroup>
  236. <Condition name="StartCondition" delay="0" conditionEdge="rising">
  237. <ByEntityCondition>
  238. <TriggeringEntities triggeringEntitiesRule="any">
  239. <EntityRef entityRef="adversary"/>
  240. </TriggeringEntities>
  241. <EntityCondition>
  242. <StandStillCondition duration="0.1"/>
  243. </EntityCondition>
  244. </ByEntityCondition>
  245. </Condition>
  246. <Condition name="AfterCyclistStartsWalking" delay="0" conditionEdge="rising">
  247. <ByValueCondition>
  248. <StoryboardElementStateCondition storyboardElementType="action" storyboardElementRef="CyclistStartsWalkingAway" state="completeState"/>
  249. </ByValueCondition>
  250. </Condition>
  251. </ConditionGroup>
  252. </StartTrigger>
  253. </Event>
  254. </Maneuver>
  255. </ManeuverGroup>
  256. <StartTrigger>
  257. <ConditionGroup>
  258. <Condition name="OverallStartCondition" delay="0" conditionEdge="rising">
  259. <ByEntityCondition>
  260. <TriggeringEntities triggeringEntitiesRule="any">
  261. <EntityRef entityRef="hero"/>
  262. </TriggeringEntities>
  263. <EntityCondition>
  264. <TraveledDistanceCondition value="10.0"/>
  265. </EntityCondition>
  266. </ByEntityCondition>
  267. </Condition>
  268. </ConditionGroup>
  269. </StartTrigger>
  270. <StopTrigger>
  271. <ConditionGroup>
  272. <Condition name="EndCondition" delay="0" conditionEdge="rising">
  273. <ByEntityCondition>
  274. <TriggeringEntities triggeringEntitiesRule="any">
  275. <EntityRef entityRef="hero"/>
  276. </TriggeringEntities>
  277. <EntityCondition>
  278. <TraveledDistanceCondition value="200.0"/>
  279. </EntityCondition>
  280. </ByEntityCondition>
  281. </Condition>
  282. </ConditionGroup>
  283. </StopTrigger>
  284. </Act>
  285. </Story>
  286. <StopTrigger>
  287. <ConditionGroup>
  288. <Condition name="criteria_RunningStopTest" delay="0" conditionEdge="rising">
  289. <ByValueCondition>
  290. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  291. </ByValueCondition>
  292. </Condition>
  293. <Condition name="criteria_RunningRedLightTest" delay="0" conditionEdge="rising">
  294. <ByValueCondition>
  295. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  296. </ByValueCondition>
  297. </Condition>
  298. <Condition name="criteria_WrongLaneTest" delay="0" conditionEdge="rising">
  299. <ByValueCondition>
  300. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  301. </ByValueCondition>
  302. </Condition>
  303. <Condition name="criteria_OnSidewalkTest" delay="0" conditionEdge="rising">
  304. <ByValueCondition>
  305. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  306. </ByValueCondition>
  307. </Condition>
  308. <Condition name="criteria_KeepLaneTest" delay="0" conditionEdge="rising">
  309. <ByValueCondition>
  310. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  311. </ByValueCondition>
  312. </Condition>
  313. <Condition name="criteria_CollisionTest" delay="0" conditionEdge="rising">
  314. <ByValueCondition>
  315. <ParameterCondition parameterRef="" value="" rule="lessThan"/>
  316. </ByValueCondition>
  317. </Condition>
  318. <Condition name="criteria_DrivenDistanceTest" delay="0" conditionEdge="rising">
  319. <ByValueCondition>
  320. <ParameterCondition parameterRef="distance_success" value="100" rule="lessThan"/>
  321. </ByValueCondition>
  322. </Condition>
  323. </ConditionGroup>
  324. </StopTrigger>
  325. </Storyboard>
  326. </OpenSCENARIO>