-
Notifications
You must be signed in to change notification settings - Fork 60
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 (1/5): Remove non-API member functions: EntityManager’s TrafficLight related member functions #1406
RJD-1057 (1/5): Remove non-API member functions: EntityManager’s TrafficLight related member functions #1406
Conversation
Signed-off-by: Mateusz Palczuk <[email protected]>
…-entity-manager Signed-off-by: Mateusz Palczuk <[email protected]>
…instead of TrafficLightsManager/Supervisor
…dencies on hdmap_utils, improve creation
… simple_sensor_simulator
Signed-off-by: Mateusz Palczuk <[email protected]>
Signed-off-by: Mateusz Palczuk <[email protected]>
…move overloads, improve publisher
…ttps://github.com/tier4/scenario_simulator_v2 into RJD-1057-remove-traffic-lights-from-entity-manager
Signed-off-by: Mateusz Palczuk <[email protected]>
Signed-off-by: Mateusz Palczuk <[email protected]>
Signed-off-by: Mateusz Palczuk <[email protected]>
Signed-off-by: Mateusz Palczuk <[email protected]>
Signed-off-by: Mateusz Palczuk <[email protected]>
Use pointer for traffic lights Signed-off-by: Mateusz Palczuk <[email protected]>
Signed-off-by: Mateusz Palczuk <[email protected]>
Signed-off-by: Mateusz Palczuk <[email protected]>
Signed-off-by: Mateusz Palczuk <[email protected]>
Signed-off-by: Mateusz Palczuk <[email protected]>
Signed-off-by: Mateusz Palczuk <[email protected]>
Signed-off-by: Mateusz Palczuk <[email protected]>
… rate updater Signed-off-by: Mateusz Palczuk <[email protected]>
simulation/traffic_simulator/src/traffic_lights/traffic_lights.cpp
Outdated
Show resolved
Hide resolved
simulation/traffic_simulator/src/traffic_lights/traffic_lights_base.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Mateusz Palczuk <[email protected]>
simulation/traffic_simulator/include/traffic_simulator/traffic_lights/traffic_lights.hpp
Outdated
Show resolved
Hide resolved
simulation/traffic_simulator/include/traffic_simulator/traffic_lights/traffic_lights.hpp
Outdated
Show resolved
Hide resolved
simulation/traffic_simulator/src/traffic_lights/configurable_rate_updater.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Mateusz Palczuk <[email protected]>
Signed-off-by: Mateusz Palczuk <[email protected]>
Signed-off-by: Mateusz Palczuk <[email protected]>
- color => color_message - status => status_message - shape => shape_message Signed-off-by: Mateusz Palczuk <[email protected]>
2 is a change request to this pull request. But 1 is not. Do you think you should work on 1 in this pull request? We think it is ok to push it to the queue of items that need to be refactored if we need a lot of additional time on it. |
In this PRThe current implementation from this PR is performing the conversions as following
Prior to this PRBefore the change, the conversions were as following Where the last step was performed in publishers present in traffic_simulator. ProposalIf I understand correctly, ultimately the However, recently there was a new ROS message introduced together with ROS publisher in #1262. Will this message type (and publishing) be ultimately dropped as well, or will it continue to be used? If this message type will continue to be used:
This For example, as currently there exists a need to publish some Autoware messages from within the traffic_simulator, there could be a conversion Any of the conversions from Does this change meet your requirements? If not, please let me know your preferred way of making the requested change. |
@TauTheLepton Thank you for suggestion. list of components
|
example | autoware_auto_perception_msgs::TrafficLight |
purpose | to provide (V2I) traffic light information from simulator to Autoware |
current communication | simulator -> autoware (V2I traffic light: traffic_simulator -> autoware) |
ideal communication | simulator -> autoware |
Note that AWSIM provides traffic light information through Autoware's image input, so traffic light messages may not necessarily be used.
Internal message
Question: Will this message type (and publishing) be ultimately dropped as well, or will it continue to be used?
Answer: No, internal message will be used continuously.
example | traffic_simulator_msgs::TrafficLightV1 |
purpose | to provide stable traffic light message for external services like Autoware Evaluator |
current communication | traffic_simulator -> external services |
ideal communication | traffic_simulator -> external services |
Note that this message has no motivation to move to simple_sensor_simulator
.
detailed background of the internal message
Each time Autoware's traffic light messages changed, peripheral tools that handle traffic light information, such as scenario_simulator_v2
and Autoware Evaluator
(mainly for visualizing traffic lights), were forced to support new message.
While Autoware's traffic light messages are heavily influenced by changes to the internal specifications of the traffic light recognition function, the information required for traffic_simulator and Autoware Evaluator to process has remained almost unchanged long time.
So, the internal message ( traffic_simulator_msgs::TrafficLightV1
) was provided to provide a traffic light topic with stable specifications from traffic_simulator for Autoware Evaluator, and this internal message will continue to be provided as long as Autoware Evaluator visualizes traffic lights.
proto
example | simulation_api_schema |
purpose | to provide traffic light information without ROS, to simulate traffic lights in various simulators |
current communication | traffic_simulator -> simulator |
ideal communication | traffic_simulator -> simulator |
About your proposal
First of all, than you for your suggestion.
And I apologize for not giving you enough information.
Now that we have all the information, it is easier to understand.
The only message that is always used in both traffic_simualtor
and simulator( simple_sensor_simulator
) is proto, which shows that proto-centric conversion is simple and effective.
An internal-centric conversion is one option, but you shouldn't bring Internal
into the simulator unless you need to.
So again, I want to go back to a proto-centric conversion architecture.
…a proto-centric conversion architecture
@yamacir-kit @HansRobo Briefly about the changes:
Regarding to the move of |
@dmoszynski CC: @yamacir-kit Note
Yes. Your diagram aligns with our future architecture, and I appreciate your foresight. |
Signed-off-by: Mateusz Palczuk <[email protected]>
Do not use 'default' in switch over enum to get compilation error when not all cases are considered Signed-off-by: Mateusz Palczuk <[email protected]>
…fic-lights-from-entity-manager Signed-off-by: Mateusz Palczuk <[email protected]>
Regression testsThe regression tests have been performed and they have proven no regressions. Note The regression tests have actually been performed some time ago, more precisely on this commit: de0e44a After this commit, only some minor changes have been introduced, and we believe these changes have no way of affecting regression tests results. These changes include:
|
Quality Gate passedIssues Measures |
Description
Abstract
This pull request introduces the change of removing any traffic lights functionality from
EntityManager
class and encapsulating it inside the newTrafficLights
class.The responsibility of managing traffic lights have been moved to the API.
The change got rid of
simulation_api_schema
proto messages fromtraffic_simulator
and transitioned to using ROS messages only. Proto messages are now used exclusively insimple_sensor_simulator
.The general goal of this PR is to divide scenario_simulator_v2 into smaller modules with some specific functionality and responsibilities. Apart from module dividing, some code has been refactored to make it cleaner, simpler and easier to read.
Background
This pull request is one of many that aim to modularize the scenario_simulator_v2.
Details
The traffic lights functionality has been aggregated in one master
TrafficLights
class. This way, all components that make up traffic lights are grouped together and managed by one resource. This master class - along with the responsibility - has been moved to the API. Although theEntityManager
does hold a reference toTrafficLights
, which is needed by NPCs.Newly developed class
TrafficLights
and its components contain some additional functionality that has been spread throughout the whole scenario_simulator_v2 codebase, like the member functionisRequiredStopTrafficLightState
orgetConventionalTrafficLightsComposedState
.The new traffic lights classes encapsulated by
TrafficLights
are designed in such a way, that they do not share the underlyingTrafficLight
object, but act as a middleman modifying theTrafficLight
object as needed:scenario_simulator_v2/simulation/traffic_simulator/include/traffic_simulator/traffic_lights/traffic_lights_base.hpp
Lines 60 to 73 in a06f4b4
Some additional traffic light message type conversions have been developed in order to get rid of the
simulation_api_schema
dependency intraffic_simulator
and make message managing easier. Also, the traffic lights are now responsible for generating the messages:scenario_simulator_v2/simulation/traffic_simulator/include/traffic_simulator/traffic_lights/traffic_lights_base.hpp
Lines 75 to 80 in a06f4b4
Additionally, a dedicated message publisher has been developed for
simple_sensor_simulator
:scenario_simulator_v2/simulation/simple_sensor_simulator/include/simple_sensor_simulator/sensor_simulation/traffic_lights/traffic_lights_publisher.hpp
Lines 27 to 53 in a06f4b4
Please note that this PR removes all tests for
TrafficLightManager
as these tests have no purpose with the newTrafficLights
implementation.New tests have been developed on this branch (here is a diff), but they have not been added to this PR, as this is a large PR by itself as is now.
We are planning to cast a new PR with just the tests. However, if the reviewer would like to have the tests included in this PR as well, we can do that, just please let us know.
Please just note, that then (with tests included) this PR will become very large with over 2000 additions (tests alone have 1000 additions).
Additional note: many of the changes are restructuring, so the code is changed only a little, if at all, but it has been moved to some other places like for example this has been moved here.
Likewise, these type conversions have been moved from
publish
member functions to appropriate traffic lights functions, which use cast conversions defined here.References
INTERNAL LINK
PREVIOUS INTERNAL LINK
Regression tests
Regression report
Local tests with deeper regression investigation (no regression confirmed)
Destructive Changes
None
Known Limitations
None