Skip to content

Commit

Permalink
Merge pull request #38 from arauschert/CARLA_support
Browse files Browse the repository at this point in the history
Carla Linux support
  • Loading branch information
arauschert committed Apr 20, 2021
2 parents 0ce2c9e + 6185a87 commit edc9c24
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 36 deletions.
6 changes: 4 additions & 2 deletions Catalogs/Vehicles/VehicleCatalog.xosc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
<FileHeader revMajor="1" revMinor="0" date="2020-07-10T10:00:00" author="BMW AG" description="Vehicle catalog" />
<Catalog name="VehicleCatalog">
<Vehicle name="car_ego" vehicleCategory="car">
<Properties>
<!-- Properties are necessary for simulation with openPASS -->
<Properties>
<!-- Property is necessary for simulation with CARLA -->
<Property name="type" value="ego_vehicle"/>
<!-- Properties are necessary for simulation with openPASS -->
<Property name="AirDragCoefficient" value="0.3"/>
<Property name="AxleRatio" value="1.0"/>
<Property name="DecelerationFromPowertrainDrag" value="0.5"/>
Expand Down
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ The implementation of the scenarios should as well be conducted using an interna

The focus of the scenarios is on securing the planning aspects of an "Automated Lane Keeping System". By extending the scenarios with references to e.g. 3D models or environmental conditions (e.g. light, rain), aspects of sensor and actuator technology could also be simulated and validated.

## Usage
## Running on Windows

The execution in the open source tools "esmini", a basic OpenSCENARIO player, and "openPASS", a simulation platform for traffic simulation, is described on Windows:

_Note:_ The execution with openPASS expects xsltproc on the system path. Check out the "Notes regarding openPASS" for more information.

1. Clone or download the repository to your local drive.
2. a) Download the [latest esmini release](https://github.com/esmini/esmini/releases) (e.g. esmini-bin_win_x64.zip) (tested successfully with [esmini 2.0.3](https://github.com/esmini/esmini/releases/tag/v2.0.3)),
1. Clone or download this repository to your local drive.
2. a) Download the [latest esmini release](https://github.com/esmini/esmini/releases) (e.g. esmini-bin_win_x64.zip) (tested successfully with [esmini 2.7.2](https://github.com/esmini/esmini/releases/tag/v2.7.2)),
or
b) Download the [latest openPASS release](https://gitlab.eclipse.org/eclipse/simopenpass/simopenpass) (tested successfully with [openPASS v0.7](https://gitlab.eclipse.org/eclipse/simopenpass/simopenpass/-/tree/openPASS_0.7))
3. a) Create an environment variable "ESMINI", which directs to the "bin" folder of esmini. E.g. "C:\MyFolder\esmini\bin\",
Expand All @@ -35,7 +35,6 @@ b) Create an environment variable "OPENPASS", which directs to the installation
4. Execute the script "run_Scenario.bat", located in the "Scenarios" folder of the local repository
5. By changing the parameter values in the parameter declaration section of the OpenSCENARIO files, the concrete scenarios can be varied.


#### Notes regarding esmini:

Esmini is an environment simulator with a visualization and does not provide an ALKS. Therefore, for demonstration purposes the vehicle under test is controlled by a so called "default controller", which is provided by esmini. This controller type is defined by the OpenSCENARIO standard as a controller that only maintains the speed and lane offset without taking other traffic participants into account.
Expand All @@ -57,6 +56,22 @@ Similar to esmini, openPASS does not provide an ALKS. Therefore, for demonstrati

Currently openPASS does not support the controller concept of OpenSCENARIO. Instead, entities and their controlling components are defined in the ProfilesCatalog.xml. Sourrounding entities are also controlled by the Algorithm Following Driver Model. Therefore, the velocities of the surrounding entities may differ slightly from the definitions in the scenarios.

## Running on Linux

The execution in the open source simulator "CARLA" under Ubuntu 20.04 is described here:
1. Clone or download this repository to your local drive.
2. Download CARLA and the compatible scenario-runner for CARLA (tested successfully with [CARLA 0.9.11](https://github.com/carla-simulator/carla/releases/tag/0.9.11) and [scenario_runner-0.9.11](https://github.com/carla-simulator/scenario_runner/releases/tag/v0.9.11)
3. Follow the installation instructions for [CARLA](https://carla.readthedocs.io/en/0.9.11/) and the [scenario_runner](https://github.com/carla-simulator/scenario_runner/blob/master/Docs/getting_scenariorunner.md) (be sure to install all the required tools and libs from requirements.txt (mentioned in "Installation summary" and to set the environment variables (mentioned in "B. Download ScenarioRunner from source"))
4. Once you can run the .xosc scenarios delivered with CARLA, run the ALKS scenarios like this:
a) Start the CARLA simulator: Go to the CARLA installation folder and type "./CarlaUE4.sh"
b) Start the scenario runner: Go to the scenario_runner installation folder and type e.g. "python scenario_runner.py --openscenario /path/to/OSC-ALKS-scenarios/Scenarios/ALKS_Scenario_4.1_1_FreeDriving_TEMPLATE.xosc"

Execution with esmini or openPASS on Linux hasn't been tested yet.

#### Notes regarding CARLA

With CARLA version 0.9.11 the following scenarios are supported: 4.1_1, 4.2_1, 4.2_2, 4.2_4 (4.2 only if the pedestrian is modeled directly in the scenario and not in a catalog or is exchanged by a vehicle).

## Quality Measures

As a first proof-of-concept the scenarios have been integrated and simulated in [openPASS 0.7](https://git.eclipse.org/c/simopenpass/simopenpass.git/tag/?h=openPASS_0.7) at BMW. In addition the open source tool esmini can be used as described above.
Expand Down
2 changes: 1 addition & 1 deletion Scenarios/ALKS_Scenario_4.1_1_FreeDriving_TEMPLATE.xosc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="-4" offset="0.0" s="0.0"></LanePosition>
<LanePosition roadId="0" laneId="-4" offset="0.0" s="5.0"></LanePosition>
</Position>
</TeleportAction>
</PrivateAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="0.0"></LanePosition>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="5.0"></LanePosition>
</Position>
</TeleportAction>
</PrivateAction>
Expand All @@ -66,7 +66,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="$LeadVehicle_InitDistance_dx0"></LanePosition>
<RelativeLanePosition entityRef="Ego" dLane="0" ds="$LeadVehicle_InitDistance_dx0" offset="0.0" />
</Position>
</TeleportAction>
</PrivateAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ParameterDeclaration name="Duration" parameterType="double" value="40" />
<ParameterDeclaration name="SideVehicle_Model" parameterType="string" value="car" />
<ParameterDeclaration name="SideVehicle_InitLongitudinalOffset" parameterType="double" value="0.0" />
<ParameterDeclaration name="SideVehicle_InitPosition_LaneId" parameterType="string" value="-3" />
<ParameterDeclaration name="SideVehicle_InitPosition_RelativeLaneId" parameterType="string" value="1" />
<ParameterDeclaration name="Swerve_Offset_Left" parameterType="double" value="1.0" />
<ParameterDeclaration name="Swerve_Offset_Right" parameterType="double" value="-1.0" />
<ParameterDeclaration name="Swerve_MaxLateralAcc" parameterType="double" value="0.3" />
Expand Down Expand Up @@ -47,7 +47,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="-4" offset="0.0" s="0.0"></LanePosition>
<LanePosition roadId="0" laneId="-4" offset="0.0" s="5.0"></LanePosition>
</Position>
</TeleportAction>
</PrivateAction>
Expand All @@ -66,7 +66,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="$SideVehicle_InitPosition_LaneId" s="$SideVehicle_InitLongitudinalOffset"></LanePosition>
<RelativeLanePosition entityRef="Ego" dLane="$SideVehicle_InitPosition_RelativeLaneId" ds="$SideVehicle_InitLongitudinalOffset" offset="0.0" />
</Position>
</TeleportAction>
</PrivateAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="0.0"></LanePosition>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="5.0"></LanePosition>
</Position>
</TeleportAction>
</PrivateAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="0.0"></LanePosition>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="5.0"></LanePosition>
</Position>
</TeleportAction>
</PrivateAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="0.0"></LanePosition>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="5.0"></LanePosition>
</Position>
</TeleportAction>
</PrivateAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="0.0"></LanePosition>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="5.0"></LanePosition>
</Position>
</TeleportAction>
</PrivateAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="0.0"></LanePosition>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="5.0"></LanePosition>
</Position>
</TeleportAction>
</PrivateAction>
Expand All @@ -66,7 +66,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="$LeadVehicle_InitDistance_dx0"></LanePosition>
<RelativeLanePosition entityRef="Ego" dLane="0" ds="$LeadVehicle_InitDistance_dx0" offset="0.0" />
</Position>
</TeleportAction>
</PrivateAction>
Expand All @@ -75,7 +75,7 @@
<SpeedAction>
<SpeedActionDynamics dynamicsShape="step" dynamicsDimension="time" value="0" />
<SpeedActionTarget>
<RelativeTargetSpeed entityRef="Ego" value="0" speedTargetValueType="delta" continuous="false" />
<AbsoluteTargetSpeed value="$Ego_InitSpeed_Ve0" />
</SpeedActionTarget>
</SpeedAction>
</LongitudinalAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="0.0"></LanePosition>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="5.0"></LanePosition>
</Position>
</TeleportAction>
</PrivateAction>
Expand All @@ -64,7 +64,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="$LeadVehicle_InitDistance_dx0"></LanePosition>
<RelativeLanePosition entityRef="Ego" dLane="0" ds="$LeadVehicle_InitDistance_dx0" offset="0.0" />
</Position>
</TeleportAction>
</PrivateAction>
Expand All @@ -73,7 +73,7 @@
<SpeedAction>
<SpeedActionDynamics dynamicsShape="step" dynamicsDimension="time" value="0" />
<SpeedActionTarget>
<RelativeTargetSpeed entityRef="Ego" value="0" speedTargetValueType="delta" continuous="false" />
<AbsoluteTargetSpeed value="$Ego_InitSpeed_Ve0" />
</SpeedActionTarget>
</SpeedAction>
</LongitudinalAction>
Expand Down
4 changes: 2 additions & 2 deletions Scenarios/ALKS_Scenario_4.4_1_CutInNoCollision_TEMPLATE.xosc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="-4" offset="0.0" s="0.0"></LanePosition>
<LanePosition roadId="0" laneId="-4" offset="0.0" s="5.0"></LanePosition>
</Position>
</TeleportAction>
</PrivateAction>
Expand All @@ -67,7 +67,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<RelativeLanePosition entityRef="Ego" dLane="$CutInVehicle_InitPosition_RelativeLaneId" ds="80.0" offset="0.0" />
<RelativeLanePosition entityRef="Ego" dLane="$CutInVehicle_InitPosition_RelativeLaneId" ds="85.0" offset="0.0" />
</Position>
</TeleportAction>
</PrivateAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="-4" offset="0.0" s="0.0"></LanePosition>
<LanePosition roadId="0" laneId="-4" offset="0.0" s="5.0"></LanePosition>
</Position>
</TeleportAction>
</PrivateAction>
Expand All @@ -67,7 +67,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<RelativeLanePosition entityRef="Ego" dLane="$CutInVehicle_InitPosition_RelativeLaneId" ds="50.0" offset="0.0" />
<RelativeLanePosition entityRef="Ego" dLane="$CutInVehicle_InitPosition_RelativeLaneId" ds="55.0" offset="0.0" />
</Position>
</TeleportAction>
</PrivateAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ParameterDeclaration name="Ego_InitPosition_LaneId" parameterType="string" value="-4" />
<ParameterDeclaration name="Ego_InitSpeed_Ve0" parameterType="double" value="16.66666667" />
<ParameterDeclaration name="Duration" parameterType="double" value="40" />
<ParameterDeclaration name="LeadVehicle_InitDistance_dx0" parameterType="double" value="33.33333333" />
<ParameterDeclaration name="LeadVehicle_InitDistance_dx0" parameterType="double" value="38.33333333" />
<ParameterDeclaration name="FrontOfLead_Distance_dx0_f" parameterType="double" value="50.0" />
<ParameterDeclaration name="Lateral_Velocity_Vy" parameterType="double" value="2.0" />
<ParameterDeclaration name="TargetBlocking_Catalog" parameterType="string" value="PedestrianCatalog" />
Expand Down Expand Up @@ -50,7 +50,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="0.0"></LanePosition>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="5.0"></LanePosition>
</Position>
</TeleportAction>
</PrivateAction>
Expand Down Expand Up @@ -89,7 +89,7 @@
<SpeedAction>
<SpeedActionDynamics dynamicsShape="step" dynamicsDimension="time" value="0" />
<SpeedActionTarget>
<RelativeTargetSpeed entityRef="Ego" value="0" speedTargetValueType="delta" continuous="false" />
<AbsoluteTargetSpeed value="$Ego_InitSpeed_Ve0" />
</SpeedActionTarget>
</SpeedAction>
</LongitudinalAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ParameterDeclaration name="Ego_InitPosition_LaneId" parameterType="string" value="-4" />
<ParameterDeclaration name="Ego_InitSpeed_Ve0" parameterType="double" value="16.66666667" />
<ParameterDeclaration name="Duration" parameterType="double" value="40" />
<ParameterDeclaration name="LeadVehicle_InitDistance_dx0" parameterType="double" value="33.33333333" />
<ParameterDeclaration name="LeadVehicle_InitDistance_dx0" parameterType="double" value="38.33333333" />
<ParameterDeclaration name="FrontOfLead_Distance_dx0_f" parameterType="double" value="50.0" />
<ParameterDeclaration name="Lateral_Velocity_Vy" parameterType="double" value="2.0" />
<ParameterDeclaration name="TargetBlocking_Catalog" parameterType="string" value="PedestrianCatalog" />
Expand Down Expand Up @@ -54,7 +54,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="0.0"></LanePosition>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="5.0"></LanePosition>
</Position>
</TeleportAction>
</PrivateAction>
Expand Down Expand Up @@ -100,7 +100,7 @@
<SpeedAction>
<SpeedActionDynamics dynamicsShape="step" dynamicsDimension="time" value="0" />
<SpeedActionTarget>
<RelativeTargetSpeed entityRef="Ego" value="0" speedTargetValueType="delta" continuous="false" />
<AbsoluteTargetSpeed value="$Ego_InitSpeed_Ve0" />
</SpeedActionTarget>
</SpeedAction>
</LongitudinalAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="0.0"></LanePosition>
<LanePosition roadId="0" laneId="$Ego_InitPosition_LaneId" offset="0.0" s="5.0"></LanePosition>
</Position>
</TeleportAction>
</PrivateAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ParameterDeclaration name="Ego_InitSpeed_Ve0" parameterType="double" value="16.66666667" />
<ParameterDeclaration name="Duration" parameterType="double" value="40" />
<ParameterDeclaration name="SideVehicle_InitLongitudinalOffset" parameterType="double" value="0.0" />
<ParameterDeclaration name="SideVehicle_InitPosition_LaneId" parameterType="string" value="-5" />
<ParameterDeclaration name="SideVehicle_InitPosition_RelativeLaneId" parameterType="string" value="-1" />
<ParameterDeclaration name="SideVehicle_InitLateralOffset" parameterType="double" value="-1.75" />
<ParameterDeclaration name="Swerve_Offset_Left" parameterType="double" value="1.5" />
<ParameterDeclaration name="Swerve_Offset_Right" parameterType="double" value="-0.0" />
Expand Down Expand Up @@ -47,7 +47,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="-4" offset="0.0" s="0.0"></LanePosition>
<LanePosition roadId="0" laneId="-4" offset="0.0" s="5.0"></LanePosition>
</Position>
</TeleportAction>
</PrivateAction>
Expand All @@ -66,7 +66,7 @@
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="0" laneId="$SideVehicle_InitPosition_LaneId" s="$SideVehicle_InitLongitudinalOffset" offset="$SideVehicle_InitLateralOffset"></LanePosition>
<RelativeLanePosition entityRef="Ego" dLane="$SideVehicle_InitPosition_RelativeLaneId" ds="$SideVehicle_InitLongitudinalOffset" offset="$SideVehicle_InitLateralOffset" />
</Position>
</TeleportAction>
</PrivateAction>
Expand Down

0 comments on commit edc9c24

Please sign in to comment.