Commit 79f0b9b9 authored by Reinhard Biegel's avatar Reinhard Biegel
Browse files

Merge branch '163-world_osi-issues' into 'develop'

Resolve "World_OSI issues"

See merge request eclipse/simopenpass/simopenpass!100
parents aaae8317 d0ad36d0
Pipeline #11506 canceled with stage
in 0 seconds
<?xml version="1.0"?>
<?xml version='1.0' encoding='UTF-8'?>
<OpenSCENARIO>
<FileHeader revMajor="1" revMinor="0" date="2020-06-26T00:17:00" description="openPASS pedestrian models" author="in-tech GmbH"/>
<Catalog name="PedestrianCatalog">
<Pedestrian model="pedestrian_child" mass="30.0" name="pedestrian_child" pedestrianCategory="pedestrian">
<ParameterDeclarations/>
<Properties>
<Property name="Mass" value="40.0"/>
<Property name="Mass" value="30.0"/>
</Properties>
<BoundingBox>
<Center x="0.0645" y="0.0" z="0.577"/>
<Center x="0.0" y="0.0" z="0.577"/>
<Dimensions width="0.298" length="0.711" height="1.154"/>
</BoundingBox>
<Properties/>
</Pedestrian>
<Pedestrian model="pedestrian_adult" mass="80.0" name="pedestrian_adult" pedestrianCategory="pedestrian">
<Pedestrian model="pedestrian_adult" mass="70.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"/>
<Center x="0.0" y="0.0" z="0.9"/>
<Dimensions width="0.5" length="0.6" height="1.8"/>
</BoundingBox>
<Properties/>
</Pedestrian>
</Catalog>
</OpenSCENARIO>
<?xml version="1.0"?>
<?xml version='1.0' encoding='UTF-8'?>
<OpenSCENARIO>
<FileHeader revMajor="1" revMinor="0" date="2020-06-26T00:17:00" description="openPASS vehicle models" author="in-tech GmbH"/>
<Catalog name="VehicleCatalog">
......@@ -174,6 +174,42 @@
<RearAxle maxSteering="0.0" wheelDiameter="0.59" trackWidth="1.8" positionX="0.0" positionZ="0.295"/>
</Axles>
</Vehicle>
<Vehicle name="car_oldtimer" vehicleCategory="car">
<Properties>
<Property name="AirDragCoefficient" value="0.3"/>
<Property name="AxleRatio" value="2.813"/>
<Property name="DecelerationFromPowertrainDrag" value="0.5"/>
<Property name="FrictionCoefficient" value="1.0"/>
<Property name="FrontSurface" value="2.2"/>
<Property name="GearRatio1" value="5.0"/>
<Property name="GearRatio2" value="3.2"/>
<Property name="GearRatio3" value="2.143"/>
<Property name="GearRatio4" value="1.72"/>
<Property name="GearRatio5" value="1.314"/>
<Property name="GearRatio6" value="1.0"/>
<Property name="GearRatio7" value="0.822"/>
<Property name="GearRatio8" value="0.64"/>
<Property name="Mass" value="1525.0"/>
<Property name="MaximumEngineSpeed" value="6000.0"/>
<Property name="MaximumEngineTorque" value="270.0"/>
<Property name="MinimumEngineSpeed" value="900.0"/>
<Property name="MinimumEngineTorque" value="-54.0"/>
<Property name="MomentInertiaPitch" value="0.0"/>
<Property name="MomentInertiaRoll" value="0.0"/>
<Property name="MomentInertiaYaw" value="0.0"/>
<Property name="NumberOfGears" value="8"/>
<Property name="SteeringRatio" value="10.7"/>
</Properties>
<BoundingBox>
<Center x="1.2" y="0.0" z="0.675"/>
<Dimensions width="1.68" length="3.89" height="1.35"/>
</BoundingBox>
<Performance maxSpeed="40.0" maxAcceleration="9.80665" maxDeceleration="9.80665"/>
<Axles>
<FrontAxle maxSteering="0.5012" wheelDiameter="0.634" trackWidth="1.4" positionX="2.81" positionZ="0.317"/>
<RearAxle maxSteering="0.0" wheelDiameter="0.634" trackWidth="1.4" positionX="0.0" positionZ="0.317"/>
</Axles>
</Vehicle>
<Vehicle name="bus" vehicleCategory="truck">
<Properties>
<Property name="AirDragCoefficient" value="0.8"/>
......@@ -246,6 +282,42 @@
<RearAxle maxSteering="0.0" wheelDiameter="0.808" trackWidth="1.8" positionX="0.0" positionZ="0.404"/>
</Axles>
</Vehicle>
<Vehicle name="lorry" vehicleCategory="truck">
<Properties>
<Property name="AirDragCoefficient" value="0.8"/>
<Property name="AxleRatio" value="4.0"/>
<Property name="DecelerationFromPowertrainDrag" value="1.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"/>
<Property name="GearRatio3" value="3.269"/>
<Property name="GearRatio4" value="2.352"/>
<Property name="GearRatio5" value="1.692"/>
<Property name="GearRatio6" value="1.217"/>
<Property name="GearRatio7" value="0.876"/>
<Property name="GearRatio8" value="0.630"/>
<Property name="Mass" value="30000.0"/>
<Property name="MaximumEngineSpeed" value="2500.0"/>
<Property name="MaximumEngineTorque" value="1400.0"/>
<Property name="MinimumEngineSpeed" value="600.0"/>
<Property name="MinimumEngineTorque" value="-140.0"/>
<Property name="MomentInertiaPitch" value="0.0"/>
<Property name="MomentInertiaRoll" value="0.0"/>
<Property name="MomentInertiaYaw" value="0.0"/>
<Property name="NumberOfGears" value="8"/>
<Property name="SteeringRatio" value="15.0"/>
</Properties>
<BoundingBox>
<Center x="2.11" y="0.0" z="1.7"/>
<Dimensions width="2.93" length="8.47" height="3.4"/>
</BoundingBox>
<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"/>
</Axles>
</Vehicle>
<Vehicle name="bicycle" vehicleCategory="bicycle">
<Properties>
<Property name="AirDragCoefficient" value="0.3"/>
......
/********************************************************************************
* Copyright (c) 2017-2019 in-tech GmbH
* 2022 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
......@@ -9,6 +10,8 @@
********************************************************************************/
#pragma once
#define BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE
#include <boost/geometry.hpp>
#include <boost/geometry/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
......
......@@ -401,7 +401,7 @@ std::pair<std::vector<T>, std::vector<T>> SensorGeometric2D::CalcVisualObstructi
{
visibleObjects.emplace_back(*object);
}
if (visiblePercent >= requiredPercentageOfVisibleArea)
if (visiblePercent + CommonHelper::EPSILON >= requiredPercentageOfVisibleArea)
{
detectedObjects.emplace_back(*object);
}
......
......@@ -683,6 +683,18 @@ void SceneryImporter::ParseSignals(QDomElement& roadElement,
signalElement, "Attribute " + std::string(ATTRIBUTE::type) + " is missing.");
ThrowIfFalse(ParseAttributeString(signalElement, ATTRIBUTE::subtype, signal.subtype),
signalElement, "Attribute " + std::string(ATTRIBUTE::subtype) + " is missing.");
//OpenDRIVE 1.6 standard defines subtypes to be "-1". Maps until now use subtype = "".
if (signal.subtype == "" || signal.subtype == " "){
LOG_INTERN(LogLevel::Warning) << "Encountered signal with empty subtype definition. That is not supported in openDRIVE 1.6 -> interpreting empty subtype as \"-1\"";
signal.subtype = "-1";
} else if (signal.subtype == "none"){
LOG_INTERN(LogLevel::Warning) << "Encountered signal with typedefinition \"none\". Translated that to \"-1\"";
signal.subtype = "-1";
}
// optional
std::string signalUnit;
ParseAttributeDouble(signalElement, ATTRIBUTE::value, signal.value);
......
......@@ -119,14 +119,14 @@ namespace OpenDriveTypeMapper
{
{"274.1", {osi3::TrafficSignValue_Unit::TrafficSignValue_Unit_UNIT_KILOMETER_PER_HOUR,
{
{"", {30.0, osi3::TrafficSign_MainSign_Classification_Type::TrafficSign_MainSign_Classification_Type_TYPE_SPEED_LIMIT_ZONE_BEGIN}},
{"-1", {30.0, osi3::TrafficSign_MainSign_Classification_Type::TrafficSign_MainSign_Classification_Type_TYPE_SPEED_LIMIT_ZONE_BEGIN}},
{"20", {20.0, osi3::TrafficSign_MainSign_Classification_Type::TrafficSign_MainSign_Classification_Type_TYPE_SPEED_LIMIT_ZONE_BEGIN}}
}
}
},
{"274.2", {osi3::TrafficSignValue_Unit::TrafficSignValue_Unit_UNIT_KILOMETER_PER_HOUR,
{
{"", {30.0, osi3::TrafficSign_MainSign_Classification_Type::TrafficSign_MainSign_Classification_Type_TYPE_SPEED_LIMIT_ZONE_END}},
{"-1", {30.0, osi3::TrafficSign_MainSign_Classification_Type::TrafficSign_MainSign_Classification_Type_TYPE_SPEED_LIMIT_ZONE_END}},
{"20", {20.0, osi3::TrafficSign_MainSign_Classification_Type::TrafficSign_MainSign_Classification_Type_TYPE_SPEED_LIMIT_ZONE_END}}
}
}
......@@ -287,7 +287,7 @@ namespace OpenDriveTypeMapper
{
{"1.000.001",
{
{"", osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_NONE}
{"-1", osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_NONE}
}
},
{"1.000.011",
......@@ -310,12 +310,12 @@ namespace OpenDriveTypeMapper
{
{"1.000.002",
{
{"", osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_PEDESTRIAN}
{"-1", osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_PEDESTRIAN}
}
},
{"1.000.007",
{
{"", osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_PEDESTRIAN_AND_BICYCLE}
{"-1", osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_PEDESTRIAN_AND_BICYCLE}
}
},
{"1.000.009",
......@@ -333,7 +333,7 @@ namespace OpenDriveTypeMapper
},
{"1.000.013",
{
{"", osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_BICYCLE}
{"-1", osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_BICYCLE}
}
},
};
......@@ -342,13 +342,13 @@ namespace OpenDriveTypeMapper
{
{"1.000.002",
{
{"", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_RED,
{"-1", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_RED,
osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_GREEN}}
}
},
{"1.000.007",
{
{"", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_RED,
{"-1", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_RED,
osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_GREEN}}
}
},
......@@ -375,7 +375,7 @@ namespace OpenDriveTypeMapper
},
{"1.000.013",
{
{"", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_RED,
{"-1", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_RED,
osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_GREEN}}
}
},
......@@ -398,7 +398,7 @@ namespace OpenDriveTypeMapper
},
{"1.000.008",
{
{"", {osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_NONE}},
{"-1", {osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_NONE}},
{"10", {osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_ARROW_LEFT}},
{"20", {osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_ARROW_RIGHT}},
{"30", {osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_ARROW_STRAIGHT_AHEAD}},
......@@ -410,7 +410,7 @@ namespace OpenDriveTypeMapper
},
{"1.000.012",
{
{"", {osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_NONE}},
{"-1", {osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_NONE}},
{"10", {osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_ARROW_LEFT}},
{"20", {osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_ARROW_RIGHT}},
{"30", {osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_ARROW_STRAIGHT_AHEAD}},
......@@ -422,7 +422,7 @@ namespace OpenDriveTypeMapper
},
{"1.000.020",
{
{"", {osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_NONE}},
{"-1", {osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_NONE}},
{"10", {osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_ARROW_LEFT}},
{"20", {osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_ARROW_RIGHT}},
{"30", {osi3::TrafficLight_Classification_Icon::TrafficLight_Classification_Icon_ICON_ARROW_STRAIGHT_AHEAD}},
......@@ -458,7 +458,7 @@ namespace OpenDriveTypeMapper
},
{"1.000.008",
{
{"", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_YELLOW}},
{"-1", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_YELLOW}},
{"10", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_YELLOW}},
{"20", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_YELLOW}},
{"30", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_YELLOW}},
......@@ -470,7 +470,7 @@ namespace OpenDriveTypeMapper
},
{"1.000.012",
{
{"", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_GREEN}},
{"-1", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_GREEN}},
{"10", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_GREEN}},
{"20", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_GREEN}},
{"30", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_GREEN}},
......@@ -482,7 +482,7 @@ namespace OpenDriveTypeMapper
},
{"1.000.020",
{
{"", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_RED}},
{"-1", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_RED}},
{"10", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_RED}},
{"20", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_RED}},
{"30", {osi3::TrafficLight_Classification_Color::TrafficLight_Classification_Color_COLOR_RED}},
......
......@@ -86,15 +86,16 @@ TrafficLightBase::fetchColorsFromSignal(RoadSignalInterface *signal, const std::
auto colorTypeSet = helper::map::query(colorMap, signal->GetType());
if (!colorTypeSet.has_value())
{
LOGERROR("Could not get colorTypeSet for trafficlight signal \"" + signal->GetType());
LOGERROR("Could not get colorTypeSet for trafficlight signal \"" + signal->GetType() + "\"");
return {osi3::TrafficLight_Classification_Color_COLOR_UNKNOWN};
}
auto colors = helper::map::query(colorTypeSet.value(), signal->GetSubType());
if (!colors.has_value())
{
LOGERROR("Could not get color spec for trafficlight signal \"" + signal->GetType() + "and subtype " + signal->GetSubType());
LOGERROR("Could not get color spec for trafficlight signal \"" + signal->GetType() + "\" and subtype \"" + signal->GetSubType() + "\"");
return {osi3::TrafficLight_Classification_Color_COLOR_UNKNOWN};
}
......@@ -105,15 +106,15 @@ osi3::TrafficLight_Classification_Icon TrafficLightBase::fetchIconsFromSignal(Ro
const std::map<std::string, std::map<std::string, osi3::TrafficLight_Classification_Icon>> &iconMap) {
auto type = helper::map::query(iconMap, signal->GetType());
if (!type.has_value()) {
LOGERROR("Could not get Icons for trafficlight signal \"" + signal->GetType());
LOGERROR("Could not get Icons for trafficlight signal \"" + signal->GetType() + "\"") ;
return osi3::TrafficLight_Classification_Icon_ICON_UNKNOWN;
}
auto icons = helper::map::query(type.value(), signal->GetSubType());
auto icons = helper::map::query(type.value(), signal->GetSubType());
if (!icons.has_value()) {
LOGERROR("Could not get icon spec for trafficlight signal \"" + signal->GetType() + "and subtype " + signal->GetSubType());
LOGERROR("Could not get icon spec for trafficlight signal \"" + signal->GetType() + "\" and subtype \"" + signal->GetSubType() + "\"");
return osi3::TrafficLight_Classification_Icon_ICON_UNKNOWN;
}
......@@ -529,7 +530,7 @@ bool OWL::Implementation::TwoSignalsTrafficLight::SetSpecificationOnOsiObject
osiTrafficLightObject->mutable_classification()->set_color(colors[colorIndex]);
return true;
} else {
LOGERROR("Colors from the \"" + signal->GetType() + "and subtype " + signal->GetSubType());
LOGERROR("Colors from the \"" + signal->GetType() + "\" and subtype \"" + signal->GetSubType() + "\"");
return false;
}
}
......@@ -654,7 +655,7 @@ bool OWL::Implementation::OneSignalsTrafficLight::SetSpecificationOnOsiObject
osiTrafficLightObject->mutable_classification()->set_color(colors[0]);
return true;
} else {
LOGERROR("Colors from the \"" + signal->GetType() + "and subtype " + signal->GetSubType());
LOGERROR("Colors from the \"" + signal->GetType() + "\" and subtype \"" + signal->GetSubType() + "\"");
return false;
}
}
......
......@@ -641,7 +641,7 @@ public:
const auto dimension = object->GetDimension();
const auto diagonal = openpass::hypot(dimension.width, dimension.length);
if (distance > radius + 0.5 * diagonal)
if (distance > radius + diagonal)
{
continue;
}
......@@ -654,7 +654,7 @@ public:
{
if (direction < rightBoundaryAngle && direction > leftBoundaryAngle)
{
if (!IsCloseToSectorBoundaries(distance, direction, leftBoundaryAngle, rightBoundaryAngle, 0.5 * diagonal))
if (!IsCloseToSectorBoundaries(distance, direction, leftBoundaryAngle, rightBoundaryAngle, diagonal))
{
continue;
}
......@@ -662,7 +662,7 @@ public:
}
else if (direction < rightBoundaryAngle || direction > leftBoundaryAngle)
{
if (!IsCloseToSectorBoundaries(distance, direction, leftBoundaryAngle, rightBoundaryAngle, 0.5 * diagonal))
if (!IsCloseToSectorBoundaries(distance, direction, leftBoundaryAngle, rightBoundaryAngle, diagonal))
{
continue;
}
......
......@@ -205,10 +205,10 @@ This scenery consists of linear sections only.
</signal>
<signal id="4" type="531" subtype="21" s="36" t="-8" width="0.5" height="1.0" zOffset="1.5" hOffset="0" pitch="0" roll="0" dynamic="no" country="DE" name="" orientation="+">
</signal>
<signal id="5" type="206" subtype="" s="40" t="-8" width="0.4" height="0.4" zOffset="1.5" hOffset="0" pitch="0" roll="0" dynamic="no" country="DE" name="" orientation="+">
<signal id="5" type="206" subtype="-1" s="40" t="-8" width="0.4" height="0.4" zOffset="1.5" hOffset="0" pitch="0" roll="0" dynamic="no" country="DE" name="" orientation="+">
<validity toLane="-2" fromLane="-2"/>
</signal>
<signal id="6" type="294" subtype="" s="41" t="-7" width="4.0" hOffset="0" pitch="0" roll="0" dynamic="no" country="DE" name="" orientation="+" zOffset="0">
<signal id="6" type="294" subtype="none" s="41" t="-7" width="4.0" hOffset="0" pitch="0" roll="0" dynamic="no" country="DE" name="" orientation="+" zOffset="0">
<validity toLane="-2" fromLane="-2"/>
</signal>
<signal id="7" type="1004" subtype="30" value="200" s="40" t="-8" width="0.4" height="0.2" hOffset="0" zOffset="1.2" pitch="0" roll="0" dynamic="no" country="DE" name="" orientation="+">
......
......@@ -425,7 +425,7 @@ TEST(TrafficLights, SetSpecification_TwoLights_13)
{
FakeRoadSignal roadSignal;
ON_CALL(roadSignal, GetType()).WillByDefault(Return("1.000.013"));
ON_CALL(roadSignal, GetSubType()).WillByDefault(Return(""));
ON_CALL(roadSignal, GetSubType()).WillByDefault(Return("-1"));
ON_CALL(roadSignal, GetWidth()).WillByDefault(Return(0.1));
ON_CALL(roadSignal, GetHeight()).WillByDefault(Return(0.2));
Position position{};
......@@ -562,7 +562,7 @@ TEST(TrafficLights, SetSpecification_TwoLights_Pedestrian)
{
FakeRoadSignal roadSignal;
ON_CALL(roadSignal, GetType()).WillByDefault(Return("1.000.002"));
ON_CALL(roadSignal, GetSubType()).WillByDefault(Return(""));
ON_CALL(roadSignal, GetSubType()).WillByDefault(Return("-1"));
ON_CALL(roadSignal, GetWidth()).WillByDefault(Return(0.1));
ON_CALL(roadSignal, GetHeight()).WillByDefault(Return(0.2));
Position position{};
......@@ -590,7 +590,7 @@ TEST(TrafficLights, SetSpecification_TwoLights_PedestrianAndBike)
{
FakeRoadSignal roadSignal;
ON_CALL(roadSignal, GetType()).WillByDefault(Return("1.000.007"));
ON_CALL(roadSignal, GetSubType()).WillByDefault(Return(""));
ON_CALL(roadSignal, GetSubType()).WillByDefault(Return("-1"));
ON_CALL(roadSignal, GetWidth()).WillByDefault(Return(0.1));
ON_CALL(roadSignal, GetHeight()).WillByDefault(Return(0.2));
Position position{};
......@@ -657,7 +657,7 @@ TEST(TrafficLights, SetSpecification_OneLight_WithArrows_Red)
{
FakeRoadSignal roadSignal;
ON_CALL(roadSignal, GetType()).WillByDefault(Return("1.000.020"));
ON_CALL(roadSignal, GetSubType()).WillByDefault(Return(""));
ON_CALL(roadSignal, GetSubType()).WillByDefault(Return("-1"));
ON_CALL(roadSignal, GetWidth()).WillByDefault(Return(0.1));
ON_CALL(roadSignal, GetHeight()).WillByDefault(Return(0.2));
Position position{};
......@@ -700,7 +700,7 @@ TEST(TrafficLights, SetSpecification_OneLight_WithArrows_Yellow)
{
FakeRoadSignal roadSignal;
ON_CALL(roadSignal, GetType()).WillByDefault(Return("1.000.008"));
ON_CALL(roadSignal, GetSubType()).WillByDefault(Return(""));
ON_CALL(roadSignal, GetSubType()).WillByDefault(Return("-1"));
ON_CALL(roadSignal, GetWidth()).WillByDefault(Return(0.1));
ON_CALL(roadSignal, GetHeight()).WillByDefault(Return(0.2));
Position position{};
......@@ -743,7 +743,7 @@ TEST(TrafficLights, SetSpecification_OneLight_WithArrows_Green)
{
FakeRoadSignal roadSignal;
ON_CALL(roadSignal, GetType()).WillByDefault(Return("1.000.012"));
ON_CALL(roadSignal, GetSubType()).WillByDefault(Return(""));
ON_CALL(roadSignal, GetSubType()).WillByDefault(Return("-1"));
ON_CALL(roadSignal, GetWidth()).WillByDefault(Return(0.1));
ON_CALL(roadSignal, GetHeight()).WillByDefault(Return(0.2));
Position position{};
......@@ -835,7 +835,7 @@ TEST(TrafficLights, SetSpecification_SetsCorrectBaseTwoSignalTrafficLight)
ON_CALL(roadSignal, GetHOffset()).WillByDefault(Return(1.0));
ON_CALL(roadSignal, GetOrientation()).WillByDefault(Return(false));
ON_CALL(roadSignal, GetType()).WillByDefault(Return("1.000.002"));
ON_CALL(roadSignal, GetSubType()).WillByDefault(Return(""));
ON_CALL(roadSignal, GetSubType()).WillByDefault(Return("-1"));
Position position{10, 11, 1.5, 0};
osi3::TrafficLight osiLightRed;
......
......@@ -123,7 +123,7 @@ TEST(SceneryImporter_UnitTests, ParseSignalsWithValidSignal_ReturnsCorrectValues
EXPECT_DOUBLE_EQ(SignalInterceptor::signal.zOffset, 0.1);
EXPECT_EQ(SignalInterceptor::signal.country, "c1");
EXPECT_EQ(SignalInterceptor::signal.type, "none");
EXPECT_EQ(SignalInterceptor::signal.subtype, "none");
EXPECT_EQ(SignalInterceptor::signal.subtype, "-1"); //accoount for openDrive standard 1.6, subtype of "none" and "" are parsed to "-1"
EXPECT_DOUBLE_EQ(SignalInterceptor::signal.value, 0.123);
EXPECT_EQ(SignalInterceptor::signal.unit, RoadSignalUnit::Undefined);
EXPECT_DOUBLE_EQ(SignalInterceptor::signal.height, 1.01);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment