Skip to content
Snippets Groups Projects
Commit 15c9c985 authored by David Weiß's avatar David Weiß Committed by Reinhard Biegel
Browse files

feat(Global): Support for roll angle and improved OpenSCENARIO vehicle models


Multiple components have been adapted for roll angle support.
Vehicle models parameters are now structured like in OpenSCENARIO XML.

Signed-off-by: default avatarWeiss David <david.weiss@in-tech.com>
parent 0c090cf6
No related branches found
No related tags found
2 merge requests!64Merge 0.8,!18New features and bugfixes and build system improvements
Showing
with 420 additions and 593 deletions
......@@ -25,7 +25,7 @@
<Center x="1.25" y="0.0" z="0.84"/>
<Dimensions width="2.04" length="3.96" height="1.68"/>
</BoundingBox>
<Performance maxSpeed="41.67" maxDeceleration="9.80665"/>
<Performance maxSpeed="41.67" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.5282" wheelDiameter="0.682" trackWidth="1.8" positionX="2.52" positionZ="0.341"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.682" trackWidth="1.8" positionX="0.0" positionZ="0.341"/>
......@@ -61,7 +61,7 @@
<Center x="1.285" y="0.0" z="0.72"/>
<Dimensions width="1.96" length="4.63" height="1.44"/>
</BoundingBox>
<Performance maxSpeed="69.44" maxDeceleration="9.80665"/>
<Performance maxSpeed="69.44" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.5012" wheelDiameter="0.634" trackWidth="1.8" positionX="2.81" positionZ="0.317"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.634" trackWidth="1.8" positionX="0.0" positionZ="0.317"/>
......@@ -97,7 +97,7 @@
<Center x="1.46" y="0.0" z="0.755"/>
<Dimensions width="2.18" length="5.26" height="1.51"/>
</BoundingBox>
<Performance maxSpeed="69.44" maxDeceleration="9.80665"/>
<Performance maxSpeed="69.44" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.5226" wheelDiameter="0.682" trackWidth="1.8" positionX="3.22" positionZ="0.341"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.682" trackWidth="1.8" positionX="0.0" positionZ="0.341"/>
......@@ -133,7 +133,7 @@
<Center x="1.485" y="0.0" z="0.745"/>
<Dimensions width="2.16" length="5.27" height="1.49"/>
</BoundingBox>
<Performance maxSpeed="69.44" maxDeceleration="9.80665"/>
<Performance maxSpeed="69.44" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.5279" wheelDiameter="0.682" trackWidth="1.8" positionX="3.25" positionZ="0.341"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.682" trackWidth="1.8" positionX="0.0" positionZ="0.341"/>
......@@ -168,7 +168,7 @@
<Center x="1.35" y="0.0" z="0.71"/>
<Dimensions width="1.89" length="3.8" height="1.42"/>
</BoundingBox>
<Performance maxSpeed="58.33" maxDeceleration="9.80665"/>
<Performance maxSpeed="58.33" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.4766" wheelDiameter="0.59" trackWidth="1.8" positionX="2.48" positionZ="0.295"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.59" trackWidth="1.8" positionX="0.0" positionZ="0.295"/>
......@@ -204,7 +204,7 @@
<Center x="2.815" y="0.0" z="1.92"/>
<Dimensions width="2.91" length="13.23" height="3.84"/>
</BoundingBox>
<Performance maxSpeed="33.33" maxDeceleration="9.80665"/>
<Performance maxSpeed="33.33" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.6972" wheelDiameter="0.808" trackWidth="1.8" positionX="6.64" positionZ="0.404"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.808" trackWidth="1.8" positionX="0.0" positionZ="0.404"/>
......@@ -240,7 +240,7 @@
<Center x="2.685" y="0.0" z="1.74"/>
<Dimensions width="3.16" length="8.83" height="3.48"/>
</BoundingBox>
<Performance maxSpeed="25.0" maxDeceleration="9.80665"/>
<Performance maxSpeed="25.0" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.4352" wheelDiameter="0.808" trackWidth="1.8" positionX="4.36" positionZ="0.404"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.808" trackWidth="1.8" positionX="0.0" positionZ="0.404"/>
......@@ -274,7 +274,7 @@
<Center x="0.175" y="0.0" z="0.9325"/>
<Dimensions width="0.5" length="1.89" height="1.865"/>
</BoundingBox>
<Performance maxSpeed="10.0" maxDeceleration="9.80665"/>
<Performance maxSpeed="10.0" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="1.5708" wheelDiameter="0.636" trackWidth="0.1" positionX="1.04" positionZ="0.318"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.636" trackWidth="0.1" positionX="0.0" positionZ="0.318"/>
......
<Profiles SchemaVersion="0.4.3">
<AgentProfiles>
<AgentProfile Name="LuxuryClassCarAgent" Type="Dynamic">
<DriverProfiles>
<DriverProfile Name="Regular" Probability="1.0"/>
</DriverProfiles>
<VehicleProfiles>
<VehicleProfile Name="BMW 7 g12 2016" Probability="0.5"/>
<VehicleProfile Name="BMW 7 f01 2010" Probability="0.5"/>
</VehicleProfiles>
</AgentProfile>
<AgentProfile Name="MiddleClassCarAgent" Type="Dynamic">
<DriverProfiles>
<DriverProfile Name="Regular" Probability="1.0"/>
</DriverProfiles>
<VehicleProfiles>
<VehicleProfile Name="Mini Cooper f56 2015" Probability="0.4"/>
<VehicleProfile Name="BMW i3 i01 2013" Probability="0.3"/>
<VehicleProfile Name="BMW 3 f30 2015" Probability="0.3"/>
</VehicleProfiles>
</AgentProfile>
<AgentProfile Name="TruckAgent" Type="Dynamic">
<DriverProfiles>
<DriverProfile Name="RegularTruck" Probability="1.0"/>
</DriverProfiles>
<VehicleProfiles>
<VehicleProfile Name="Truck Hyundai Xcient p540 4axle 2013" Probability="1.0"/>
</VehicleProfiles>
</AgentProfile>
<AgentProfile Name="BusAgent" Type="Dynamic">
<DriverProfiles>
<DriverProfile Name="RegularBus" Probability="1.0"/>
</DriverProfiles>
<VehicleProfiles>
<VehicleProfile Name="Bus MAN Lions Coach c 2007" Probability="1.0"/>
</VehicleProfiles>
</AgentProfile>
<AgentProfile Name="Pedestrian" Type="Dynamic">
<DriverProfiles>
<DriverProfile Name="Pedestrian" Probability="1.0"/>
</DriverProfiles>
<VehicleProfiles>
<VehicleProfile Name="Pedestrian" Probability="1.0"/>
</VehicleProfiles>
</AgentProfile>
</AgentProfiles>
<VehicleProfiles>
<VehicleProfile Name="BMW 7 g12 2016">
<Model Name="car_bmw_7_1"/>
<Components/>
<Sensors/>
</VehicleProfile>
<VehicleProfile Name="BMW 7 f01 2010">
<Model Name="car_bmw_7_2"/>
<Components/>
<Sensors/>
</VehicleProfile>
<VehicleProfile Name="Mini Cooper f56 2015">
<Model Name="car_mini_cooper"/>
<Components/>
<Sensors/>
</VehicleProfile>
<VehicleProfile Name="BMW i3 i01 2013">
<Model Name="car_bmw_i3"/>
<Components/>
<Sensors/>
</VehicleProfile>
<VehicleProfile Name="BMW 3 f30 2015">
<Model Name="car_bmw_3"/>
<Components/>
<Sensors/>
</VehicleProfile>
<VehicleProfile Name="Truck Hyundai Xcient p540 4axle 2013">
<Model Name="truck"/>
<Components/>
<Sensors/>
</VehicleProfile>
<VehicleProfile Name="Bus MAN Lions Coach c 2007">
<Model Name="bus"/>
<Components/>
<Sensors/>
</VehicleProfile>
<VehicleProfile Name="Pedestrian">
<Model Name="pedestrian_adult"/>
<Components/>
<Sensors/>
</VehicleProfile>
</VehicleProfiles>
<ProfileGroup Type="Driver">
<Profile Name="Pedestrian">
<String Key="Type" Value="AlgorithmAgentFollowingDriverModel"/>
<String Key="AlgorithmLateralModule" Value="Algorithm_LateralAfdm"/>
<String Key="AlgorithmLongitudinalModule" Value="Algorithm_LongitudinalAfdm"/>
<Double Key="VelocityWish" Value="1.0"/>
</Profile>
<Profile Name="Regular">
<String Key="Type" Value="AlgorithmAgentFollowingDriverModel"/>
<String Key="AlgorithmLateralModule" Value="Algorithm_LateralAfdm"/>
<String Key="AlgorithmLongitudinalModule" Value="Algorithm_LongitudinalAfdm"/>
<Double Key="VelocityWish" Value="36.11"/>
<Double Key="Delta" Value="4.0"/>
<Double Key="TGapWish" Value="1.5"/>
<Double Key="MinDistance" Value="2.0"/>
<Double Key="MaxAcceleration" Value="1.4"/>
<Double Key="MaxDeceleration" Value="2.0"/>
</Profile>
<Profile Name="RegularBus">
<String Key="Type" Value="AlgorithmAgentFollowingDriverModel"/>
<String Key="AlgorithmLateralModule" Value="Algorithm_LateralAfdm"/>
<String Key="AlgorithmLongitudinalModule" Value="Algorithm_LongitudinalAfdm"/>
<Double Key="VelocityWish" Value="24.24"/>
<Double Key="Delta" Value="4.0"/>
<Double Key="TGapWish" Value="1.5"/>
<Double Key="MinDistance" Value="2.0"/>
<Double Key="MaxAcceleration" Value="1.4"/>
<Double Key="MaxDeceleration" Value="2.0"/>
</Profile>
<Profile Name="RegularTruck">
<String Key="Type" Value="AlgorithmAgentFollowingDriverModel"/>
<String Key="AlgorithmLateralModule" Value="Algorithm_LateralAfdm"/>
<String Key="AlgorithmLongitudinalModule" Value="Algorithm_LongitudinalAfdm"/>
<Double Key="VelocityWish" Value="24.24"/>
<Double Key="Delta" Value="4.0"/>
<Double Key="TGapWish" Value="1.5"/>
<Double Key="MinDistance" Value="2.0"/>
<Double Key="MaxAcceleration" Value="1.4"/>
<Double Key="MaxDeceleration" Value="2.0"/>
</Profile>
</ProfileGroup>
<ProfileGroup Type="TrafficGroup">
<Profile Name="LightVehicles">
<List Name="AgentProfiles">
<ListItem>
<String Key="Name" Value="LuxuryClassCarAgent"/>
<Double Key="Weight" Value="0.4"/>
</ListItem>
<ListItem>
<String Key="Name" Value="MiddleClassCarAgent"/>
<Double Key="Weight" Value="0.6"/>
</ListItem>
</List>
<NormalDistribution Key="Velocity" Max="43.685" Mean="31.475" Min="19.265" SD="6.105"/>
<LogNormalDistribution Key="TGap" Max="80" Min="0.5" Mu="1.5" Sigma="1.7"/>
<DoubleVector Key="Homogeneity" Value="0.820, 1.0"/>
</Profile>
<Profile Name="HeavyVehicles">
<List Name="AgentProfiles">
<ListItem>
<String Key="Name" Value="TruckAgent"/>
<Double Key="Weight" Value="1.0"/>
</ListItem>
<ListItem>
<String Key="Name" Value="BusAgent"/>
<Double Key="Weight" Value="1.0"/>
</ListItem>
</List>
<NormalDistribution Key="Velocity" Max="25" Mean="22.22" Min="19.44" SD="1.39"/>
<LogNormalDistribution Key="TGap" Max="100" Min="0.5" Mu="1.94" Sigma="2.35"/>
<Bool Key="RightLaneOnly" Value="true"/>
</Profile>
</ProfileGroup>
<ProfileGroup Type="Spawner">
<Profile Name="DefaultPreRunCommon">
<List Name="SpawnPoints">
<ListItem>
<StringVector Key="Roads" Value="1"/>
<IntVector Key="Lanes" Value="-1,-2,-3,-4,-5"/>
<Double Key="SStart" Value="0.0"/>
<Double Key="SEnd" Value="1000.0"/>
</ListItem>
</List>
<List Name="TrafficGroups">
<ListItem>
<Double Key="Weight" Value="4"/>
<Reference Type="TrafficGroup" Name="LightVehicles"/>
</ListItem>
<ListItem>
<Double Key="Weight" Value="1"/>
<Reference Type="TrafficGroup" Name="HeavyVehicles"/>
</ListItem>
</List>
</Profile>
<Profile Name="DefaultRuntimeCommon">
<List Name="SpawnPoints">
<ListItem>
<StringVector Key="Roads" Value="1"/>
<IntVector Key="Lanes" Value="-1,-2,-3,-4,-5"/>
<Double Key="SCoordinate" Value="0.0"/>
</ListItem>
</List>
<List Name="TrafficGroups">
<ListItem>
<Double Key="Weight" Value="4"/>
<Reference Type="TrafficGroup" Name="LightVehicles"/>
</ListItem>
<ListItem>
<Double Key="Weight" Value="1"/>
<Reference Type="TrafficGroup" Name="HeavyVehicles"/>
</ListItem>
</List>
</Profile>
</ProfileGroup>
</Profiles>
<?xml version="1.0"?>
<OpenSCENARIO>
<FileHeader revMajor="1" revMinor="0" date="2020-06-26T00:17:00" description="openPASS default scenario" author="in-tech GmbH"/>
<ParameterDeclarations>
<ParameterDeclaration name="OP_OSC_SchemaVersion" parameterType="string" value="0.4.0"/>
</ParameterDeclarations>
<CatalogLocations>
<VehicleCatalog>
<Directory path="VehicleModelsCatalog.xosc"/>
</VehicleCatalog>
<PedestrianCatalog>
<Directory path="PedestrianModelsCatalog.xosc"/>
</PedestrianCatalog>
<ControllerCatalog>
<Directory path=""/>
</ControllerCatalog>
<ManeuverCatalog>
<Directory path=""/>
</ManeuverCatalog>
<MiscObjectCatalog>
<Directory path=""/>
</MiscObjectCatalog>
<EnvironmentCatalog>
<Directory path=""/>
</EnvironmentCatalog>
<TrajectoryCatalog>
<Directory path=""/>
</TrajectoryCatalog>
<RouteCatalog>
<Directory path=""/>
</RouteCatalog>
</CatalogLocations>
<RoadNetwork>
<LogicFile filepath="SceneryConfiguration.xodr"/>
<SceneGraphFile filepath=""/>
</RoadNetwork>
<Entities>
<ScenarioObject name="Ego">
<CatalogReference catalogName="ProfilesCatalog.xml" entryName="MiddleClassCarAgent"/>
</ScenarioObject>
<ScenarioObject name="Pedestrian">
<CatalogReference catalogName="ProfilesCatalog.xml" entryName="Pedestrian"/>
</ScenarioObject>
<EntitySelection name="ScenarioAgents">
<Members>
<EntityRef entityRef="Pedestrian"/>
</Members>
</EntitySelection>
</Entities>
<Storyboard>
<Init>
<Actions>
<Private entityRef="Ego">
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="1" laneId="-1" offset="0.0" s="0.0"/>
</Position>
</TeleportAction>
</PrivateAction>
<PrivateAction>
<LongitudinalAction>
<SpeedAction>
<SpeedActionDynamics dynamicsShape="linear" value="0.0" dynamicsDimension="rate"/>
<SpeedActionTarget>
<AbsoluteTargetSpeed value="43.5"/>
</SpeedActionTarget>
</SpeedAction>
</LongitudinalAction>
</PrivateAction>
</Private>
<Private entityRef="Pedestrian">
<PrivateAction>
<TeleportAction>
<Position>
<LanePosition roadId="1" laneId="-2" offset="0.0" s="100.0"/>
</Position>
</TeleportAction>
</PrivateAction>
<PrivateAction>
<LongitudinalAction>
<SpeedAction>
<SpeedActionDynamics dynamicsShape="linear" value="0.0" dynamicsDimension="rate"/>
<SpeedActionTarget>
<AbsoluteTargetSpeed value="1.0"/>
</SpeedActionTarget>
</SpeedAction>
</LongitudinalAction>
</PrivateAction>
</Private>
</Actions>
</Init>
<Story/>
<StopTrigger>
<ConditionGroup>
<Condition name="EndTime" delay="0" conditionEdge="rising">
<ByValueCondition>
<SimulationTimeCondition value="30.0" rule="greaterThan"/>
</ByValueCondition>
</Condition>
</ConditionGroup>
</StopTrigger>
</Storyboard>
</OpenSCENARIO>
<OpenDRIVE>
<header revMajor="1" revMinor="1" name="Testfile" version="1" date="Thu Feb 8 14:24:06 2007" north="2.0000000000000000e+003" south="-2.0000000000000000e+003" east="2.0000000000000000e+003" west="-2.0000000000000000e+003"/>
<road name="" length="5139.7188686309819" id="1" junction="-1">
<link/>
<planView>
<geometry s="0.0000000000000000e+000" x="0" y="7.5" hdg="0" length="4000">
<line/>
</geometry>
<geometry s="4000" x="4000" y="7.5" hdg="0" length="285">
<spiral curvStart="0.0000000000000000e+000" curvEnd="-0.0028500000000000066"/>
</geometry>
<geometry s="4285" x="4280.3350391612494" y="-30.629710830536482" hdg="-0.40612500000000096" length="183.7188686309816">
<arc curvature="-0.0028500000000000066"/>
</geometry>
<geometry s="4468.7188686309819" x="4422.9323279193268" y="-143.12204699500415" hdg="-0.92972377559829977" length="571">
<spiral curvStart="-0.0028500000000000066" curvEnd="0.0000000000000000e+000"/>
</geometry>
<geometry s="5039.7188686309819" x="4476.6651848689908" y="-694.88624436808436" hdg="-1.7453292519943295" length="100">
<line/>
</geometry>
</planView>
<elevationProfile/>
<lateralProfile/>
<lanes>
<laneSection s="0.0000000000000000e+000">
<left>
<lane id="1" type="sidewalk" level="true">
<link>
<successor id="-2"/>
</link>
<width sOffset="0" a="1.5" b="0" c="0" d="0"/>
<roadMark weight="standard" sOffset="0" type="solid" color="standard" width="0.12" laneChange="none"/>
</lane>
</left>
<center>
<lane id="0" type="border" level="true">
<link>
<successor id="0"/>
</link>
<roadMark weight="standard" sOffset="0" type="solid" color="standard" width="0.12" laneChange="none"/>
</lane>
</center>
<right>
<lane id="-1" type="driving" level="true">
<link>
<successor id="-1"/>
</link>
<width sOffset="0" a="3.75" b="0" c="0" d="0"/>
<roadMark weight="standard" sOffset="0" type="solid" color="standard" width="0.12" laneChange="none"/>
</lane>
<lane id="-2" type="sidewalk" level="true">
<link>
<successor id="-2"/>
</link>
<width sOffset="0" a="1.5" b="0" c="0" d="0"/>
<roadMark weight="standard" sOffset="0" type="solid" color="standard" width="0.12" laneChange="none"/>
</lane>
</right>
</laneSection>
</lanes>
<objects/>
<signals/>
</road>
</OpenDRIVE>
......@@ -35,13 +35,12 @@
<VehicleProfile Name="Bus MAN Lions Coach c 2007" Probability="1.0"/>
</VehicleProfiles>
</AgentProfile>
<AgentProfile Name="Pedestrian" Type="Dynamic">
<DriverProfiles>
<DriverProfile Name="Pedestrian" Probability="1.0"/>
</DriverProfiles>
<VehicleProfiles>
<VehicleProfile Name="Pedestrian" Probability="1.0"/>
</VehicleProfiles>
<AgentProfile Name="Pedestrian" Type="Static">
<System>
<File>systemConfigPedestrian.xml</File>
<Id>0</Id>
</System>
<VehicleModel>pedestrian_adult</VehicleModel>
</AgentProfile>
</AgentProfiles>
<VehicleProfiles>
......@@ -80,25 +79,8 @@
<Components/>
<Sensors/>
</VehicleProfile>
<VehicleProfile Name="Pedestrian">
<Model Name="pedestrian_adult"/>
<Components>
<Component Type="Dynamics_TrajectoryFollower">
<Profiles>
<Profile Name="BasicTrajectoryFollower" Probability="1.0"/>
</Profiles>
</Component>
</Components>
<Sensors/>
</VehicleProfile>
</VehicleProfiles>
<ProfileGroup Type="Driver">
<Profile Name="Pedestrian">
<String Key="Type" Value="AlgorithmAgentFollowingDriverModel"/>
<String Key="AlgorithmLateralModule" Value="Algorithm_LateralAfdm"/>
<String Key="AlgorithmLongitudinalModule" Value="Algorithm_LongitudinalAfdm"/>
<Double Key="VelocityWish" Value="1.0"/>
</Profile>
<Profile Name="Regular">
<String Key="Type" Value="AlgorithmAgentFollowingDriverModel"/>
<String Key="AlgorithmLateralModule" Value="Algorithm_LateralAfdm"/>
......
<systems>
<system>
<id>0</id>
<priority>0</priority>
<components>
<component>
<id>OpenScenarioActions</id>
<schedule>
<priority>400</priority>
<offset>0</offset>
<cycle>100</cycle>
<response>0</response>
</schedule>
<library>OpenScenarioActions</library>
<parameters/>
</component>
<component>
<id>Dynamics_TrajectoryFollower</id>
<schedule>
<priority>50</priority>
<offset>0</offset>
<cycle>100</cycle>
<response>0</response>
</schedule>
<library>Dynamics_TrajectoryFollower</library>
<parameters>
<parameter>
<id>EnforceTrajectory</id>
<type>bool</type>
<unit/>
<value>true</value>
</parameter>
<parameter>
<id>AutomaticDeactivation</id>
<type>bool</type>
<unit/>
<value>true</value>
</parameter>
</parameters>
</component>
<component>
<id>Dynamics_Collision</id>
<schedule>
<priority>50</priority>
<offset>0</offset>
<cycle>100</cycle>
<response>0</response>
</schedule>
<library>Dynamics_Collision</library>
<parameters/>
</component>
<component>
<id>PrioritizerDynamics</id>
<schedule>
<priority>25</priority>
<offset>0</offset>
<cycle>100</cycle>
<response>0</response>
</schedule>
<library>SignalPrioritizer</library>
<parameters>
<parameter>
<id>1</id>
<type>int</type>
<unit/>
<value>2</value>
</parameter>
<parameter>
<id>2</id>
<type>int</type>
<unit/>
<value>1</value>
</parameter>
</parameters>
</component>
<component>
<id>AgentUpdater</id>
<schedule>
<priority>1</priority>
<offset>0</offset>
<cycle>100</cycle>
<response>0</response>
</schedule>
<library>AgentUpdater</library>
<parameters/>
</component>
<component>
<id>Sensor_RecordState</id>
<schedule>
<priority>2</priority>
<offset>0</offset>
<cycle>100</cycle>
<response>0</response>
</schedule>
<library>Sensor_RecordState</library>
<parameters/>
</component>
</components>
<connections>
<connection>
<id>201</id>
<source>
<component>Dynamics_TrajectoryFollower</component>
<output>0</output>
</source>
<target>
<component>PrioritizerDynamics</component>
<input>2</input>
</target>
</connection>
<connection>
<id>401</id>
<source>
<component>Dynamics_Collision</component>
<output>0</output>
</source>
<target>
<component>PrioritizerDynamics</component>
<input>1</input>
</target>
</connection>
<connection>
<id>501</id>
<source>
<component>PrioritizerDynamics</component>
<output>0</output>
</source>
<target>
<component>AgentUpdater</component>
<input>0</input>
</target>
</connection>
<connection>
<id>8471</id>
<source>
<component>OpenScenarioActions</component>
<output>0</output>
</source>
<target>
<component>Dynamics_TrajectoryFollower</component>
<input>2</input>
</target>
</connection>
</connections>
</system>
</systems>
......@@ -7,7 +7,7 @@
<Property name="AirDragCoefficient" value="0.3"/>
<Property name="AxleRatio" value="1.0"/>
<Property name="DecelerationFromPowertrainDrag" value="0.5"/>
<Property name="FrictionCoefficient" value="0.0"/>
<Property name="FrictionCoefficient" value="1.0"/>
<Property name="FrontSurface" value="2.38"/>
<Property name="GearRatio1" value="9.665"/>
<Property name="Mass" value="1320.0"/>
......@@ -25,7 +25,7 @@
<Center x="1.25" y="0.0" z="0.84"/>
<Dimensions width="2.04" length="3.96" height="1.68"/>
</BoundingBox>
<Performance maxSpeed="41.67" maxDeceleration="9.80665"/>
<Performance maxSpeed="41.67" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.5282" wheelDiameter="0.682" trackWidth="1.8" positionX="2.52" positionZ="0.341"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.682" trackWidth="1.8" positionX="0.0" positionZ="0.341"/>
......@@ -36,7 +36,7 @@
<Property name="AirDragCoefficient" value="0.3"/>
<Property name="AxleRatio" value="2.813"/>
<Property name="DecelerationFromPowertrainDrag" value="0.5"/>
<Property name="FrictionCoefficient" value="0.0"/>
<Property name="FrictionCoefficient" value="1.0"/>
<Property name="FrontSurface" value="2.2"/>
<Property name="GearRatio1" value="5.0"/>
<Property name="GearRatio2" value="3.2"/>
......@@ -61,7 +61,7 @@
<Center x="1.285" y="0.0" z="0.72"/>
<Dimensions width="1.96" length="4.63" height="1.44"/>
</BoundingBox>
<Performance maxSpeed="69.44" maxDeceleration="9.80665"/>
<Performance maxSpeed="69.44" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.5012" wheelDiameter="0.634" trackWidth="1.8" positionX="2.81" positionZ="0.317"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.634" trackWidth="1.8" positionX="0.0" positionZ="0.317"/>
......@@ -72,7 +72,7 @@
<Property name="AirDragCoefficient" value="0.3"/>
<Property name="AxleRatio" value="3.077"/>
<Property name="DecelerationFromPowertrainDrag" value="0.5"/>
<Property name="FrictionCoefficient" value="0.0"/>
<Property name="FrictionCoefficient" value="1.0"/>
<Property name="FrontSurface" value="2.42"/>
<Property name="GearRatio1" value="5.0"/>
<Property name="GearRatio2" value="3.2"/>
......@@ -97,7 +97,7 @@
<Center x="1.46" y="0.0" z="0.755"/>
<Dimensions width="2.18" length="5.26" height="1.51"/>
</BoundingBox>
<Performance maxSpeed="69.44" maxDeceleration="9.80665"/>
<Performance maxSpeed="69.44" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.5226" wheelDiameter="0.682" trackWidth="1.8" positionX="3.22" positionZ="0.341"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.682" trackWidth="1.8" positionX="0.0" positionZ="0.341"/>
......@@ -108,7 +108,7 @@
<Property name="AirDragCoefficient" value="0.3"/>
<Property name="AxleRatio" value="3.077"/>
<Property name="DecelerationFromPowertrainDrag" value="0.5"/>
<Property name="FrictionCoefficient" value="0.0"/>
<Property name="FrictionCoefficient" value="1.0"/>
<Property name="FrontSurface" value="2.42"/>
<Property name="GearRatio1" value="4.714"/>
<Property name="GearRatio2" value="3.143"/>
......@@ -133,7 +133,7 @@
<Center x="1.485" y="0.0" z="0.745"/>
<Dimensions width="2.16" length="5.27" height="1.49"/>
</BoundingBox>
<Performance maxSpeed="69.44" maxDeceleration="9.80665"/>
<Performance maxSpeed="69.44" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.5279" wheelDiameter="0.682" trackWidth="1.8" positionX="3.25" positionZ="0.341"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.682" trackWidth="1.8" positionX="0.0" positionZ="0.341"/>
......@@ -144,7 +144,7 @@
<Property name="AirDragCoefficient" value="0.3"/>
<Property name="AxleRatio" value="3.789"/>
<Property name="DecelerationFromPowertrainDrag" value="0.5"/>
<Property name="FrictionCoefficient" value="0.0"/>
<Property name="FrictionCoefficient" value="1.0"/>
<Property name="FrontSurface" value="2.07"/>
<Property name="GearRatio1" value="4.154"/>
<Property name="GearRatio2" value="2.45"/>
......@@ -168,7 +168,7 @@
<Center x="1.35" y="0.0" z="0.71"/>
<Dimensions width="1.89" length="3.8" height="1.42"/>
</BoundingBox>
<Performance maxSpeed="58.33" maxDeceleration="9.80665"/>
<Performance maxSpeed="58.33" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.4766" wheelDiameter="0.59" trackWidth="1.8" positionX="2.48" positionZ="0.295"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.59" trackWidth="1.8" positionX="0.0" positionZ="0.295"/>
......@@ -179,7 +179,7 @@
<Property name="AirDragCoefficient" value="0.8"/>
<Property name="AxleRatio" value="4.0"/>
<Property name="DecelerationFromPowertrainDrag" value="1.0"/>
<Property name="FrictionCoefficient" value="0.0"/>
<Property name="FrictionCoefficient" value="1.0"/>
<Property name="FrontSurface" value="9.0"/>
<Property name="GearRatio1" value="6.316"/>
<Property name="GearRatio2" value="4.554"/>
......@@ -204,7 +204,7 @@
<Center x="2.815" y="0.0" z="1.92"/>
<Dimensions width="2.91" length="13.23" height="3.84"/>
</BoundingBox>
<Performance maxSpeed="33.33" maxDeceleration="9.80665"/>
<Performance maxSpeed="33.33" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.6972" wheelDiameter="0.808" trackWidth="1.8" positionX="6.64" positionZ="0.404"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.808" trackWidth="1.8" positionX="0.0" positionZ="0.404"/>
......@@ -215,7 +215,7 @@
<Property name="AirDragCoefficient" value="0.8"/>
<Property name="AxleRatio" value="4.0"/>
<Property name="DecelerationFromPowertrainDrag" value="1.0"/>
<Property name="FrictionCoefficient" value="0.0"/>
<Property name="FrictionCoefficient" value="1.0"/>
<Property name="FrontSurface" value="9.0"/>
<Property name="GearRatio1" value="6.316"/>
<Property name="GearRatio2" value="4.554"/>
......@@ -240,7 +240,7 @@
<Center x="2.685" y="0.0" z="1.74"/>
<Dimensions width="3.16" length="8.83" height="3.48"/>
</BoundingBox>
<Performance maxSpeed="25.0" maxDeceleration="9.80665"/>
<Performance maxSpeed="25.0" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.4352" wheelDiameter="0.808" trackWidth="1.8" positionX="4.36" positionZ="0.404"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.808" trackWidth="1.8" positionX="0.0" positionZ="0.404"/>
......@@ -251,7 +251,7 @@
<Property name="AirDragCoefficient" value="0.3"/>
<Property name="AxleRatio" value="3.0"/>
<Property name="DecelerationFromPowertrainDrag" value="0.5"/>
<Property name="FrictionCoefficient" value="0.0"/>
<Property name="FrictionCoefficient" value="1.0"/>
<Property name="FrontSurface" value="1.9"/>
<Property name="GearRatio1" value="4.350"/>
<Property name="GearRatio2" value="2.496"/>
......@@ -274,7 +274,7 @@
<Center x="0.175" y="0.0" z="0.9325"/>
<Dimensions width="0.5" length="1.89" height="1.865"/>
</BoundingBox>
<Performance maxSpeed="10.0" maxDeceleration="9.80665"/>
<Performance maxSpeed="10.0" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="1.5708" wheelDiameter="0.636" trackWidth="0.1" positionX="1.04" positionZ="0.318"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.636" trackWidth="0.1" positionX="0.0" positionZ="0.318"/>
......
......@@ -25,7 +25,7 @@
<Center x="1.25" y="0.0" z="0.84"/>
<Dimensions width="2.04" length="3.96" height="1.68"/>
</BoundingBox>
<Performance maxSpeed="41.67" maxDeceleration="9.80665"/>
<Performance maxSpeed="41.67" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.5282" wheelDiameter="0.682" trackWidth="1.8" positionX="2.52" positionZ="0.341"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.682" trackWidth="1.8" positionX="0.0" positionZ="0.341"/>
......@@ -61,7 +61,7 @@
<Center x="1.285" y="0.0" z="0.72"/>
<Dimensions width="1.96" length="4.63" height="1.44"/>
</BoundingBox>
<Performance maxSpeed="69.44" maxDeceleration="9.80665"/>
<Performance maxSpeed="69.44" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.5012" wheelDiameter="0.634" trackWidth="1.8" positionX="2.81" positionZ="0.317"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.634" trackWidth="1.8" positionX="0.0" positionZ="0.317"/>
......@@ -97,7 +97,7 @@
<Center x="1.46" y="0.0" z="0.755"/>
<Dimensions width="2.18" length="5.26" height="1.51"/>
</BoundingBox>
<Performance maxSpeed="69.44" maxDeceleration="9.80665"/>
<Performance maxSpeed="69.44" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.5226" wheelDiameter="0.682" trackWidth="1.8" positionX="3.22" positionZ="0.341"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.682" trackWidth="1.8" positionX="0.0" positionZ="0.341"/>
......@@ -133,7 +133,7 @@
<Center x="1.485" y="0.0" z="0.745"/>
<Dimensions width="2.16" length="5.27" height="1.49"/>
</BoundingBox>
<Performance maxSpeed="69.44" maxDeceleration="9.80665"/>
<Performance maxSpeed="69.44" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.5279" wheelDiameter="0.682" trackWidth="1.8" positionX="3.25" positionZ="0.341"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.682" trackWidth="1.8" positionX="0.0" positionZ="0.341"/>
......@@ -168,7 +168,7 @@
<Center x="1.35" y="0.0" z="0.71"/>
<Dimensions width="1.89" length="3.8" height="1.42"/>
</BoundingBox>
<Performance maxSpeed="58.33" maxDeceleration="9.80665"/>
<Performance maxSpeed="58.33" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.4766" wheelDiameter="0.59" trackWidth="1.8" positionX="2.48" positionZ="0.295"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.59" trackWidth="1.8" positionX="0.0" positionZ="0.295"/>
......@@ -204,7 +204,7 @@
<Center x="2.815" y="0.0" z="1.92"/>
<Dimensions width="2.91" length="13.23" height="3.84"/>
</BoundingBox>
<Performance maxSpeed="33.33" maxDeceleration="9.80665"/>
<Performance maxSpeed="33.33" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.6972" wheelDiameter="0.808" trackWidth="1.8" positionX="6.64" positionZ="0.404"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.808" trackWidth="1.8" positionX="0.0" positionZ="0.404"/>
......@@ -240,7 +240,7 @@
<Center x="2.685" y="0.0" z="1.74"/>
<Dimensions width="3.16" length="8.83" height="3.48"/>
</BoundingBox>
<Performance maxSpeed="25.0" maxDeceleration="9.80665"/>
<Performance maxSpeed="25.0" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.4352" wheelDiameter="0.808" trackWidth="1.8" positionX="4.36" positionZ="0.404"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.808" trackWidth="1.8" positionX="0.0" positionZ="0.404"/>
......@@ -274,7 +274,7 @@
<Center x="0.175" y="0.0" z="0.9325"/>
<Dimensions width="0.5" length="1.89" height="1.865"/>
</BoundingBox>
<Performance maxSpeed="10.0" maxDeceleration="9.80665"/>
<Performance maxSpeed="10.0" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="1.5708" wheelDiameter="0.636" trackWidth="0.1" positionX="1.04" positionZ="0.318"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.636" trackWidth="0.1" positionX="0.0" positionZ="0.318"/>
......
......@@ -4,6 +4,9 @@
<Catalog name="PedestrianCatalog">
<Pedestrian model="pedestrian_child" mass="30.0" name="pedestrian_child" pedestrianCategory="pedestrian">
<ParameterDeclarations/>
<Properties>
<Property name="Mass" value="40.0"/>
</Properties>
<BoundingBox>
<Center x="0.0645" y="0.0" z="0.577"/>
<Dimensions width="0.298" length="0.711" height="1.154"/>
......@@ -12,6 +15,9 @@
</Pedestrian>
<Pedestrian model="pedestrian_adult" mass="80.0" name="pedestrian_adult" pedestrianCategory="pedestrian">
<ParameterDeclarations/>
<Properties>
<Property name="Mass" value="70.0"/>
</Properties>
<BoundingBox>
<Center x="0.1" y="0.0" z="0.9"/>
<Dimensions width="0.5" length="0.6" height="1.8"/>
......
......@@ -25,7 +25,7 @@
<Center x="1.25" y="0.0" z="0.84"/>
<Dimensions width="2.04" length="3.96" height="1.68"/>
</BoundingBox>
<Performance maxSpeed="41.67" maxDeceleration="9.80665"/>
<Performance maxSpeed="41.67" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.5282" wheelDiameter="0.682" trackWidth="1.8" positionX="2.52" positionZ="0.341"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.682" trackWidth="1.8" positionX="0.0" positionZ="0.341"/>
......@@ -61,7 +61,7 @@
<Center x="1.285" y="0.0" z="0.72"/>
<Dimensions width="1.96" length="4.63" height="1.44"/>
</BoundingBox>
<Performance maxSpeed="69.44" maxDeceleration="9.80665"/>
<Performance maxSpeed="69.44" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.5012" wheelDiameter="0.634" trackWidth="1.8" positionX="2.81" positionZ="0.317"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.634" trackWidth="1.8" positionX="0.0" positionZ="0.317"/>
......@@ -97,7 +97,7 @@
<Center x="1.46" y="0.0" z="0.755"/>
<Dimensions width="2.18" length="5.26" height="1.51"/>
</BoundingBox>
<Performance maxSpeed="69.44" maxDeceleration="9.80665"/>
<Performance maxSpeed="69.44" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.5226" wheelDiameter="0.682" trackWidth="1.8" positionX="3.22" positionZ="0.341"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.682" trackWidth="1.8" positionX="0.0" positionZ="0.341"/>
......@@ -133,7 +133,7 @@
<Center x="1.485" y="0.0" z="0.745"/>
<Dimensions width="2.16" length="5.27" height="1.49"/>
</BoundingBox>
<Performance maxSpeed="69.44" maxDeceleration="9.80665"/>
<Performance maxSpeed="69.44" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.5279" wheelDiameter="0.682" trackWidth="1.8" positionX="3.25" positionZ="0.341"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.682" trackWidth="1.8" positionX="0.0" positionZ="0.341"/>
......@@ -168,7 +168,7 @@
<Center x="1.35" y="0.0" z="0.71"/>
<Dimensions width="1.89" length="3.8" height="1.42"/>
</BoundingBox>
<Performance maxSpeed="58.33" maxDeceleration="9.80665"/>
<Performance maxSpeed="58.33" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.4766" wheelDiameter="0.59" trackWidth="1.8" positionX="2.48" positionZ="0.295"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.59" trackWidth="1.8" positionX="0.0" positionZ="0.295"/>
......@@ -204,7 +204,7 @@
<Center x="2.815" y="0.0" z="1.92"/>
<Dimensions width="2.91" length="13.23" height="3.84"/>
</BoundingBox>
<Performance maxSpeed="33.33" maxDeceleration="9.80665"/>
<Performance maxSpeed="33.33" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.6972" wheelDiameter="0.808" trackWidth="1.8" positionX="6.64" positionZ="0.404"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.808" trackWidth="1.8" positionX="0.0" positionZ="0.404"/>
......@@ -240,7 +240,7 @@
<Center x="2.685" y="0.0" z="1.74"/>
<Dimensions width="3.16" length="8.83" height="3.48"/>
</BoundingBox>
<Performance maxSpeed="25.0" maxDeceleration="9.80665"/>
<Performance maxSpeed="25.0" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.4352" wheelDiameter="0.808" trackWidth="1.8" positionX="4.36" positionZ="0.404"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.808" trackWidth="1.8" positionX="0.0" positionZ="0.404"/>
......@@ -274,7 +274,7 @@
<Center x="0.175" y="0.0" z="0.9325"/>
<Dimensions width="0.5" length="1.89" height="1.865"/>
</BoundingBox>
<Performance maxSpeed="10.0" maxDeceleration="9.80665"/>
<Performance maxSpeed="10.0" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="1.5708" wheelDiameter="0.636" trackWidth="0.1" positionX="1.04" positionZ="0.318"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.636" trackWidth="0.1" positionX="0.0" positionZ="0.318"/>
......
......@@ -227,6 +227,13 @@ public:
//-----------------------------------------------------------------------------
virtual void SetYaw(double value) = 0;
//-----------------------------------------------------------------------------
//! Sets roll angle of agent
//!
//! @param[in] yawAngle agent orientation
//-----------------------------------------------------------------------------
virtual void SetRoll(double value) = 0;
//-----------------------------------------------------------------------------
//! Sets the total traveled distance of agent
//!
......
......@@ -63,83 +63,91 @@ T GetAttribute(openScenario::ParameterizedAttribute<T> attribute, const openScen
}
}
/*!
* \brief Container for axle parameters in OpenSCENARIO vehicle model
*/
struct VehicleAxle
{
openScenario::ParameterizedAttribute<double> maxSteering = -999.0; //!< Maximum steering angle
openScenario::ParameterizedAttribute<double> wheelDiameter = -999.0; //!< Diameter of the wheels
openScenario::ParameterizedAttribute<double> trackWidth = -999.0; //!< Trackwidth of the axle
openScenario::ParameterizedAttribute<double> positionX = -999.0; //!< Longitudinal position offset (measured from reference point)
openScenario::ParameterizedAttribute<double> positionZ = -999.0; //!< Vertical position offset (measured from reference point)
};
//! Contains the VehicleModelParameters as defined in the VehicleModelCatalog.
//! Certain values may be parametrized and can be overwriten in the Scenario via ParameterAssignment
struct ParametrizedVehicleModelParameters
{
AgentVehicleType vehicleType = AgentVehicleType::Undefined;
openScenario::ParameterizedAttribute<double> width = -999.0;
openScenario::ParameterizedAttribute<double> length = -999.0;
openScenario::ParameterizedAttribute<double> height = -999.0;
VehicleAxle frontAxle{};
VehicleAxle rearAxle{};
openScenario::ParameterizedAttribute<double> distanceReferencePointToLeadingEdge = -999.0;
openScenario::ParameterizedAttribute<double> maxVelocity = -999.0;
openScenario::ParameterizedAttribute<double> weight = -999.0;
openScenario::ParameterizedAttribute<double> heightCOG = -999.0;
openScenario::ParameterizedAttribute<double> momentInertiaRoll = -999.0;
openScenario::ParameterizedAttribute<double> momentInertiaPitch = -999.0;
openScenario::ParameterizedAttribute<double> momentInertiaYaw = -999.0;
openScenario::ParameterizedAttribute<double> frontSurface = -999.0;
openScenario::ParameterizedAttribute<double> airDragCoefficient = -999.0;
openScenario::ParameterizedAttribute<double> minimumEngineSpeed = -999.0;
openScenario::ParameterizedAttribute<double> maximumEngineSpeed = -999.0;
openScenario::ParameterizedAttribute<double> minimumEngineTorque = -999.0;
openScenario::ParameterizedAttribute<double> maximumEngineTorque = -999.0;
openScenario::ParameterizedAttribute<int> numberOfGears = -999;
std::vector<openScenario::ParameterizedAttribute<double>> gearRatios;
openScenario::ParameterizedAttribute<double> axleRatio = -999.0;
openScenario::ParameterizedAttribute<double> decelerationFromPowertrainDrag = -999.0;
openScenario::ParameterizedAttribute<double> steeringRatio = -999.0;
openScenario::ParameterizedAttribute<double> frictionCoeff = -999.0;
AgentVehicleType vehicleType;
VehicleModelParameters Get(const openScenario::Parameters& assignedParameters) const
struct BoundingBoxCenter
{
auto wheelbase = std::abs(frontAxle.positionX.defaultValue - rearAxle.positionX.defaultValue);
std::vector<double> transformedGearRatios;
std::transform(gearRatios.cbegin(), gearRatios.cend(), std::back_inserter(transformedGearRatios), [&](const auto& value){return GetAttribute(value, assignedParameters);});
return VehicleModelParameters{
vehicleType,
GetAttribute(width, assignedParameters),
openScenario::ParameterizedAttribute<double> x;
openScenario::ParameterizedAttribute<double> y;
openScenario::ParameterizedAttribute<double> z;
VehicleModelParameters::BoundingBoxCenter Get(const openScenario::Parameters& assignedParameters) const
{
return {GetAttribute(x, assignedParameters),
GetAttribute(y, assignedParameters),
GetAttribute(z, assignedParameters)};
}
} boundingBoxCenter;
struct BoundingBoxDimensions
{
openScenario::ParameterizedAttribute<double> width;
openScenario::ParameterizedAttribute<double> length;
openScenario::ParameterizedAttribute<double> height;
VehicleModelParameters::BoundingBoxDimensions Get(const openScenario::Parameters& assignedParameters) const
{
return {GetAttribute(width, assignedParameters),
GetAttribute(length, assignedParameters),
GetAttribute(height, assignedParameters),
wheelbase,
GetAttribute(rearAxle.trackWidth, assignedParameters),
GetAttribute(distanceReferencePointToLeadingEdge, assignedParameters),
GetAttribute(frontAxle.positionX, assignedParameters),
GetAttribute(maxVelocity, assignedParameters),
GetAttribute(weight, assignedParameters),
GetAttribute(heightCOG, assignedParameters),
GetAttribute(momentInertiaRoll, assignedParameters),
GetAttribute(momentInertiaPitch, assignedParameters),
GetAttribute(momentInertiaYaw, assignedParameters),
GetAttribute(frontSurface, assignedParameters),
GetAttribute(airDragCoefficient, assignedParameters),
GetAttribute(minimumEngineSpeed, assignedParameters),
GetAttribute(maximumEngineSpeed, assignedParameters),
GetAttribute(minimumEngineTorque, assignedParameters),
GetAttribute(maximumEngineTorque, assignedParameters),
GetAttribute(numberOfGears, assignedParameters),
transformedGearRatios,
GetAttribute(axleRatio, assignedParameters),
GetAttribute(decelerationFromPowertrainDrag, assignedParameters),
GetAttribute(steeringRatio, assignedParameters),
GetAttribute(frontAxle.maxSteering, assignedParameters) * GetAttribute(steeringRatio, assignedParameters),
std::sin(GetAttribute(frontAxle.maxSteering, assignedParameters)) / wheelbase,
rearAxle.wheelDiameter.defaultValue / 2.0,
GetAttribute(frictionCoeff, assignedParameters)
GetAttribute(height, assignedParameters)};
}
} boundingBoxDimensions;
struct Performance
{
openScenario::ParameterizedAttribute<double> maxSpeed;
openScenario::ParameterizedAttribute<double> maxAcceleration;
openScenario::ParameterizedAttribute<double> maxDeceleration;
VehicleModelParameters::Performance Get(const openScenario::Parameters& assignedParameters) const
{
return {GetAttribute(maxSpeed, assignedParameters),
GetAttribute(maxAcceleration, assignedParameters),
GetAttribute(maxDeceleration, assignedParameters)};
}
} performance;
struct Axle
{
openScenario::ParameterizedAttribute<double> maxSteering;
openScenario::ParameterizedAttribute<double> wheelDiameter;
openScenario::ParameterizedAttribute<double> trackWidth;
openScenario::ParameterizedAttribute<double> positionX;
openScenario::ParameterizedAttribute<double> positionZ;
VehicleModelParameters::Axle Get(const openScenario::Parameters& assignedParameters) const
{
return {GetAttribute(maxSteering, assignedParameters),
GetAttribute(wheelDiameter, assignedParameters),
GetAttribute(trackWidth, assignedParameters),
GetAttribute(positionX, assignedParameters),
GetAttribute(positionZ, assignedParameters)};
}
};
Axle frontAxle;
Axle rearAxle;
std::map<std::string, openScenario::ParameterizedAttribute<double>> properties;
VehicleModelParameters Get(const openScenario::Parameters& assignedParameters) const
{
std::map<std::string, double> assignedProperties;
for (const auto[key, value] : properties)
{
assignedProperties.insert({key, GetAttribute(value, assignedParameters)});
}
return {vehicleType,
boundingBoxCenter.Get(assignedParameters),
boundingBoxDimensions.Get(assignedParameters),
performance.Get(assignedParameters),
frontAxle.Get(assignedParameters),
rearAxle.Get(assignedParameters),
assignedProperties
};
}
};
......
......@@ -47,6 +47,10 @@ public:
/// \return yaw
virtual double GetYaw() const = 0;
/// \brief Retrieves roll angle
/// \return roll
virtual double GetRoll() const = 0;
/// \brief Get unique id of an object
/// \return id
virtual int GetId() const = 0;
......
......@@ -408,6 +408,18 @@ public:
return WillCrashDuringBrake(sFrontAtTtb - sEgoAtTtb, vEgo, assumedBrakeAccelerationEgo, vFrontAtTtb, aFrontAtTtb);
}
//! Calculate the width left of the reference point of a leaning object
static double GetWidthLeft(double width, double height, double roll)
{
return 0.5 * width * std::cos(roll) + (roll < 0 ? height * std::sin(-roll) : 0);
}
//! Calculate the width right of the reference point of a leaning object
static double GetWidthRight(double width, double height, double roll)
{
return 0.5 * width * std::cos(roll) + (roll > 0 ? height * std::sin(roll) : 0);
}
};
namespace helper::vector {
......@@ -474,7 +486,8 @@ public:
//-----------------------------------------------------------------------------
struct TtcParameters{
double length;
double width;
double widthLeft;
double widthRight;
double frontLength; // distance from reference point of object to leading edge of object
double backLength; // distance from reference point to back edge of object
point_t position;
......@@ -549,7 +562,8 @@ private:
// Initial bounding box in local coordinate system
parameters.length = object->GetLength() + collisionDetectionLongitudinalBoundary;
parameters.width = object->GetWidth() + collisionDetectionLateralBoundary;
parameters.widthLeft = TrafficHelperFunctions::GetWidthLeft(object->GetWidth(), object->GetHeight(), object->GetRoll()) + 0.5 * collisionDetectionLateralBoundary;
parameters.widthRight = TrafficHelperFunctions::GetWidthRight(object->GetWidth(), object->GetHeight(), object->GetRoll()) + 0.5 * collisionDetectionLateralBoundary;
parameters.frontLength = object->GetDistanceReferencePointToLeadingEdge() + 0.5 * collisionDetectionLongitudinalBoundary; //returns the distance from reference point of object to leading edge of object
parameters.backLength = parameters.length - parameters.frontLength; // distance from reference point to back edge of object
......@@ -587,11 +601,11 @@ private:
// construct corner points from reference point position and current yaw angle
polygon_t box;
bg::append(box, point_t{ parameters.position.get<0>() - std::cos(parameters.yaw) * parameters.backLength + std::sin(parameters.yaw) * 0.5 * parameters.width , parameters.position.get<1>() - std::sin(parameters.yaw) * parameters.backLength - std::cos(parameters.yaw) * 0.5 * parameters.width }); // back right corner
bg::append(box, point_t{ parameters.position.get<0>() - std::cos(parameters.yaw) * parameters.backLength - std::sin(parameters.yaw) * 0.5 * parameters.width , parameters.position.get<1>() - std::sin(parameters.yaw) * parameters.backLength + std::cos(parameters.yaw) * 0.5 * parameters.width }); // back left corner
bg::append(box, point_t{ parameters.position.get<0>() + std::cos(parameters.yaw) * parameters.frontLength - std::sin(parameters.yaw) * 0.5 * parameters.width , parameters.position.get<1>() + std::sin(parameters.yaw) * parameters.frontLength + std::cos(parameters.yaw) * 0.5 * parameters.width }); // front left corner
bg::append(box, point_t{ parameters.position.get<0>() + std::cos(parameters.yaw) * parameters.frontLength + std::sin(parameters.yaw) * 0.5 * parameters.width , parameters.position.get<1>() + std::sin(parameters.yaw) * parameters.frontLength - std::cos(parameters.yaw) * 0.5 * parameters.width }); // front right corner
bg::append(box, point_t{ parameters.position.get<0>() - std::cos(parameters.yaw) * parameters.backLength + std::sin(parameters.yaw) * 0.5 * parameters.width , parameters.position.get<1>() - std::sin(parameters.yaw) * parameters.backLength - std::cos(parameters.yaw) * 0.5 * parameters.width }); // back right corner
bg::append(box, point_t{ parameters.position.get<0>() - std::cos(parameters.yaw) * parameters.backLength + std::sin(parameters.yaw) * parameters.widthRight , parameters.position.get<1>() - std::sin(parameters.yaw) * parameters.backLength - std::cos(parameters.yaw) * parameters.widthRight }); // back right corner
bg::append(box, point_t{ parameters.position.get<0>() - std::cos(parameters.yaw) * parameters.backLength - std::sin(parameters.yaw) * parameters.widthLeft , parameters.position.get<1>() - std::sin(parameters.yaw) * parameters.backLength + std::cos(parameters.yaw) * parameters.widthLeft }); // back left corner
bg::append(box, point_t{ parameters.position.get<0>() + std::cos(parameters.yaw) * parameters.frontLength - std::sin(parameters.yaw) * parameters.widthLeft , parameters.position.get<1>() + std::sin(parameters.yaw) * parameters.frontLength + std::cos(parameters.yaw) * parameters.widthLeft }); // front left corner
bg::append(box, point_t{ parameters.position.get<0>() + std::cos(parameters.yaw) * parameters.frontLength + std::sin(parameters.yaw) * parameters.widthRight , parameters.position.get<1>() + std::sin(parameters.yaw) * parameters.frontLength - std::cos(parameters.yaw) * parameters.widthRight }); // front right corner
bg::append(box, point_t{ parameters.position.get<0>() - std::cos(parameters.yaw) * parameters.backLength + std::sin(parameters.yaw) * parameters.widthRight , parameters.position.get<1>() - std::sin(parameters.yaw) * parameters.backLength - std::cos(parameters.yaw) * parameters.widthRight }); // back right corner
return box;
}
//-----------------------------------------------------------------------------
......
......@@ -39,6 +39,7 @@ public:
double positionY,
double yaw,
double yawRate,
double roll,
double steeringWheelAngle,
double centripetalAcceleration,
double travelDistance) :
......@@ -49,6 +50,7 @@ public:
positionY(positionY),
yaw(yaw),
yawRate(yawRate),
roll(roll),
steeringWheelAngle(steeringWheelAngle),
centripetalAcceleration(centripetalAcceleration),
travelDistance(travelDistance)
......@@ -76,6 +78,7 @@ public:
stream << "positionY: " << positionY << std::endl;
stream << "yaw: " << yaw << std::endl;
stream << "yawRate: " << yawRate << std::endl;
stream << "roll: " << roll << std::endl;
stream << "steeringWheelAngle: " << steeringWheelAngle << std::endl;
stream << "centripetalAcceleration: " << centripetalAcceleration << std::endl;
stream << "travelDistance: " << travelDistance << std::endl;
......@@ -88,6 +91,7 @@ public:
double positionY = 0.0;
double yaw = 0.0;
double yawRate = 0.0;
double roll = 0.0;
double steeringWheelAngle = 0.0;
double centripetalAcceleration = 0.0;
double travelDistance = 0.0;
......
......@@ -289,83 +289,41 @@ enum class Side
struct VehicleModelParameters
{
// -----------------------------------------
// full vehicle related parameters
// -----------------------------------------
// The type of the vehicle
AgentVehicleType vehicleType = AgentVehicleType::Undefined;
// The maximum width of the vehicle in m
double width = -999.0;
// The maximum length of the vehicle in m
double length = -999.0;
// The maximum height of the vehicle in m
double height = -999.0;
// The wheelbase of the vehicle in m
double wheelbase = -999.0;
// The trackwidth of the vehicle in m
double trackwidth = -999.0;
// The distance between the vehicle coordinate system's reference point (rear axle) and the front bumper in m
double distanceReferencePointToLeadingEdge = -999.0;
// The distance between the vehicle coordinate system's reference point (rear axle) and the front axle in m
double distanceReferencePointToFrontAxle = -999.0;
// The maximum velocity of the vehicle in m/s
double maxVelocity = -999.0;
// The overall mass of the vehicle in kg
double weight = -999.0;
// The height of the center of gravity above ground in m
double heightCOG = -999.0;
// The moment of inertia along the vehicle's longtudinal axes in kgm2
double momentInertiaRoll = -999.0;
// The moment of inertia along the vehicle's lateral axes in kgm2
double momentInertiaPitch = -999.0;
// The moment of inertia along the vehicle's vertical axes in kgm2
double momentInertiaYaw = -999.0;
// The projected front surface of the vehicle in m2
double frontSurface = -999.0;
// The air drag coefficient of the vehicle
double airDragCoefficient = -999.0;
// -----------------------------------------
// power train related parameters
// -----------------------------------------
// The idle speed of the engine in 1/min
double minimumEngineSpeed = -999.0;
// The maximum engine speed in 1/min
double maximumEngineSpeed = -999.0;
// The drag torque of the engine in Nm
double minimumEngineTorque = -999.0;
// The maximum torque of the engine in Nm
double maximumEngineTorque = -999.0;
// The number of gears in the gearbox (no reverse gear)
int numberOfGears = -999;
// The ratios of all gears in the gearbox (no reverse gear)
std::vector<double> gearRatios;
// The ratio of the axle gear
double axleRatio = -999.0;
// The deceleration caused by the overall powertrain drag torque in m/s2
double decelerationFromPowertrainDrag = -999.0;
// -----------------------------------------
// steering related parameters
// -----------------------------------------
// The ratio of the steering gear
double steeringRatio = -999.0;
// The maximum amplitude of the steering wheel angle in radian
double maximumSteeringWheelAngleAmplitude = -999.0;
// The maximum curavture the vehicle is able to drive in 1/m
double maxCurvature = -999.0;
// -----------------------------------------
// wheel related parameters
// -----------------------------------------
// The static wheel radius in m
double staticWheelRadius = -999.0;
// The friction coefficient between road and the vehicles tires
double frictionCoeff = -999.0;
AgentVehicleType vehicleType;
struct BoundingBoxCenter
{
double x;
double y;
double z;
} boundingBoxCenter;
struct BoundingBoxDimensions
{
double width;
double length;
double height;
} boundingBoxDimensions;
struct Performance
{
double maxSpeed;
double maxAcceleration;
double maxDeceleration;
} performance;
struct Axle
{
double maxSteering;
double wheelDiameter;
double trackWidth;
double positionX;
double positionZ;
};
Axle frontAxle;
Axle rearAxle;
std::map<std::string, double> properties;
};
enum class AdasType
......
/*******************************************************************************
* Copyright (c) 2021 in-tech GmbH
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
//-----------------------------------------------------------------------------
//! @file rollSignal.h
//! @brief This file contains all functions for class
//! RollSignal
//!
//! This class contains all functionality of the signal.
//-----------------------------------------------------------------------------
#pragma once
#include "include/modelInterface.h"
class RollSignal: public ComponentStateSignalInterface
{
public:
const std::string COMPONENTNAME = "RollSignal";
//-----------------------------------------------------------------------------
//! Constructor
//-----------------------------------------------------------------------------
RollSignal()
{
componentState = ComponentState::Disabled;
}
//-----------------------------------------------------------------------------
//! Constructor
//-----------------------------------------------------------------------------
RollSignal(
ComponentState componentState,
double rollAngle
):
rollAngle(rollAngle)
{
this->componentState = componentState;
}
RollSignal(const RollSignal&) = default;
RollSignal(RollSignal&&) = default;
RollSignal& operator=(const RollSignal&) = default;
RollSignal& operator=(RollSignal&&) = default;
virtual ~RollSignal() = default;
//-----------------------------------------------------------------------------
//! Returns the content/payload of the signal as an std::string
//!
//! @return Content/payload of the signal as an std::string
//-----------------------------------------------------------------------------
virtual operator std::string() const
{
std::ostringstream stream;
stream << COMPONENTNAME;
return stream.str();
}
double rollAngle {0.};
};
......@@ -36,6 +36,7 @@ void AgentUpdaterImplementation::UpdateInput(int localLinkId, const std::shared_
positionY = signal->positionY;
yaw = signal->yaw;
yawRate = signal->yawRate;
roll = signal->roll;
steeringWheelAngle = signal->steeringWheelAngle;
centripetalAcceleration = signal->centripetalAcceleration;
travelDistance = signal->travelDistance;
......@@ -64,6 +65,7 @@ void AgentUpdaterImplementation::Trigger([[maybe_unused]] int time)
agent->SetPositionY(positionY);
agent->SetYaw(yaw);
agent->SetYawRate(yawRate);
agent->SetRoll(roll);
agent->SetSteeringWheelAngle(steeringWheelAngle);
agent->SetCentripetalAcceleration(centripetalAcceleration);
agent->SetDistanceTraveled(agent->GetDistanceTraveled() + travelDistance);
......
......@@ -123,6 +123,7 @@ private:
double positionY {0.0};
double yaw {0.0};
double yawRate {0.0};
double roll {0.0};
double steeringWheelAngle {0.0};
double centripetalAcceleration {0.0};
double travelDistance {0.0};
......
......@@ -29,13 +29,11 @@ INCLUDEPATH += \
SOURCES += \
algorithm_autonomousEmergencyBraking.cpp \
src/autonomousEmergencyBraking.cpp \
src/boundingBoxCalculation.cpp
src/autonomousEmergencyBraking.cpp
HEADERS += \
algorithm_autonomousEmergencyBraking.h \
src/autonomousEmergencyBraking.h \
src/boundingBoxCalculation.h
src/autonomousEmergencyBraking.h
LIBS += \
-lopen_simulation_interface \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment