diff --git a/doc/source/installation_guide/30_install_openpass.rst b/doc/source/installation_guide/30_install_openpass.rst index 9ef1fe550b343ca907d51715bd99d8c721ab2832..84473890d140e1b0d3bac4f4d472cb750abe7b97 100644 --- a/doc/source/installation_guide/30_install_openpass.rst +++ b/doc/source/installation_guide/30_install_openpass.rst @@ -169,7 +169,7 @@ The above directory structure will be created by following the instructions of t .. code-block:: cmake -G "MSYS Makefiles" \ - -D CMAKE_PREFIX_PATH="C:/msys64/mingw64/bin;C:/simopenpass/deps/thirdParty/FMILibrary;C:/simopenpass/deps/thirdParty/osi;C:/simopenpass/deps/thirdParty/protobuf;C:/simopenpass/deps/thirdParty/protobuf-shared" \ + -D CMAKE_PREFIX_PATH="C:/simopenpass/deps/thirdParty/FMILibrary;C:/simopenpass/deps/thirdParty/osi;C:/simopenpass/deps/thirdParty/protobuf;C:/simopenpass/deps/thirdParty/protobuf-shared;C:/msys64/mingw64/bin" \ -D CMAKE_INSTALL_PREFIX=C:/OpenPASS/bin/core \ -D CMAKE_BUILD_TYPE=Release \ -D USE_CCACHE=ON \ @@ -180,9 +180,11 @@ The above directory structure will be created by following the instructions of t -D CMAKE_CXX_COMPILER=g++ \ .. - .. note:: By specifying ``INSTALL_EXTRA_RUNTIME_DEPS=ON``, runtime dependencies will be copied to the installation directory when running ``make install``. - This applies to all dependencies located in the paths specified in ``CMAKE_PREFIX_PATH``. - + .. note:: + + - By specifying ``INSTALL_EXTRA_RUNTIME_DEPS=ON``, runtime dependencies will be copied to the installation directory when running ``make install``. This applies to all dependencies located in the paths specified in ``CMAKE_PREFIX_PATH``. + - Make sure that the path ``C:/msys64/mingw64/bin`` is the last path in the CMAKE_PREFIX_PATH. Otherwise cmake might find and use local versions of required libraries instead of the ones listed in the thirdparties folder. + .. tab:: Linux .. code-block:: diff --git a/doc/source/installation_guide/_static/msys2_packages.txt b/doc/source/installation_guide/_static/msys2_packages.txt index b1e264632b37a1f6f269913a8bedbc97fce1cb42..9248213f38fd7da2c0bea1f4028c1710c20c999e 100644 --- a/doc/source/installation_guide/_static/msys2_packages.txt +++ b/doc/source/installation_guide/_static/msys2_packages.txt @@ -1,33 +1,35 @@ # for simulator -pacman -S mingw-w64-x86_64-boost #Tested with 1.75.0-2 -pacman -S mingw-w64-x86_64-ccache #Tested with 3.7.9-1 -pacman -S mingw-w64-x86_64-cmake #Tested with 3.19.2-1 -pacman -S mingw-w64-x86_64-doxygen #Tested with 1.8.20-1 -pacman -S mingw-w64-x86_64-gcc #Tested with 10.2.0-6 -pacman -S mingw-w64-x86_64-gdb #Tested with 10.1-2 -pacman -S mingw-w64-x86_64-graphviz #Tested with 2.44.1-3 -pacman -S mingw-w64-x86_64-gtest #Tested with 1.11.0-4 -#pacman -S mingw-w64-x86_64-protobuf # currently uses custom build (3.17.3). See 'Installing the Source Packages' below. -pacman -S mingw-w64-x86_64-qt5 #Tested with 5.15.2-5 -pacman -S make #Tested with 4.3-1 +mingw-w64-x86_64-boost # Tested with 1.79.0-2 +mingw-w64-x86_64-ccache # Tested with 4.6-1 +mingw-w64-x86_64-cmake # Tested with 3.23.1-1 +mingw-w64-x86_64-doxygen # Tested with 1.9.3-2 +mingw-w64-x86_64-gcc # Tested with 11.2.0-10 +mingw-w64-x86_64-gdb # Tested with 11.2-2 +mingw-w64-x86_64-graphviz # Tested with 2.44.1-9 +mingw-w64-x86_64-gtest # Tested with 1.11.0-5 +mingw-w64-x86_64-qt5 # Tested with 5.15.2-15 +make # Tested with 4.3-3 # for documentation -pacman -S mingw-w64-x86_64-python #Tested with 3.9.6.2 -pacman -S mingw-w64-x86_64-python-pip #Tested with 21.1.3-2 -pacman -S mingw-w64-x86_64-python-lxml #Tested with 4.6.2-2 +mingw-w64-x86_64-python # Tested with 3.9.13-1 +mingw-w64-x86_64-python-pip # Tested with 22.0.4-1 +mingw-w64-x86_64-python-lxml # Tested with 4.8.0-1 -# get necessary latex style (assuming default paths for MSYS2) -wget -P /mingw64/share/texmf-dist/tex/latex/anyfontsize \ - http://mirrors.ctan.org/macros/latex/contrib/anyfontsize/anyfontsize.sty - -# fonts (picks up anyfontsize) and equation rendering in the documentation -pacman -S mingw-w64-x86_64-zziplib #Tested with 0.13.72-3 -pacman -S mingw-w64-x86_64-texlive-bin #Tested with 2021.20210424-5 -pacman -S mingw-w64-x86_64-texlive-core #Tested with 2021.20210519-2 -pacman -S mingw-w64-x86_64-texlive-font-utils #Tested with 2021.20210519-1 +# fonts and equation rendering in the documentation +mingw-w64-x86_64-texlive-bin # Tested with 2021.20210424-10 +mingw-w64-x86_64-texlive-core # Tested with 2021.20210906-1 +mingw-w64-x86_64-texlive-font-utils # Tested with 2021.20210906-1 +mingw-w64-x86_64-texlive-latex-extra # Tested with 2021.20210906-1 +mingw-w64-x86_64-zziplib # Tested with 0.13.72-3 # for sphinx/exhale -pacman -S libxslt-devel +libxslt-devel # Tested with 1.1.35-1 + +# additional recommendations +diffutils +dos2unix +git +patch +vim +mingw-w64-x86_64-ag -# additional python packages for documentation -pip3 install sphinx sphinx-rtd-theme sphinx-tabs breathe exhale sphinxcontrib-spelling diff --git a/doc/source/requirements.txt b/doc/source/requirements.txt index d967f0a1a59872e5f62a6cad716a8b8ee02611be..5587d0402a36f43d4d1b5fec1124ef412d1da50f 100644 --- a/doc/source/requirements.txt +++ b/doc/source/requirements.txt @@ -1,4 +1,6 @@ -sphinx==4.1.1 -sphinx-rtd-theme==0.5.2 -sphinxcontrib-spelling==7.2.1 -sphinx-tabs==3.1.0 \ No newline at end of file +breathe +exhale +sphinx +sphinx-rtd-theme +sphinx-tabs +sphinxcontrib-spelling diff --git a/doc/source/user_guide/configs/simulationconfig.rst b/doc/source/user_guide/configs/simulationconfig.rst index 98bb178a6fc8810122981d40113a867d6a5e153c..bef40d099452ab750fe9a17808e25904a0651b66 100644 --- a/doc/source/user_guide/configs/simulationconfig.rst +++ b/doc/source/user_guide/configs/simulationconfig.rst @@ -1,6 +1,7 @@ .. ******************************************************************************* Copyright (c) 2021 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 @@ -116,6 +117,7 @@ All probabilities need to add up to 1.0. Friction Friction on the road. Used by DynamicsRegularDriving and LimiterAccelerationVehicleComponents. 1+ entry Weather **Currently unused.** Weather as string 1+ entry TrafficRules Defines which set of TrafficRules to use from the ProfilesCatalog yes + TurningRates Defines the turning rates for random route generation no =================== ============================================================================================== ========= **Example** @@ -129,6 +131,29 @@ Every invocation has sunny weather. :language: xml :start-at: :end-at: + +**TurningRates** + +If routes are not defined in the Scenario, they are randomly generated. +Starting at the current agent position at each junction a random connector is chosen based on the weights given in the TurningRates element, until the route terminates at a road without successors or a maximum depth is reached. +If for a pair of incoming road / connector no weight is given, it is defaulted to 1. +At the below example an agent coming from road "R1" has a 1/3 chance of selecting "R1-2" and a 2/3 chance of selecting "R1-3". + +.. table:: + :class: tight-table + + =================== ============================== + Attribute Description + =================== ============================== + Incoming Id of the incoming road + Outgoing Id of the connector + Weight Weight for this pair + =================== ============================== + +.. literalinclude:: @OP_REL_SIM@/contrib/examples/Configurations/TurningRates/simulationConfig.xml + :language: xml + :start-at: + :end-at: .. _simulationconfig_observations: diff --git a/sim/contrib/examples/Configurations/DynamicOSMPSensorDataToTUStepper/OSMPSensorDataToTrafficUpdateStepper.fmu b/sim/contrib/examples/Configurations/DynamicOSMPSensorDataToTUStepper/OSMPSDToTUS.fmu similarity index 100% rename from sim/contrib/examples/Configurations/DynamicOSMPSensorDataToTUStepper/OSMPSensorDataToTrafficUpdateStepper.fmu rename to sim/contrib/examples/Configurations/DynamicOSMPSensorDataToTUStepper/OSMPSDToTUS.fmu diff --git a/sim/contrib/examples/Configurations/DynamicOSMPSensorDataToTUStepper/ProfilesCatalog.xml b/sim/contrib/examples/Configurations/DynamicOSMPSensorDataToTUStepper/ProfilesCatalog.xml index e8c001afb0dd9efb9a037c42277343adb0c9ba2d..5a6cfe30964db9b6428188b7a81b7723824e26f2 100644 --- a/sim/contrib/examples/Configurations/DynamicOSMPSensorDataToTUStepper/ProfilesCatalog.xml +++ b/sim/contrib/examples/Configurations/DynamicOSMPSensorDataToTUStepper/ProfilesCatalog.xml @@ -212,7 +212,7 @@ - + diff --git a/sim/contrib/examples/Configurations/StaticOSMPSensorDataToTUStepper/OSMPSensorDataToTrafficUpdateStepper.fmu b/sim/contrib/examples/Configurations/StaticOSMPSensorDataToTUStepper/OSMPSDToTUS.fmu similarity index 100% rename from sim/contrib/examples/Configurations/StaticOSMPSensorDataToTUStepper/OSMPSensorDataToTrafficUpdateStepper.fmu rename to sim/contrib/examples/Configurations/StaticOSMPSensorDataToTUStepper/OSMPSDToTUS.fmu diff --git a/sim/contrib/examples/Configurations/StaticOSMPSensorDataToTUStepper/SystemConfig.xml b/sim/contrib/examples/Configurations/StaticOSMPSensorDataToTUStepper/SystemConfig.xml index 6c80d7d9749353c6d5e01fc397e2b8e5f0c14b18..2e224ccace968326513de6675539b98e3ae2e14c 100644 --- a/sim/contrib/examples/Configurations/StaticOSMPSensorDataToTUStepper/SystemConfig.xml +++ b/sim/contrib/examples/Configurations/StaticOSMPSensorDataToTUStepper/SystemConfig.xml @@ -441,7 +441,7 @@ FmuPath string - OSMPSensorDataToTrafficUpdateStepper.fmu + OSMPSDToTUS.fmu Logging diff --git a/sim/contrib/examples/Configurations/TurningRates/ProfilesCatalog.xml b/sim/contrib/examples/Configurations/TurningRates/ProfilesCatalog.xml new file mode 100644 index 0000000000000000000000000000000000000000..bc13d348c46595d97d895c4274beb57147f8ee82 --- /dev/null +++ b/sim/contrib/examples/Configurations/TurningRates/ProfilesCatalog.xml @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sim/contrib/examples/Configurations/TurningRates/Scenario.xosc b/sim/contrib/examples/Configurations/TurningRates/Scenario.xosc new file mode 100644 index 0000000000000000000000000000000000000000..adbd0f956cd2d520cddb2ba3d357383771774256 --- /dev/null +++ b/sim/contrib/examples/Configurations/TurningRates/Scenario.xosc @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sim/contrib/examples/Configurations/TurningRates/SceneryConfiguration.xodr b/sim/contrib/examples/Configurations/TurningRates/SceneryConfiguration.xodr new file mode 100644 index 0000000000000000000000000000000000000000..ae89ed7dd529e1bcefc071a25f070e15522772bb --- /dev/null +++ b/sim/contrib/examples/Configurations/TurningRates/SceneryConfiguration.xodr @@ -0,0 +1,356 @@ + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + +
+
+ + + + + + +
+ + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sim/contrib/examples/Configurations/TurningRates/simulationConfig.xml b/sim/contrib/examples/Configurations/TurningRates/simulationConfig.xml new file mode 100644 index 0000000000000000000000000000000000000000..5b3a8066d2f9b12b52dda6ba18caab627eee1960 --- /dev/null +++ b/sim/contrib/examples/Configurations/TurningRates/simulationConfig.xml @@ -0,0 +1,89 @@ + + ProfilesCatalog.xml + + 123 + 1 + 532725206 + + World_OSI + + + + Scenario.xosc + + + + + + + + + + + + + + + + + + Germany + + + + + + + + + + + + Observation_Log + + + + + + + + + + + + + + Observation_EntityRepository + + + + + + + + + + + SpawnerScenario + PreRun + 1 + + + SpawnerPreRunCommon + PreRun + 0 + DefaultPreRunCommon + + + SpawnerRuntimeCommon + Runtime + 0 + DefaultRuntimeCommon + + + diff --git a/sim/include/roadInterface/roadObjectInterface.h b/sim/include/roadInterface/roadObjectInterface.h index ff792997775e48d15aa3bf7275026cb87bb2e419..6cd83c3810b57ce0b3eb895d697eaa618e9c4fc9 100644 --- a/sim/include/roadInterface/roadObjectInterface.h +++ b/sim/include/roadInterface/roadObjectInterface.h @@ -1,5 +1,6 @@ /******************************************************************************** * Copyright (c) 2017-2021 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 @@ -12,7 +13,7 @@ #include #include "roadElementTypes.h" -class RoadObjectInterface// : public RoadElementInterface +class RoadObjectInterface { public: RoadObjectInterface() = default; @@ -22,19 +23,90 @@ public: RoadObjectInterface& operator=(RoadObjectInterface&&) = delete; virtual ~RoadObjectInterface() = default; + //----------------------------------------------------------------------------- + //! @brief Returns the type of the road object + //! @return type + //----------------------------------------------------------------------------- virtual RoadObjectType GetType() const = 0; + + //----------------------------------------------------------------------------- + //! @brief Returns the unique identification string of the road object + //! @return id + //----------------------------------------------------------------------------- virtual std::string GetId() const = 0; + + //----------------------------------------------------------------------------- + //! @brief Returns the s coordinate of the road object + //! @return s coordinate [m] + //----------------------------------------------------------------------------- virtual double GetS() const = 0; + + //----------------------------------------------------------------------------- + //! @brief Returns the t coordinate of the road object + //! @return t coordinate [m] + //----------------------------------------------------------------------------- virtual double GetT() const = 0; + + //----------------------------------------------------------------------------- + //! @brief Returns the zOffset of the road object + //! @return zOffset [m] + //----------------------------------------------------------------------------- virtual double GetZOffset() const = 0; + + //----------------------------------------------------------------------------- + //! @brief Check, if road object is valid for provided lane id + //! + //! @param[in] laneId lane id to test validity for + //! + //! @return True if valid, false otherwise. + //----------------------------------------------------------------------------- virtual bool IsValidForLane(int laneId) const = 0; + + //----------------------------------------------------------------------------- + //! @brief Returns the length of the road object + //! @return length [m] + //----------------------------------------------------------------------------- virtual double GetLength() const = 0; + + //----------------------------------------------------------------------------- + //! @brief Returns the width of the road object + //! @return width [m] + //----------------------------------------------------------------------------- virtual double GetWidth() const = 0; - virtual double GetHdg() const = 0; + + //----------------------------------------------------------------------------- + //! @brief Returns the height of the road object + //! @return height [m] + //----------------------------------------------------------------------------- virtual double GetHeight() const = 0; + + //----------------------------------------------------------------------------- + //! @brief Returns the heading of the road object (relative to road direction) + //! @return heading [rad] + //----------------------------------------------------------------------------- + virtual double GetHdg() const = 0; + + //----------------------------------------------------------------------------- + //! @brief Returns the pitch of the road object + //! @return pitch [rad] + //----------------------------------------------------------------------------- virtual double GetPitch() const = 0; + + //----------------------------------------------------------------------------- + //! @brief Returns the roll of the road object + //! @return roll [rad] + //----------------------------------------------------------------------------- virtual double GetRoll() const = 0; + + //----------------------------------------------------------------------------- + //! @brief Returns wether this is a continuous object (e.g. guard rail) + //----------------------------------------------------------------------------- virtual bool IsContinuous() const = 0; + + //----------------------------------------------------------------------------- + //! @brief Returns the name of the road object + //! @return name + //----------------------------------------------------------------------------- virtual std::string GetName() const = 0; }; diff --git a/sim/include/roadInterface/roadSignalInterface.h b/sim/include/roadInterface/roadSignalInterface.h index 10b1c20409ef0f26566a1f5c873da09c67fe6303..50895161e110716ca6f11a1259c6bb0ef22c86b9 100644 --- a/sim/include/roadInterface/roadSignalInterface.h +++ b/sim/include/roadInterface/roadSignalInterface.h @@ -1,5 +1,6 @@ /******************************************************************************** * Copyright (c) 2019-2020 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 @@ -11,10 +12,9 @@ #include #include "roadElementTypes.h" -//#include "RoadElementInterface.h" //! Represents a RoadSignal in OpenDrive -class RoadSignalInterface// : public RoadElementInterface +class RoadSignalInterface { public: RoadSignalInterface() = default; diff --git a/sim/include/signalInterface.h b/sim/include/signalInterface.h index b2d36c0200b75383e583b97180bb888cb734a044..f1cdd1cc4560727ed46fe54e9377a83b7f2d5f1e 100644 --- a/sim/include/signalInterface.h +++ b/sim/include/signalInterface.h @@ -1,6 +1,7 @@ /******************************************************************************** * Copyright (c) 2016-2018 ITK Engineering GmbH * 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 @@ -11,6 +12,7 @@ #pragma once +#include #include #include diff --git a/sim/src/common/globalDefinitions.h b/sim/src/common/globalDefinitions.h index 0f3323241c2b38659ffa8320679459958f058539..257493b75fa1a22aa7041e2fbc773737efc1a7f7 100644 --- a/sim/src/common/globalDefinitions.h +++ b/sim/src/common/globalDefinitions.h @@ -19,6 +19,7 @@ #pragma once #include "common/opMath.h" +#include #include #include #include @@ -110,7 +111,7 @@ static constexpr std::array AgentCategoryMapping{ constexpr const char *to_cstr(AgentCategory agentCategory) { - return AgentCategoryMapping[static_cast(agentCategory)]; + return AgentCategoryMapping[static_cast(agentCategory)]; } inline std::string to_string(AgentCategory agentCategory) noexcept @@ -150,8 +151,8 @@ static constexpr std::array AgentVehicleTypeMapping{ constexpr const char *to_cstr(AgentVehicleType agentVehicleType) { - return AgentVehicleTypeMapping[static_cast(agentVehicleType) - - static_cast(AgentVehicleType::NONE)]; + return AgentVehicleTypeMapping[static_cast(agentVehicleType) - + static_cast(AgentVehicleType::NONE)]; } inline std::string to_string(AgentVehicleType agentVehicleType) noexcept diff --git a/sim/src/core/opSimulation/importer/road/roadObject.h b/sim/src/core/opSimulation/importer/road/roadObject.h index d04151a207e53a9dd84abbd124f48f07f05bb428..6621053818e8f5afa09f5e93cb38f9a3196efe2e 100644 --- a/sim/src/core/opSimulation/importer/road/roadObject.h +++ b/sim/src/core/opSimulation/importer/road/roadObject.h @@ -1,6 +1,7 @@ /******************************************************************************** * Copyright (c) 2017-2018 ITK Engineering GmbH * 2017-2021 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 @@ -22,74 +23,20 @@ public: object{object} {} - //----------------------------------------------------------------------------- - //! @brief Returns the unique identification string of the road object - //! @return id - //----------------------------------------------------------------------------- - std::string GetId() const; - - //----------------------------------------------------------------------------- - //! @brief Returns the s coordinate of the road object - //! @return s coordinate [m] - //----------------------------------------------------------------------------- - double GetS() const; - - //----------------------------------------------------------------------------- - //! @brief Returns the t coordinate of the road object - //! @return t coordinate [m] - //----------------------------------------------------------------------------- - double GetT() const; - - //----------------------------------------------------------------------------- - //! @brief Returns the zOffset of the road object - //! @return zOffset [m] - //----------------------------------------------------------------------------- - double GetZOffset() const; - - //----------------------------------------------------------------------------- - //! @brief Returns the heading of the road object (relative to road direction) - //! @return heading [rad] - //----------------------------------------------------------------------------- - double GetHdg() const; - - virtual double GetHeight() const; - virtual double GetPitch() const; - virtual double GetRoll() const; - - //----------------------------------------------------------------------------- - //! @brief Check, if road object is valid for provided lane id - //! - //! @param[in] laneId lane id to test validity for - //! - //! @return True if valid, false otherwise. - //----------------------------------------------------------------------------- - bool IsValidForLane(int laneId) const; - - //----------------------------------------------------------------------------- - //! @brief Returns the type of the road object - //! @return type - //----------------------------------------------------------------------------- - RoadObjectType GetType() const; - - //----------------------------------------------------------------------------- - //! @brief Returns the length of the road object - //! @return length [m] - //----------------------------------------------------------------------------- - double GetLength() const; - - //----------------------------------------------------------------------------- - //! @brief Returns the width of the road object - //! @return width [m] - //----------------------------------------------------------------------------- - double GetWidth() const; - + std::string GetId() const override; + double GetS() const override; + double GetT() const override; + double GetZOffset() const override; + double GetHdg() const override; + double GetHeight() const override; + double GetPitch() const override; + double GetRoll() const override; + bool IsValidForLane(int laneId) const override; + RoadObjectType GetType() const override; + double GetLength() const override; + double GetWidth() const override; bool IsContinuous() const override; - - //----------------------------------------------------------------------------- - //! @brief Returns the name of the road object - //! @return name - //----------------------------------------------------------------------------- - std::string GetName() const; + std::string GetName() const override; private: RoadInterface* road; diff --git a/sim/src/core/opSimulation/modules/World_OSI/WorldDataQuery.cpp b/sim/src/core/opSimulation/modules/World_OSI/WorldDataQuery.cpp index 54f9a148914e75347846988a2359563730d04e2d..de7aafa1d96e73e600188a92eec6a70ca9df7e87 100644 --- a/sim/src/core/opSimulation/modules/World_OSI/WorldDataQuery.cpp +++ b/sim/src/core/opSimulation/modules/World_OSI/WorldDataQuery.cpp @@ -1261,7 +1261,11 @@ std::map WorldDataQuery::GetEdgeWeights(const RoadGraph& { std::map weights; const auto& turningRates = worldData.GetTurningRates(); - for (auto [edge, edgesEnd] = edges(roadGraph); edge != edgesEnd; ++edge) + + RoadGraph::edge_iterator edge; + RoadGraph::edge_iterator edgesEnd; + + for (std::tie(edge, edgesEnd) = edges(roadGraph); edge != edgesEnd; ++edge) { auto turningRate = std::find_if(turningRates.cbegin(), turningRates.cend(), [&](const TurningRate& turningRate) diff --git a/sim/tests/endToEndTests/pyOpenPASS/requirements.txt b/sim/tests/endToEndTests/pyOpenPASS/requirements.txt index 12d75f8317c2890704cfef232cf740d2241743f3..364d051073b8011415a191fe17d97b94be59ff4d 100644 --- a/sim/tests/endToEndTests/pyOpenPASS/requirements.txt +++ b/sim/tests/endToEndTests/pyOpenPASS/requirements.txt @@ -8,6 +8,6 @@ # SPDX-License-Identifier: EPL-2.0 ################################################################################ junitparser==2.0.0 -lxml==6.4.2 -pandas==1.3.0 -pytest==7.1.2 \ No newline at end of file +lxml==4.6.5 +pandas==1.4.2 +pytest<7 \ No newline at end of file diff --git a/sim/tests/endToEndTests/test_end_to_end.json b/sim/tests/endToEndTests/test_end_to_end.json index 74b5fe057265eb3644437263a566ac9660c1827d..1990d1ac7b41b056e47c48e9fc88ede40a4b70ee 100644 --- a/sim/tests/endToEndTests/test_end_to_end.json +++ b/sim/tests/endToEndTests/test_end_to_end.json @@ -29,6 +29,7 @@ "Sensor_Latency", "StaticAgentCollision", "SupplementaryTrafficSigns", + "TurningRates", "TrafficJam", "TrafficLight" ], diff --git a/sim/tests/unitTests/components/AlgorithmAEB/CMakeLists.txt b/sim/tests/unitTests/components/AlgorithmAEB/CMakeLists.txt index 7efecea74a035705cbc1126f7ab3fc5a3c6d1390..f30a106682dd15ab7d82f207fb0da300a989cb9a 100644 --- a/sim/tests/unitTests/components/AlgorithmAEB/CMakeLists.txt +++ b/sim/tests/unitTests/components/AlgorithmAEB/CMakeLists.txt @@ -25,7 +25,7 @@ add_openpass_target( INCDIRS ${COMPONENT_SOURCE_DIR} - ${COMPONENT_SIMCORE_DIR}/core/opSimulation/modules/World_OSI + ${OPENPASS_SIMCORE_DIR}/core/opSimulation/modules/World_OSI LIBRARIES Qt5::Core diff --git a/utils/ci/Jenkinsfile b/utils/ci/Jenkinsfile index d73ceb22de289182e545b11897d00cd71af11296..44832baca01eec8695a970c446d84fcc380112bc 100644 --- a/utils/ci/Jenkinsfile +++ b/utils/ci/Jenkinsfile @@ -93,7 +93,7 @@ spec: } post { always { - archiveArtifacts allowEmptyArchive: true, artifacts: 'artifacts/**,dist/opSim/testreport/**', followSymlinks: false + archiveArtifacts allowEmptyArchive: true, artifacts: 'artifacts/**', followSymlinks: false junit allowEmptyResults: true, testResults: 'build/**/*Tests.xml,repo/sim/tests/endToEndTests/pyOpenPASS/result_*.xml' } } @@ -144,7 +144,7 @@ spec: post { always { bat 'subst W: /d' - archiveArtifacts allowEmptyArchive: true, artifacts: 'artifacts/**,dist/opSim/testreport/**', followSymlinks: false + archiveArtifacts allowEmptyArchive: true, artifacts: 'artifacts/**', followSymlinks: false junit allowEmptyResults: true, testResults: 'build/**/*Tests.xml,repo/sim/tests/endToEndTests/pyOpenPASS/result_*.xml' } } diff --git a/utils/ci/scripts/20_configure.sh b/utils/ci/scripts/20_configure.sh index 3aa299d48215cc8a1d49a3ac4c47a2c500119e04..b62bce417829e4319f4aaa5c2dba4a0cd10630bb 100755 --- a/utils/ci/scripts/20_configure.sh +++ b/utils/ci/scripts/20_configure.sh @@ -70,7 +70,7 @@ cmake \ "$CMAKE_PYTHON_COMMAND_ARG" \ $CMAKE_VERSION_ARG \ -D CMAKE_PREFIX_PATH="$(join_paths ${DEPS[@]})" \ - -D CMAKE_INSTALL_PREFIX="$PWD/../dist/opSim" \ + -D CMAKE_INSTALL_PREFIX="$PWD/../dist/opSimulation" \ -D CMAKE_BUILD_TYPE=Release \ -D INSTALL_BIN_DIR:STRING=. \ -D INSTALL_EXTRA_RUNTIME_DEPS=ON \ diff --git a/utils/ci/scripts/30_build.sh b/utils/ci/scripts/30_build.sh index 19ad29549fe43ce82bdc8a576dc85d44c3afc8f7..ea2dbd3e7a2bd4d7d323976dd374b45f481bd778 100755 --- a/utils/ci/scripts/30_build.sh +++ b/utils/ci/scripts/30_build.sh @@ -17,5 +17,13 @@ MYDIR="$(dirname "$(readlink -f $0)")" cd "$MYDIR/../../../../build" || exit 1 -make -j4 install VERBOSE=1 +if hash nproc 2>/dev/null; then + # calculation is kept for reference + MAKE_JOB_COUNT=$(($(nproc)/4)) +else + # fallback, if nproc doesn't exist + MAKE_JOB_COUNT=1 +fi + +make -j$MAKE_JOB_COUNT install diff --git a/utils/ci/scripts/50_test.sh b/utils/ci/scripts/50_test.sh index bcfc67a15a9a850f5935a710d96bfbc6c041d6b3..9f3d45ba04c0cc5e6c4f30c43f1bbe6b84c9cdb9 100755 --- a/utils/ci/scripts/50_test.sh +++ b/utils/ci/scripts/50_test.sh @@ -17,5 +17,19 @@ MYDIR="$(dirname "$(readlink -f $0)")" cd "$MYDIR/../../../../build" || exit 1 -make -j2 test ARGS="-j2 --output-on-failure" +if hash nproc 2>/dev/null; then + MAKE_JOB_COUNT=$(($(nproc)/4)) +else + # fallback, if nproc doesn't exist + MAKE_JOB_COUNT=1 +fi + +if [[ $MAKE_JOB_COUNT -eq 0 ]]; then + # fallback, if nproc == 1 + MAKE_JOB_COUNT=1 +fi + +export MAKEFLAGS=-j${MAKE_JOB_COUNT} + +ctest -j1 --output-on-failure diff --git a/utils/ci/scripts/90_pack_artifacts.sh b/utils/ci/scripts/90_pack_artifacts.sh index 5f12d26d49513dd71115ba9e0ed37e7aa04489e1..14f4f9bbd6e8469d359429ae012a7d1218c4e56a 100755 --- a/utils/ci/scripts/90_pack_artifacts.sh +++ b/utils/ci/scripts/90_pack_artifacts.sh @@ -2,6 +2,7 @@ ################################################################################ # Copyright (c) 2021 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 @@ -15,14 +16,27 @@ ################################################################################ MYDIR="$(dirname "$(readlink -f $0)")" -cd "$MYDIR/../../../../dist/opSim" || exit 1 +cd "$MYDIR/../../../../dist" || exit 1 -mkdir -p ../../artifacts || exit 1 +SIM_NAME=openPASS_SIM +E2E_NAME=openPASS_EndToEndTests + +mkdir -p ../artifacts/testreport || exit 1 if [[ "${OSTYPE}" = "msys" ]]; then - $MYDIR/util_zip.sh ../../artifacts/openPASS_SIM.zip doc gui modules schemas opSimulation.exe opSimulationManager.exe openPASS.exe *.dll - $MYDIR/util_zip.sh ../../artifacts/openPASS_EndToEndTests.zip artifacts + mv opSimulation/testreport ../artifacts/testreport/linux + $MYDIR/util_zip.sh ../artifacts/${E2E_NAME}.zip opSimulation/artifacts else - $MYDIR/util_tar.sh ../../artifacts/openPASS_SIM.tar.gz doc gui lib modules schemas opSimulation opSimulationManager openPASS *.so* --ignore-failed-read - $MYDIR/util_tar.sh ../../artifacts/openPASS_EndToEndTests.tar.gz artifacts --ignore-failed-read + mv opSimulation/testreport ../artifacts/testreport/windows + $MYDIR/util_tar.sh ../artifacts/${E2E_NAME}.tar.gz opSimulation/artifacts fi + +rm -rf opSimulation/artifacts opSimulation/configs opSimulation/results +mkdir opSimulation/configs + +if [[ "${OSTYPE}" = "msys" ]]; then + $MYDIR/util_zip.sh ../artifacts/${SIM_NAME}.zip opSimulation +else + $MYDIR/util_tar.sh ../artifacts/${SIM_NAME}.tar.gz opSimulation +fi + diff --git a/utils/ci/scripts/setup_env.cmd b/utils/ci/scripts/setup_env.cmd new file mode 100644 index 0000000000000000000000000000000000000000..d5cb27ed3594d34e6b030fe42193435cea577cfa --- /dev/null +++ b/utils/ci/scripts/setup_env.cmd @@ -0,0 +1,150 @@ +::################################################################################ +::# Copyright (c) 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 +::# http://www.eclipse.org/legal/epl-2.0. +::# +::# SPDX-License-Identifier: EPL-2.0 +::################################################################################ + +@echo off +set ME=%0 +set LC_ALL=C + +if [%1] == [] ( + call :showUsage + exit /b 1 +) + +set TARGET_PATH=%~f1 + +set MSYS2_TARGET_PATH=%TARGET_PATH%\msys64 +set MSYS2_SHELL=%MSYS2_TARGET_PATH%\usr\bin\bash.exe -lc +set MSYS2_PACKAGE=msys2-base-x86_64-latest.sfx.exe +set MSYS2_URL=https://github.com/msys2/msys2-installer/releases/download/nightly-x86_64/%MSYS2_PACKAGE% + +set PYTHON_TARGET_PATH=%TARGET_PATH%\Python +set PYTHON_VERSION=3.10.4 +set PYTHON_PACKAGE=python-%PYTHON_VERSION%-amd64.exe +set PYTHON_URL=https://www.python.org/ftp/python/%PYTHON_VERSION%/%PYTHON_PACKAGE% + +set MSVCRT_URL=https://aka.ms/highdpimfc2013x64enu +set MSVCRT_PACKAGE=vcredist_x64.exe + +set OLD_PATH=%PATH% +set MSYSTEM=MINGW64 +set CHERE_INVOKING=yes +set PATH=%MSYS2_TARGET_PATH%;%PATH% + +call :getAbsPath %~dp0..\.. +set REPO_ROOT=%ABS_PATH% + +echo. +echo ========================================== +echo openPASS development environment bootstrap +echo ========================================== +echo. + +pushd %TEMP% + +echo Installing MCVCRT120... +if not exist %MSVCRT_PACKAGE% ( + echo downloading... + powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile(${env:MSVCRT_URL}, ${env:MSVCRT_PACKAGE})" + if %ERRORLEVEL% neq 0 GOTO cleanup +) + +echo installing... +%MSVCRT_PACKAGE% /passive /quiet /norestart +if %ERRORLEVEL% neq 0 GOTO cleanup + +if not exist %MSYS2_TARGET_PATH% ( + echo Installing msys2... + if not exist %MSYS2_PACKAGE% ( + echo downloading... + rem curl -s -f -L -O %MSYS2_URL% + powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile(${env:MSYS2_URL}, ${env:MSYS2_PACKAGE})" + if %ERRORLEVEL% neq 0 GOTO cleanup + ) + + echo installing... + %MSYS2_PACKAGE% -y -o%TARGET_PATH% + if %ERRORLEVEL% neq 0 GOTO cleanup + + echo First launch of msys2... + %MSYS2_SHELL% "true" +) + +echo. +echo Running msys2 core update... +%MSYS2_SHELL% "pacman -Syuu --noconfirm" +if %ERRORLEVEL% neq 0 GOTO cleanup + +echo. +echo Running msys2 update... +%MSYS2_SHELL% "pacman -Syuu --noconfirm" +if %ERRORLEVEL% neq 0 GOTO cleanup + +echo. +echo Installing/upgrading required MSYS packages... +rem sed command strips comments from msys2_packages.txt file +%MSYS2_SHELL% "pacman -S --noconfirm --needed $(sed -e '/^\W*#/d;s/#.*//;/^$/d' $(cygpath -a $REPO_ROOT)doc/source/installation_guide/_static/msys2_packages.txt)" +if %ERRORLEVEL% neq 0 GOTO cleanup + +echo. +echo Upgrading pip... +%MSYS2_SHELL% "python -m pip install -U pip" +if %ERRORLEVEL% neq 0 GOTO cleanup + +echo. +echo Installing/upgrading Python packages for documentation build... +%MSYS2_SHELL% "pip install -U -r $(cygpath -a $REPO_ROOT)doc/source/requirements.txt" +if %ERRORLEVEL% neq 0 GOTO cleanup + +echo. +echo Installing Python for E2E tests... +if not exist %PYTHON_TARGET_PATH%\python.exe ( + if not exist %PYTHON_PACKAGE% ( + echo downloading... + rem curl -s -f -L -O %PYTHON_URL% + powershell -command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile(${env:PYTHON_URL}, ${env:PYTHON_PACKAGE})" + if %ERRORLEVEL% neq 0 GOTO cleanup + ) + + echo installing... + rem See https://docs.python.org/3/using/windows.html#installing-without-ui + %PYTHON_PACKAGE% InstallAllUsers=1 AssociateFiles=0 Shortcuts=0 Include_doc=0 Include_launcher=0 Include_tcltk=0 Include_test=0 InstallLauncherAllUsers=0 DefaultAllUsersTargetDir=%PYTHON_TARGET_PATH% + if %ERRORLEVEL% neq 0 GOTO cleanup +) + +echo Upgrading pip... +"%PYTHON_TARGET_PATH%\python.exe" -m pip install -U pip +if %ERRORLEVEL% neq 0 GOTO cleanup + +echo Installing/upgrading Python packages for E2E tests... +"%PYTHON_TARGET_PATH%\python.exe" -m pip install -U -r %REPO_ROOT%\sim\tests\endToEndTests\pyOpenPASS\requirements.txt +if %ERRORLEVEL% neq 0 GOTO cleanup + +echo. +echo ==== +echo DONE +echo ==== +echo. + +set PATH=%OLD_PATH% +popd +exit /b 0 + +:showUsage +echo Usage: %ME% ^ +goto :eof + +:getAbsPath +SET ABS_PATH=%~dp1 +goto :eof + +:cleanup +set PATH=%OLD_PATH% +popd +exit /b 1 diff --git a/utils/ci/scripts/setup_env.sh b/utils/ci/scripts/setup_env.sh new file mode 100755 index 0000000000000000000000000000000000000000..a99d2e68515e25bf7b5563503d887668ecd826af --- /dev/null +++ b/utils/ci/scripts/setup_env.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +################################################################################ +# Copyright (c) 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 https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +################################################################################ + +for f in $(find /etc/apt -type f -name '*.list'); do + sed -i -e 's/focal/jammy/g' "$f" +done + +apt-get -qq update && apt-get -qq dist-upgrade && apt-get install -qq -y --no-install-recommends \ + build-essential \ + ca-certificates \ + ccache \ + cmake \ + dos2unix \ + doxygen \ + git \ + google-mock \ + googletest \ + graphviz \ + lcov \ + libgmock-dev \ + libgtest-dev \ + libprotobuf-dev \ + libqt5xmlpatterns5-dev \ + protobuf-compiler \ + python3 \ + python3-distutils \ + python3-pip \ + qtbase5-dev \ + && apt-get -qq clean + +apt-get install -qq -y --no-install-recommends \ + texlive-base \ + texlive-latex-extra + + +pip install \ + approvaltests==3.1.0 \ + empty-files \ + breathe \ + conan \ + exhale \ + junitparser \ + lxml \ + pandas \ + pytest \ + sphinx \ + sphinx-rtd-theme \ + sphinx-tabs \ + sphinxcontrib-spelling \ + watchdog +