-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tmp] RJD-1057 (5/5): Remove non-API member functions: Improve responsibility simulator_core<->api #1337
Draft
TauTheLepton
wants to merge
28
commits into
RJD-1057-remove-functions-forwarded-to-entity-base-refactor
Choose a base branch
from
ref/RJD-1057-improve-responsibility-simulator-core-api
base: RJD-1057-remove-functions-forwarded-to-entity-base-refactor
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…lized functions for distance calculations for each coordinate system
…nput instead of CanonicalizedLaneletPose
…ded-to-entity-base' into ref/RJD-1057-improve-responsibility-simulator-core-api
…wn() and setStatus() methods
…ded-to-entity-base-refactor' into ref/RJD-1057-improve-responsibility-simulator-core-api
Signed-off-by: Mateusz Palczuk <mateusz.palczuk@robotec.ai>
Signed-off-by: Mateusz Palczuk <mateusz.palczuk@robotec.ai>
…ze(), guarantee canonicalization of input in API, add exceptions to canonicalize()
… of https://github.com/tier4/scenario_simulator_v2 into ref/RJD-1057-improve-responsibility-simulator-core-api
…ce, move it to distance utils and use globally
yamacir-kit
deleted the branch
RJD-1057-remove-functions-forwarded-to-entity-base-refactor
September 18, 2024 01:43
yamacir-kit
deleted the
ref/RJD-1057-improve-responsibility-simulator-core-api
branch
September 18, 2024 01:45
dmoszynski
restored the
ref/RJD-1057-improve-responsibility-simulator-core-api
branch
September 23, 2024 09:27
…ded-to-entity-base-refactor' into ref/RJD-1057-improve-responsibility-simulator-core-api
…ded-to-entity-base-refactor' into ref/RJD-1057-improve-responsibility-simulator-core-api
Quality Gate passedIssues Measures |
dmoszynski
changed the title
[tmp] Remove non-API member functions: Improve responsibility simulator core api
[tmp] RJD-1057 (5/5): Remove non-API member functions: Improve responsibility simulator core api
Oct 15, 2024
…ctor' into ref/RJD-1057-improve-responsibility-simulator-core-api
…const to some passed arguments
dmoszynski
changed the title
[tmp] RJD-1057 (5/5): Remove non-API member functions: Improve responsibility simulator core api
[tmp] RJD-1057 (5/5): Remove non-API member functions: Improve responsibility simulator_core<->api
Dec 16, 2024
TauTheLepton
force-pushed
the
ref/RJD-1057-improve-responsibility-simulator-core-api
branch
from
December 18, 2024 11:27
f74c02f
to
25a088b
Compare
Quality Gate passedIssues Measures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
DO NOT MERGE | THIS IS A TEMPORARY PR | WHEN THE RIGHT TIME COMES, A CLONE WILL BE CAST TO MASTER
Abstract
This pull request aims to improve the responsibility division between traffic_simulator API and openscenario_interpreter SimulatorCore.
The changes include refactoring, renaming functions and reordering them in the source files. So even though the number of changes reported by github is rather high, many of the changes consist of moving functions around with slight if none modifications.
Background
This pull request is one of many that aim to modularize the scenario_simulator_v2.
Details
Canonicalization
The main changes are that canonicalization process (e.g. of lanelet pose) is a responsibility of traffic_simulator. This way the communication with traffic_simulator API is done on NON canonicalized data structures and traffic_simulator has to canonicalize the data.
As a result, cpp mock scenarios had to be adjusted to communicate using regular lanelet pose instead of canonicalized one.
Another result of this change is that the
NativeLanePosition
in SimulatorCore has been converted to NON canonicalized lanelet pose.SimulatorCore modifications and organizing
As for further changes:
SimulatorCore::CoordinateSystemConverion::convert<>
functions have been renamed toconvertToNativeLanePosition
andconvertToNativeWorldPosition
and slightly improvedCoordinateSystemConversion::makeNativeRelativeWorldPosition
functions have been removed, as they were no longer neededSimulatorCore::CoordinateSystemConversion
have been refactored and moved to a new classSimulatorCore::DistanceConditionEvaluation
. Also, relative pose functions have been removed in favor of new distance functions, because the relative pose was only used for distance calculation anyway.CoordinateSystemConversion::makeNativeRelativeLanePosition
has been removed in favor ofDistanceConditionEvaluation::lateralEntityDistance
andDistanceConditionEvaluation::longitudinalEntityDistance
CoordinateSystemConversion::makeNativeBoundingBoxRelativeLanePosition
has been removed in favor ofDistanceConditionEvaluation::lateralEntityBoundingBoxDistance
andDistanceConditionEvaluation::longitudinalEntityBoundingBoxDistance
CoordinateSystemConversion::makeNativeBoundingBoxRelativeWorldPosition
has been removed in favor ofDistanceConditionEvaluation::euclideanBoundingBoxDistance
DistanceConditionEvaluation::euclideanDistance
has been added for distance calculationSome other differences include conversion of some simulator core classes member functions to explicitly list arguments instead of using the variadic templates.
For example
applyAddEntityAction
before changescenario_simulator_v2/openscenario/openscenario_interpreter/include/openscenario_interpreter/simulator_core.hpp
Lines 271 to 275 in ff759fe
and after the change
scenario_simulator_v2/openscenario/openscenario_interpreter/include/openscenario_interpreter/simulator_core.hpp
Lines 310 to 316 in 98c1866
Many member functions of
SimulatorCore::ConditionEvaluation
have been changed to include a check whether the Entity exists and if not return NaN or other appropriate default value.For example
SimulatorCore::ConditionEvaluation::evaluateCollisionCondition
before changescenario_simulator_v2/openscenario/openscenario_interpreter/include/openscenario_interpreter/simulator_core.hpp
Lines 489 to 493 in ff759fe
and after the change
scenario_simulator_v2/openscenario/openscenario_interpreter/include/openscenario_interpreter/simulator_core.hpp
Lines 563 to 571 in 98c1866
Some functionality has been moved from openscenario interpreter simulator core to traffic simulator API, like the function
SimulatorCore::ConditionEvaluation::evaluateTimeHeadway
was converted fromscenario_simulator_v2/openscenario/openscenario_interpreter/include/openscenario_interpreter/simulator_core.hpp
Lines 532 to 549 in ff759fe
to
scenario_simulator_v2/openscenario/openscenario_interpreter/include/openscenario_interpreter/simulator_core.hpp
Lines 573 to 582 in 98c1866
with an addition of
traffic_siulator::API::timeHeadway
scenario_simulator_v2/simulation/traffic_simulator/src/api/api.cpp
Lines 367 to 381 in 98c1866
Function
activatePerformanceAssertion
has been moved fromNonStandardOperation
toActionApplication
.Function
activateNonUserDefinedControllers
has been moved fromNonStandardOperation
directly toSimulatorCore
.Functions
evaluateCurrentState
evaluateRelativeHeading
have been moved from
NonStandardOperation
toConditionEvaluation
.Functions
setConventionalTrafficLightsState
setConventionalTrafficLightConfidence
getConventionalTrafficLightsComposedState
compareConventionalTrafficLightsState
resetConventionalTrafficLightPublishRate
setV2ITrafficLightsState
resetV2ITrafficLightPublishRate
have been moved from
NonStandardOperation
to newly createdTrafficLightsOperation
class.Because of the changes listed above, many openscenario interpreter syntax classes had to have their parent classes adjusted.
DistanceCondition
Many changes have been applied to distance condition of openscenario interpreter. Most of these changes are simplifications that don't use the overloaded lambda functions and visitors, but rather just use newly developed
DistanceConditionEvaluation
member functions.For example the function
DistanceCondition::distance<CoordinateSystem::entity, RelativeDistanceType::euclidianDistance, RoutingAlgorithm::undefined, false>
has been changed fromscenario_simulator_v2/openscenario/openscenario_interpreter/src/syntax/distance_condition.cpp
Lines 143 to 179 in ff759fe
to
scenario_simulator_v2/openscenario/openscenario_interpreter/src/syntax/distance_condition.cpp
Lines 143 to 154 in 98c1866
The simplification comes from reducing the overloaded lambdas that have identical implementations to just one function call.
Distance calculation in traffic simulator
For simplicity some distance calculation functions have been added to traffic simulator API so that openscenario interpreter did not implement distance calculations but could use these functions here
scenario_simulator_v2/simulation/traffic_simulator/include/traffic_simulator/api/api.hpp
Lines 235 to 281 in 98c1866
Other changes come from the usage of modified functions that have been described above or are just simple style changes that should make the code more readable.
References
INTERNAL LINK
Destructive Changes
Known Limitations