-
Notifications
You must be signed in to change notification settings - Fork 62
RJD-1057 (4/5): Remove non-API member functions: EntityManager’s member functions forwarded to EntityBase (2/2) #1334
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
RJD-1057 (4/5): Remove non-API member functions: EntityManager’s member functions forwarded to EntityBase (2/2) #1334
Conversation
…cessary from EntityManager
…o RJD-1057-remove-functions-forwarded-to-entity-base Signed-off-by: Mateusz Palczuk <[email protected]>
…ed-to-entity-base' into RJD-1057-remove-functions-forwarded-to-entity-base Signed-off-by: Mateusz Palczuk <[email protected]>
…o RJD-1057-remove-functions-forwarded-to-entity-base Signed-off-by: Mateusz Palczuk <[email protected]>
Signed-off-by: Mateusz Palczuk <[email protected]>
Signed-off-by: Mateusz Palczuk <[email protected]>
…le' into RJD-1057-remove-functions-forwarded-to-entity-base-with-middle Signed-off-by: Mateusz Palczuk <[email protected]>
…le' into RJD-1057-remove-functions-forwarded-to-entity-base-with-middle Signed-off-by: Mateusz Palczuk <[email protected]>
c9057f9
to
ff759fe
Compare
…le' into RJD-1057-remove-functions-forwarded-to-entity-base-refactor Signed-off-by: Mateusz Palczuk <[email protected]>
…ded-to-entity-base-middle' into RJD-1057-remove-functions-forwarded-to-entity-base-refactor
…le' into RJD-1057-remove-functions-forwarded-to-entity-base-refactor
…le' into RJD-1057-remove-functions-forwarded-to-entity-base-refactor
…le' into RJD-1057-remove-functions-forwarded-to-entity-base-refactor
…le' into RJD-1057-remove-functions-forwarded-to-entity-base-refactor
…tions-forwarded-to-entity-base-refactor Signed-off-by: Mateusz Palczuk <[email protected]>
Signed-off-by: Mateusz Palczuk <[email protected]>
…ity-base-refactor
…ity-base-refactor
…tions-forwarded-to-entity-base-refactor Signed-off-by: Mateusz Palczuk <[email protected]>
…ity-base-refactor
…ity-base-refactor
…ity-base-refactor
…ity-base-refactor
…ity-base-refactor
Failure optional scenariosNote This is an experimental check and does not block merging the pull-request. scenario failed: execution_time_test <failure type="SimulationFailure" message="CustomCommandAction typed "exitFailure" was triggered by the named Conditions {"update time checker", "avoid startup"}: {"update time checker": Is the /simulation/interpreter/execution_time/update (= 0.005911999999999999720612375853) is greaterThan 0.005?}, {"avoid startup": Is the simulation time (= 7.549999999999981170617502357345) is greaterThan 1.000000000000000000000000000000?}" /> |
…ity-base-refactor
…ity-base-refactor
Failure optional scenariosNote This is an experimental check and does not block merging the pull-request. scenario failed: execution_time_test <failure type="SimulationFailure" message="CustomCommandAction typed "exitFailure" was triggered by the named Conditions {"update time checker", "avoid startup"}: {"update time checker": Is the /simulation/interpreter/execution_time/update (= 0.005399000000000000153155266247) is greaterThan 0.005?}, {"avoid startup": Is the simulation time (= 6.549999999999984723331181157846) is greaterThan 1.000000000000000000000000000000?}" /> |
…ity-base-refactor
…ity-base-refactor
…ity-base-refactor
…ity-base-refactor
@hakuturu583 (or anyone merging this PR) When you decide to merge this PR, right before merging, please change the target branch of #1337 to |
|
Description
Important
Right before merging this PR, please change the target branch of #1337 to
master
.Otherwise that PR (which is next in line to be merged) will be closed automatically.
Abstract
This pull request mainly consists of refactoring and introduces changes in the
API
andEntityManager
.This pull request was divided into some parts (#1552, #1543, #1540, #1539) to make it easier to review.
Background
This pull request is an extension of the #1473.
Due to the fact that these pull requests combined would have been too large for a review, they have been split into two.
As a result of the previous PR, changes have been made to the
API
andEntityManager
classes.These changes created a great opportunity to declutter / tidy up the code of these classes.
This pull request consists of the code cleanup and refactoring. Many of the changes introduced are just changes to the order of functions inside the implementation file to keep them grouped by functionality and consistent with the header file.
Tip
When reviewing the changes, it may be easier to see the actual modifications by opening both versions of each file side by side rather than looking at the diff generated by GitHub.
This is due to the fact that GitHub shows lots of changes where mostly copying and pasting the code has been done (for reordering purposes).
Cpp mock scenarios
The change mentioned above has been applied in the whole codebase, which includes most of the cpp mock scenarios.
Cpp mock scenarios have been all changed like the following:
Before:
scenario_simulator_v2/mock/cpp_mock_scenarios/src/follow_front_entity/accelerate_and_follow.cpp
Lines 65 to 70 in 3592d90
After:
scenario_simulator_v2/mock/cpp_mock_scenarios/src/follow_front_entity/accelerate_and_follow.cpp
Lines 65 to 69 in b3f7235
Details
Below are all changes made in this PR
API
Renamed memberconfiguration
toconfiguration_
Most of the constructor logic has been moved toAPI::init()
member functionsetSiulationStepTime
scenario_simulator_v2/simulation/traffic_simulator/src/api/api.cpp
Lines 39 to 53 in b3f7235
Removed member functiongetZMQSocketPort
in favor of usinggetROS2Parameter
3spawn
functions have been combined into 1spawn
function (additional template parameterParamsType
was introduced for this reason)The remaining member functions that were defined using theFORWARD_TO_ENTITY_MANAGER
macro have been converted to standard member functionsImportant
All other changes are minor refactoring or just reordering functions in the file, which GitHub shows as big changes.
EntityManager
Renamed memberconfiguration
toconfiguration_
getOrigin
to free functionscenario_simulator_v2/simulation/traffic_simulator/include/traffic_simulator/utils/node_parameters.hpp
Lines 42 to 43 in f029407
getObstacle
getWaypoints
getGoalPoses
Removed these member functions in favor of using Entity field directlyAs mentioned in Background, thespawnEntity
function now returns a reference to the created entityspawn
API for getting entity #1544Removed member functioncreatePublisher
,createSubscription
Important
All other changes are minor refactoring or just reordering functions in the file, which GitHub shows as big changes.
EntityBase
Add member functionsas
getGoalPoses
return typeauto getGoalPoses() -> std::vector<CanonicalizedLaneletPose>
→
auto getGoalPoses() -> std::vector<geometry_msgs::msg::Pose>
MiscObjectEntity
getGoalPoses
return typeauto getGoalPoses() -> std::vector<CanonicalizedLaneletPose>
→
auto getGoalPoses() -> std::vector<geometry_msgs::msg::Pose>
PedestrianEntity
getGoalPoses
return typeauto getGoalPoses() -> std::vector<CanonicalizedLaneletPose>
→
auto getGoalPoses() -> std::vector<geometry_msgs::msg::Pose>
auto getParameters() const -> const traffic_simulator_msgs::msg::PedestrianParameters &;
VehicleEntity
getGoalPoses
return typeauto getGoalPoses() -> std::vector<CanonicalizedLaneletPose>
→
auto getGoalPoses() -> std::vector<geometry_msgs::msg::Pose>
auto getParameters() const -> const traffic_simulator_msgs::msg::VehicleParameters &;
Ostream helpers
Merged by #1539.
All existing operatorsstd::ostream & operator<<
have been moved from filehelper.[ch]pp
to a dedicated fileostream_helper.[ch]pp
.In addition many more operators have been added for the types
References
INTERNAL LINK 1
INTERNAL LINK 2
Destructive Changes
--
Known Limitations
--