diff --git a/common/math/arithmetic/CHANGELOG.rst b/common/math/arithmetic/CHANGELOG.rst index aa16adc5c22..aff9cab6d9c 100644 --- a/common/math/arithmetic/CHANGELOG.rst +++ b/common/math/arithmetic/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package arithmetic * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/common/math/arithmetic/package.xml b/common/math/arithmetic/package.xml index 5359557440a..ece94f78036 100644 --- a/common/math/arithmetic/package.xml +++ b/common/math/arithmetic/package.xml @@ -2,7 +2,7 @@ arithmetic - 7.3.5 + 7.4.0 arithmetic library for scenario_simulator_v2 Tatsuya Yamasaki Apache License 2.0 diff --git a/common/math/geometry/CHANGELOG.rst b/common/math/geometry/CHANGELOG.rst index 13b2337a6d1..fb925bba11c 100644 --- a/common/math/geometry/CHANGELOG.rst +++ b/common/math/geometry/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package geometry * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/common/math/geometry/package.xml b/common/math/geometry/package.xml index e71c610b491..59fcfab93aa 100644 --- a/common/math/geometry/package.xml +++ b/common/math/geometry/package.xml @@ -2,7 +2,7 @@ geometry - 7.3.5 + 7.4.0 geometry math library for scenario_simulator_v2 application Masaya Kataoka Apache License 2.0 diff --git a/common/scenario_simulator_exception/CHANGELOG.rst b/common/scenario_simulator_exception/CHANGELOG.rst index a4da7e1cd2a..48eba2943d6 100644 --- a/common/scenario_simulator_exception/CHANGELOG.rst +++ b/common/scenario_simulator_exception/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package scenario_simulator_exception * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/common/scenario_simulator_exception/package.xml b/common/scenario_simulator_exception/package.xml index 8c7c57d12ad..c081bd4e781 100644 --- a/common/scenario_simulator_exception/package.xml +++ b/common/scenario_simulator_exception/package.xml @@ -2,7 +2,7 @@ scenario_simulator_exception - 7.3.5 + 7.4.0 Exception types for scenario simulator Tatsuya Yamasaki Apache License 2.0 diff --git a/common/simple_junit/CHANGELOG.rst b/common/simple_junit/CHANGELOG.rst index 6c02e36f7fd..59e538a43b5 100644 --- a/common/simple_junit/CHANGELOG.rst +++ b/common/simple_junit/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package junit_exporter * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/common/simple_junit/package.xml b/common/simple_junit/package.xml index 9cd71f93546..78350e465e4 100644 --- a/common/simple_junit/package.xml +++ b/common/simple_junit/package.xml @@ -2,7 +2,7 @@ simple_junit - 7.3.5 + 7.4.0 Lightweight JUnit library for ROS 2 Masaya Kataoka Tatsuya Yamasaki diff --git a/common/status_monitor/CHANGELOG.rst b/common/status_monitor/CHANGELOG.rst index 12597381f87..7462d598e06 100644 --- a/common/status_monitor/CHANGELOG.rst +++ b/common/status_monitor/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package status_monitor * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/common/status_monitor/package.xml b/common/status_monitor/package.xml index 50ba0ad6d62..2d27a4744dc 100644 --- a/common/status_monitor/package.xml +++ b/common/status_monitor/package.xml @@ -2,7 +2,7 @@ status_monitor - 7.3.5 + 7.4.0 none Tatsuya Yamasaki Apache License 2.0 diff --git a/external/concealer/CHANGELOG.rst b/external/concealer/CHANGELOG.rst index 9ba0ac68007..5dcdb3b0850 100644 --- a/external/concealer/CHANGELOG.rst +++ b/external/concealer/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package concealer * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge pull request `#1488 `_ from tier4/refactor/concealer-1 diff --git a/external/concealer/package.xml b/external/concealer/package.xml index 2ea0d6d8de6..a474d938c82 100644 --- a/external/concealer/package.xml +++ b/external/concealer/package.xml @@ -2,7 +2,7 @@ concealer - 7.3.5 + 7.4.0 Provides a class 'Autoware' to conceal miscellaneous things to simplify Autoware management of the simulator. Tatsuya Yamasaki Apache License 2.0 diff --git a/external/embree_vendor/CHANGELOG.rst b/external/embree_vendor/CHANGELOG.rst index 34389cb2c5e..432731a3e1c 100644 --- a/external/embree_vendor/CHANGELOG.rst +++ b/external/embree_vendor/CHANGELOG.rst @@ -24,6 +24,21 @@ Changelog for package embree_vendor * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/external/embree_vendor/package.xml b/external/embree_vendor/package.xml index 74d2abe8c3a..2e44fe26ff7 100644 --- a/external/embree_vendor/package.xml +++ b/external/embree_vendor/package.xml @@ -2,7 +2,7 @@ embree_vendor - 7.3.5 + 7.4.0 vendor packages for intel raytracing kernel library masaya Apache 2.0 diff --git a/map/kashiwanoha_map/CHANGELOG.rst b/map/kashiwanoha_map/CHANGELOG.rst index a2910ce13dd..66550f9e149 100644 --- a/map/kashiwanoha_map/CHANGELOG.rst +++ b/map/kashiwanoha_map/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package kashiwanoha_map * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/map/kashiwanoha_map/package.xml b/map/kashiwanoha_map/package.xml index f34b5f7b3be..a5cc8985a03 100644 --- a/map/kashiwanoha_map/package.xml +++ b/map/kashiwanoha_map/package.xml @@ -2,7 +2,7 @@ kashiwanoha_map - 7.3.5 + 7.4.0 map package for kashiwanoha Masaya Kataoka Apache License 2.0 diff --git a/map/simple_cross_map/CHANGELOG.rst b/map/simple_cross_map/CHANGELOG.rst index 3263e339e64..5892eb2d0c2 100644 --- a/map/simple_cross_map/CHANGELOG.rst +++ b/map/simple_cross_map/CHANGELOG.rst @@ -9,6 +9,21 @@ Changelog for package simple_cross_map * Merge branch 'master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/map/simple_cross_map/package.xml b/map/simple_cross_map/package.xml index 81a77c0f301..f81a626b3f7 100644 --- a/map/simple_cross_map/package.xml +++ b/map/simple_cross_map/package.xml @@ -2,7 +2,7 @@ simple_cross_map - 7.3.5 + 7.4.0 map package for simple cross Masaya Kataoka Apache License 2.0 diff --git a/mock/cpp_mock_scenarios/CHANGELOG.rst b/mock/cpp_mock_scenarios/CHANGELOG.rst index a760632bc5b..63d7209fd09 100644 --- a/mock/cpp_mock_scenarios/CHANGELOG.rst +++ b/mock/cpp_mock_scenarios/CHANGELOG.rst @@ -21,6 +21,38 @@ Changelog for package cpp_mock_scenarios * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge pull request `#1464 `_ from tier4/RJD-1457/traffic_sink_refactor + RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* style fix +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* code style +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* sink pedestrian test fix +* simplify auto_sink logic +* TrafficSinkConfig +* AutoSinkConfig +* review suggestions +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* TrafficSink refactor with despawn functionality +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* fix check condition +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* use uint8_t instead of traffic_simulator_msgs::msg::EntityType +* remap debug marker +* modify launch file +* add testcase for autosink +* enable sink vehicle +* enable set traffic sink in cpp scenario +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/mock/cpp_mock_scenarios/CMakeLists.txt b/mock/cpp_mock_scenarios/CMakeLists.txt index 669465e6482..883da343c49 100644 --- a/mock/cpp_mock_scenarios/CMakeLists.txt +++ b/mock/cpp_mock_scenarios/CMakeLists.txt @@ -55,8 +55,9 @@ if(BUILD_CPP_MOCK_SCENARIOS) add_subdirectory(src/random_scenario) add_subdirectory(src/spawn) add_subdirectory(src/speed_planning) - add_subdirectory(src/traffic_source) add_subdirectory(src/synchronized_action) + add_subdirectory(src/traffic_sink) + add_subdirectory(src/traffic_source) # add_subdirectory(src/respawn_ego) endif() diff --git a/mock/cpp_mock_scenarios/include/cpp_mock_scenarios/cpp_scenario_node.hpp b/mock/cpp_mock_scenarios/include/cpp_mock_scenarios/cpp_scenario_node.hpp index 4d1141c8fc7..45c2aa6962e 100644 --- a/mock/cpp_mock_scenarios/include/cpp_mock_scenarios/cpp_scenario_node.hpp +++ b/mock/cpp_mock_scenarios/include/cpp_mock_scenarios/cpp_scenario_node.hpp @@ -33,7 +33,8 @@ class CppScenarioNode : public rclcpp::Node explicit CppScenarioNode( const std::string & node_name, const std::string & map_path, const std::string & lanelet2_map_file, const std::string & scenario_filename, - const bool verbose, const rclcpp::NodeOptions & option); + const bool verbose, const rclcpp::NodeOptions & option, + const std::set & auto_sink_entity_types = {}); void start(); void stop(Result result, const std::string & description = ""); void expectThrow() { exception_expect_ = true; } @@ -71,7 +72,8 @@ class CppScenarioNode : public rclcpp::Node int timeout_; auto configure( const std::string & map_path, const std::string & lanelet2_map_file, - const std::string & scenario_filename, const bool verbose) -> traffic_simulator::Configuration + const std::string & scenario_filename, const bool verbose, + const std::set & auto_sink_entity_types = {}) -> traffic_simulator::Configuration { auto configuration = traffic_simulator::Configuration(map_path); { @@ -79,6 +81,7 @@ class CppScenarioNode : public rclcpp::Node // configuration.lanelet2_map_file = "lanelet2_map_with_private_road_and_walkway_ele_fix.osm"; configuration.scenario_path = scenario_filename; configuration.verbose = verbose; + configuration.auto_sink_entity_types = auto_sink_entity_types; } checkConfiguration(configuration); return configuration; diff --git a/mock/cpp_mock_scenarios/launch/mock_test.launch.py b/mock/cpp_mock_scenarios/launch/mock_test.launch.py index 13a245a09af..0a1f08e45f4 100644 --- a/mock/cpp_mock_scenarios/launch/mock_test.launch.py +++ b/mock/cpp_mock_scenarios/launch/mock_test.launch.py @@ -69,6 +69,7 @@ def on_stdout_output(event: launch.Event) -> None: if lines[0] == "cpp_scenario:success": print(Color.GREEN + "Scenario Succeed" + Color.END) + def architecture_types(): return ["awf/universe/20230906", "awf/universe/20240605"] @@ -94,9 +95,11 @@ def default_autoware_launch_file_of(architecture_type): "awf/universe/20240605": "planning_simulator.launch.xml", }[architecture_type] + def default_rviz_config_file(): return Path(get_package_share_directory("traffic_simulator")) / "config/scenario_simulator_v2.rviz" + def launch_setup(context, *args, **kwargs): # fmt: off architecture_type = LaunchConfiguration("architecture_type", default="awf/universe/20240605") @@ -159,7 +162,7 @@ def make_parameters(): {"initialize_duration": initialize_duration}, {"launch_autoware": launch_autoware}, {"port": port}, - {"publish_empty_context" : publish_empty_context}, + {"publish_empty_context": publish_empty_context}, {"record": record}, {"rviz_config": rviz_config}, {"sensor_model": sensor_model}, @@ -187,13 +190,13 @@ def description(): return parameters cpp_scenario_node = Node( - package=scenario_package, - executable=scenario, - name="scenario_node", - output="screen", - arguments=[("__log_level:=info")], - parameters=make_parameters() + [{"use_sim_time": use_sim_time}], - ) + package=scenario_package, + executable=scenario, + name="scenario_node", + output="screen", + arguments=[("__log_level:=info")], + parameters=make_parameters() + [{"use_sim_time": use_sim_time}], + ) io_handler = OnProcessIO( target_action=cpp_scenario_node, on_stderr=on_stderr_output, @@ -241,6 +244,7 @@ def description(): namespace="simulation", name="visualizer", output="screen", + remappings=[("/simulation/entity/status", "/entity/status")], ), Node( package="rviz2", @@ -249,10 +253,15 @@ def description(): output={"stderr": "log", "stdout": "log"}, condition=IfCondition(launch_rviz), arguments=["-d", str(default_rviz_config_file())], + remappings=[ + ("/simulation/lanelet/marker", "/lanelet/marker"), + ("/simulation/debug_marker", "/debug_marker"), + ], ), RegisterEventHandler(event_handler=io_handler), RegisterEventHandler(event_handler=shutdown_handler), ] + def generate_launch_description(): return LaunchDescription([OpaqueFunction(function=launch_setup)]) diff --git a/mock/cpp_mock_scenarios/package.xml b/mock/cpp_mock_scenarios/package.xml index d83691093fb..1618f99cb92 100644 --- a/mock/cpp_mock_scenarios/package.xml +++ b/mock/cpp_mock_scenarios/package.xml @@ -2,7 +2,7 @@ cpp_mock_scenarios - 7.3.5 + 7.4.0 C++ mock scenarios masaya Apache License 2.0 diff --git a/mock/cpp_mock_scenarios/src/cpp_scenario_node.cpp b/mock/cpp_mock_scenarios/src/cpp_scenario_node.cpp index 4fb9bd39245..884fabf0648 100644 --- a/mock/cpp_mock_scenarios/src/cpp_scenario_node.cpp +++ b/mock/cpp_mock_scenarios/src/cpp_scenario_node.cpp @@ -20,10 +20,12 @@ namespace cpp_mock_scenarios CppScenarioNode::CppScenarioNode( const std::string & node_name, const std::string & map_path, const std::string & lanelet2_map_file, const std::string & scenario_filename, const bool verbose, - const rclcpp::NodeOptions & option) + const rclcpp::NodeOptions & option, + const std::set & auto_sink_entity_types /*= {}*/) : Node(node_name, option), api_( - this, configure(map_path, lanelet2_map_file, scenario_filename, verbose), + this, + configure(map_path, lanelet2_map_file, scenario_filename, verbose, auto_sink_entity_types), declare_parameter("global_real_time_factor", 1.0), declare_parameter("global_frame_rate", 20.0)), scenario_filename_(scenario_filename), diff --git a/mock/cpp_mock_scenarios/src/crosswalk/stop_at_crosswalk.cpp b/mock/cpp_mock_scenarios/src/crosswalk/stop_at_crosswalk.cpp index 74dbf25598b..4b94b5ee5d2 100644 --- a/mock/cpp_mock_scenarios/src/crosswalk/stop_at_crosswalk.cpp +++ b/mock/cpp_mock_scenarios/src/crosswalk/stop_at_crosswalk.cpp @@ -30,7 +30,7 @@ class StopAtCrosswalkScenario : public cpp_mock_scenarios::CppScenarioNode explicit StopAtCrosswalkScenario(const rclcpp::NodeOptions & option) : cpp_mock_scenarios::CppScenarioNode( "stop_at_crosswalk", ament_index_cpp::get_package_share_directory("kashiwanoha_map") + "/map", - "lanelet2_map.osm", __FILE__, false, option) + "lanelet2_map.osm", __FILE__, false, option, {traffic_simulator::EntityType::PEDESTRIAN}) { start(); } diff --git a/mock/cpp_mock_scenarios/src/traffic_sink/CMakeLists.txt b/mock/cpp_mock_scenarios/src/traffic_sink/CMakeLists.txt new file mode 100644 index 00000000000..e1966600cb5 --- /dev/null +++ b/mock/cpp_mock_scenarios/src/traffic_sink/CMakeLists.txt @@ -0,0 +1,14 @@ +ament_auto_add_executable(auto_sink_vehicle + auto_sink_vehicle.cpp +) +target_link_libraries(auto_sink_vehicle cpp_scenario_node) + +install(TARGETS + auto_sink_vehicle + DESTINATION lib/cpp_mock_scenarios +) + +if(BUILD_TESTING) + include(../../cmake/add_cpp_mock_scenario_test.cmake) + add_cpp_mock_scenario_test(${PROJECT_NAME} "auto_sink_vehicle" "5.0") +endif() diff --git a/mock/cpp_mock_scenarios/src/traffic_sink/auto_sink_vehicle.cpp b/mock/cpp_mock_scenarios/src/traffic_sink/auto_sink_vehicle.cpp new file mode 100644 index 00000000000..8d3a89c2ae7 --- /dev/null +++ b/mock/cpp_mock_scenarios/src/traffic_sink/auto_sink_vehicle.cpp @@ -0,0 +1,70 @@ +// Copyright 2015 TIER IV, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace cpp_mock_scenarios +{ +class AutoSinkVehicleScenario : public cpp_mock_scenarios::CppScenarioNode +{ +public: + explicit AutoSinkVehicleScenario(const rclcpp::NodeOptions & option) + : cpp_mock_scenarios::CppScenarioNode( + "auto_sink_vehicle", ament_index_cpp::get_package_share_directory("kashiwanoha_map") + "/map", + "lanelet2_map.osm", __FILE__, false, option, {traffic_simulator::EntityType::PEDESTRIAN}) + { + start(); + } + +private: + void onUpdate() override + { + if (api_.getCurrentTime() >= 0.1) { + if (api_.entityExists("car") and not api_.entityExists("bob")) { + stop(cpp_mock_scenarios::Result::SUCCESS); + } else { + stop(cpp_mock_scenarios::Result::FAILURE); + } + } + } + + void onInitialize() override + { + const auto map_pose = traffic_simulator::pose::toMapPose( + traffic_simulator::helper::constructCanonicalizedLaneletPose( + 34774, 11.0, 0.0, api_.getHdmapUtils())); + api_.spawn("car", map_pose, getVehicleParameters()); + api_.spawn("bob", map_pose, getPedestrianParameters()); + } +}; +} // namespace cpp_mock_scenarios + +int main(int argc, char * argv[]) +{ + rclcpp::init(argc, argv); + rclcpp::NodeOptions options; + auto component = std::make_shared(options); + rclcpp::spin(component); + rclcpp::shutdown(); + return 0; +} diff --git a/openscenario/openscenario_experimental_catalog/CHANGELOG.rst b/openscenario/openscenario_experimental_catalog/CHANGELOG.rst index 977679cb5da..affe66c9b3c 100644 --- a/openscenario/openscenario_experimental_catalog/CHANGELOG.rst +++ b/openscenario/openscenario_experimental_catalog/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package openscenario_experimental_catalog * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/openscenario/openscenario_experimental_catalog/package.xml b/openscenario/openscenario_experimental_catalog/package.xml index 5a89fe31969..68cead781ae 100644 --- a/openscenario/openscenario_experimental_catalog/package.xml +++ b/openscenario/openscenario_experimental_catalog/package.xml @@ -2,7 +2,7 @@ openscenario_experimental_catalog - 7.3.5 + 7.4.0 TIER IV experimental catalogs for OpenSCENARIO Tatsuya Yamasaki Apache License 2.0 diff --git a/openscenario/openscenario_interpreter/CHANGELOG.rst b/openscenario/openscenario_interpreter/CHANGELOG.rst index 6a15fa3fc17..42af6a578dc 100644 --- a/openscenario/openscenario_interpreter/CHANGELOG.rst +++ b/openscenario/openscenario_interpreter/CHANGELOG.rst @@ -32,6 +32,25 @@ Changelog for package openscenario_interpreter * add publish_empty_context parameter * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge pull request `#1464 `_ from tier4/RJD-1457/traffic_sink_refactor + RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* simplify auto_sink logic +* AutoSinkConfig +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge pull request `#1488 `_ from tier4/refactor/concealer-1 diff --git a/openscenario/openscenario_interpreter/package.xml b/openscenario/openscenario_interpreter/package.xml index bd4daf1f0bb..437e970f032 100644 --- a/openscenario/openscenario_interpreter/package.xml +++ b/openscenario/openscenario_interpreter/package.xml @@ -2,7 +2,7 @@ openscenario_interpreter - 7.3.5 + 7.4.0 OpenSCENARIO 1.2.0 interpreter package for Autoware Tatsuya Yamasaki Apache License 2.0 diff --git a/openscenario/openscenario_interpreter/src/openscenario_interpreter.cpp b/openscenario/openscenario_interpreter/src/openscenario_interpreter.cpp index 824c83280f3..dae7d8fd8df 100644 --- a/openscenario/openscenario_interpreter/src/openscenario_interpreter.cpp +++ b/openscenario/openscenario_interpreter/src/openscenario_interpreter.cpp @@ -75,7 +75,6 @@ auto Interpreter::makeCurrentConfiguration() const -> traffic_simulator::Configu auto configuration = traffic_simulator::Configuration( logic_file.isDirectory() ? logic_file : logic_file.filepath.parent_path()); { - configuration.auto_sink = false; configuration.scenario_path = osc_path; // XXX DIRTY HACK!!! diff --git a/openscenario/openscenario_interpreter_example/CHANGELOG.rst b/openscenario/openscenario_interpreter_example/CHANGELOG.rst index fd8a0324aab..4306dcd5a8d 100644 --- a/openscenario/openscenario_interpreter_example/CHANGELOG.rst +++ b/openscenario/openscenario_interpreter_example/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package openscenario_interpreter_example * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/openscenario/openscenario_interpreter_example/package.xml b/openscenario/openscenario_interpreter_example/package.xml index e77c7ee6ad7..5bc43f7525b 100644 --- a/openscenario/openscenario_interpreter_example/package.xml +++ b/openscenario/openscenario_interpreter_example/package.xml @@ -3,7 +3,7 @@ openscenario_interpreter_example - 7.3.5 + 7.4.0 Examples for some TIER IV OpenSCENARIO Interpreter's features Tatsuya Yamasaki Apache License 2.0 diff --git a/openscenario/openscenario_interpreter_msgs/CHANGELOG.rst b/openscenario/openscenario_interpreter_msgs/CHANGELOG.rst index 38fb4c7d955..fe56e77a9f3 100644 --- a/openscenario/openscenario_interpreter_msgs/CHANGELOG.rst +++ b/openscenario/openscenario_interpreter_msgs/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package openscenario_interpreter_msgs * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/openscenario/openscenario_interpreter_msgs/package.xml b/openscenario/openscenario_interpreter_msgs/package.xml index a98c5eb65b0..87b715d64b6 100644 --- a/openscenario/openscenario_interpreter_msgs/package.xml +++ b/openscenario/openscenario_interpreter_msgs/package.xml @@ -2,7 +2,7 @@ openscenario_interpreter_msgs - 7.3.5 + 7.4.0 ROS message types for package openscenario_interpreter Yamasaki Tatsuya Apache License 2.0 diff --git a/openscenario/openscenario_preprocessor/CHANGELOG.rst b/openscenario/openscenario_preprocessor/CHANGELOG.rst index 32b7662e190..75cb5199338 100644 --- a/openscenario/openscenario_preprocessor/CHANGELOG.rst +++ b/openscenario/openscenario_preprocessor/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package openscenario_preprocessor * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/openscenario/openscenario_preprocessor/package.xml b/openscenario/openscenario_preprocessor/package.xml index dbdb0806b62..5ed04b21715 100644 --- a/openscenario/openscenario_preprocessor/package.xml +++ b/openscenario/openscenario_preprocessor/package.xml @@ -3,7 +3,7 @@ openscenario_preprocessor - 7.3.5 + 7.4.0 Example package for TIER IV OpenSCENARIO Interpreter Kotaro Yoshimoto Apache License 2.0 diff --git a/openscenario/openscenario_preprocessor_msgs/CHANGELOG.rst b/openscenario/openscenario_preprocessor_msgs/CHANGELOG.rst index f1fbbfd1283..936399f9304 100644 --- a/openscenario/openscenario_preprocessor_msgs/CHANGELOG.rst +++ b/openscenario/openscenario_preprocessor_msgs/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package openscenario_preprocessor_msgs * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/openscenario/openscenario_preprocessor_msgs/package.xml b/openscenario/openscenario_preprocessor_msgs/package.xml index f45bf0f082d..9ef2ee075e9 100644 --- a/openscenario/openscenario_preprocessor_msgs/package.xml +++ b/openscenario/openscenario_preprocessor_msgs/package.xml @@ -2,7 +2,7 @@ openscenario_preprocessor_msgs - 7.3.5 + 7.4.0 ROS message types for package openscenario_preprocessor Kotaro Yoshimoto Apache License 2.0 diff --git a/openscenario/openscenario_utility/CHANGELOG.rst b/openscenario/openscenario_utility/CHANGELOG.rst index 779618ec6d5..2c682c45fad 100644 --- a/openscenario/openscenario_utility/CHANGELOG.rst +++ b/openscenario/openscenario_utility/CHANGELOG.rst @@ -24,6 +24,21 @@ Changelog for package openscenario_utility * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/openscenario/openscenario_utility/package.xml b/openscenario/openscenario_utility/package.xml index a47baf3892b..fdcdabc19f0 100644 --- a/openscenario/openscenario_utility/package.xml +++ b/openscenario/openscenario_utility/package.xml @@ -2,7 +2,7 @@ openscenario_utility - 7.3.5 + 7.4.0 Utility tools for ASAM OpenSCENARIO 1.2.0 Tatsuya Yamasaki Apache License 2.0 diff --git a/openscenario/openscenario_validator/CHANGELOG.rst b/openscenario/openscenario_validator/CHANGELOG.rst index 200ed160363..6f84986dadd 100644 --- a/openscenario/openscenario_validator/CHANGELOG.rst +++ b/openscenario/openscenario_validator/CHANGELOG.rst @@ -10,6 +10,21 @@ Changelog for package openscenario_validator * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/openscenario/openscenario_validator/package.xml b/openscenario/openscenario_validator/package.xml index 497198557e8..84817d6926c 100644 --- a/openscenario/openscenario_validator/package.xml +++ b/openscenario/openscenario_validator/package.xml @@ -2,7 +2,7 @@ openscenario_validator - 7.3.5 + 7.4.0 Validator for OpenSCENARIO 1.3 Kotaro Yoshimoto Apache License 2.0 diff --git a/rviz_plugins/openscenario_visualization/CHANGELOG.rst b/rviz_plugins/openscenario_visualization/CHANGELOG.rst index db1a5c86dd8..9e606ff6542 100644 --- a/rviz_plugins/openscenario_visualization/CHANGELOG.rst +++ b/rviz_plugins/openscenario_visualization/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package openscenario_visualization * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/rviz_plugins/openscenario_visualization/package.xml b/rviz_plugins/openscenario_visualization/package.xml index 4c94d14dc72..c8d2a1e196d 100644 --- a/rviz_plugins/openscenario_visualization/package.xml +++ b/rviz_plugins/openscenario_visualization/package.xml @@ -2,7 +2,7 @@ openscenario_visualization - 7.3.5 + 7.4.0 Visualization tools for simulation results Masaya Kataoka Kyoichi Sugahara diff --git a/rviz_plugins/real_time_factor_control_rviz_plugin/CHANGELOG.rst b/rviz_plugins/real_time_factor_control_rviz_plugin/CHANGELOG.rst index c6d26f61b5b..d940cbe393d 100644 --- a/rviz_plugins/real_time_factor_control_rviz_plugin/CHANGELOG.rst +++ b/rviz_plugins/real_time_factor_control_rviz_plugin/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package real_time_factor_control_rviz_plugin * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/rviz_plugins/real_time_factor_control_rviz_plugin/package.xml b/rviz_plugins/real_time_factor_control_rviz_plugin/package.xml index 41f06a4ee79..5e0285d677c 100644 --- a/rviz_plugins/real_time_factor_control_rviz_plugin/package.xml +++ b/rviz_plugins/real_time_factor_control_rviz_plugin/package.xml @@ -2,7 +2,7 @@ real_time_factor_control_rviz_plugin - 7.3.5 + 7.4.0 Slider controlling real time factor value. Paweł Lech Apache License 2.0 diff --git a/scenario_simulator_v2/CHANGELOG.rst b/scenario_simulator_v2/CHANGELOG.rst index 1907f27a9ff..dd3a4b50c16 100644 --- a/scenario_simulator_v2/CHANGELOG.rst +++ b/scenario_simulator_v2/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package scenario_simulator_v2 * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/scenario_simulator_v2/package.xml b/scenario_simulator_v2/package.xml index eb685eeeeeb..f5838dbb9f5 100644 --- a/scenario_simulator_v2/package.xml +++ b/scenario_simulator_v2/package.xml @@ -2,7 +2,7 @@ scenario_simulator_v2 - 7.3.5 + 7.4.0 scenario testing framework for Autoware Masaya Kataoka Apache License 2.0 diff --git a/simulation/behavior_tree_plugin/CHANGELOG.rst b/simulation/behavior_tree_plugin/CHANGELOG.rst index 47a0d0a36c1..b794486e9a5 100644 --- a/simulation/behavior_tree_plugin/CHANGELOG.rst +++ b/simulation/behavior_tree_plugin/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package behavior_tree_plugin * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/simulation/behavior_tree_plugin/package.xml b/simulation/behavior_tree_plugin/package.xml index 96cd2d00545..3cb72bb5249 100644 --- a/simulation/behavior_tree_plugin/package.xml +++ b/simulation/behavior_tree_plugin/package.xml @@ -2,7 +2,7 @@ behavior_tree_plugin - 7.3.5 + 7.4.0 Behavior tree plugin for traffic_simulator masaya Apache 2.0 diff --git a/simulation/do_nothing_plugin/CHANGELOG.rst b/simulation/do_nothing_plugin/CHANGELOG.rst index 1c4c69cac35..8477e2d6006 100644 --- a/simulation/do_nothing_plugin/CHANGELOG.rst +++ b/simulation/do_nothing_plugin/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package do_nothing_plugin * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/simulation/do_nothing_plugin/package.xml b/simulation/do_nothing_plugin/package.xml index 9db341168e1..f187a5513ba 100644 --- a/simulation/do_nothing_plugin/package.xml +++ b/simulation/do_nothing_plugin/package.xml @@ -2,7 +2,7 @@ do_nothing_plugin - 7.3.5 + 7.4.0 Behavior plugin for do nothing Masaya Kataoka Apache 2.0 diff --git a/simulation/simple_sensor_simulator/CHANGELOG.rst b/simulation/simple_sensor_simulator/CHANGELOG.rst index 5cf69bb503f..03a925746a4 100644 --- a/simulation/simple_sensor_simulator/CHANGELOG.rst +++ b/simulation/simple_sensor_simulator/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package simple_sensor_simulator * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge pull request `#1488 `_ from tier4/refactor/concealer-1 diff --git a/simulation/simple_sensor_simulator/package.xml b/simulation/simple_sensor_simulator/package.xml index 2ff7d5b7519..006708e5ead 100644 --- a/simulation/simple_sensor_simulator/package.xml +++ b/simulation/simple_sensor_simulator/package.xml @@ -1,7 +1,7 @@ simple_sensor_simulator - 7.3.5 + 7.4.0 simple_sensor_simulator package masaya kataoka diff --git a/simulation/simulation_interface/CHANGELOG.rst b/simulation/simulation_interface/CHANGELOG.rst index e4c7440adc2..36810b65731 100644 --- a/simulation/simulation_interface/CHANGELOG.rst +++ b/simulation/simulation_interface/CHANGELOG.rst @@ -21,6 +21,23 @@ Changelog for package simulation_interface * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* apply reformat +* use uint8_t instead of traffic_simulator_msgs::msg::EntityType +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/simulation/simulation_interface/package.xml b/simulation/simulation_interface/package.xml index 01661d060bf..c415d44a8a3 100644 --- a/simulation/simulation_interface/package.xml +++ b/simulation/simulation_interface/package.xml @@ -2,7 +2,7 @@ simulation_interface - 7.3.5 + 7.4.0 packages to define interface between simulator and scenario interpreter Masaya Kataoka Apache License 2.0 diff --git a/simulation/traffic_simulator/CHANGELOG.rst b/simulation/traffic_simulator/CHANGELOG.rst index 4681820ff34..89b046b0d97 100644 --- a/simulation/traffic_simulator/CHANGELOG.rst +++ b/simulation/traffic_simulator/CHANGELOG.rst @@ -21,6 +21,51 @@ Changelog for package traffic_simulator * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge pull request `#1464 `_ from tier4/RJD-1457/traffic_sink_refactor + RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* style fix +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* remove unnecessary include directives +* remove unnecessary funcs +* code style +* code style +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* simplify auto_sink logic +* TrafficSinkConfig +* AutoSinkConfig +* review suggestions +* remove lanelet_id from the constructor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* reorder fix +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* spell-check happy +* TrafficSink refactor with despawn functionality +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* remove warning +* remove sonarcloud warning +* apply reformat +* use uint8_t instead of traffic_simulator_msgs::msg::EntityType +* fix typo +* fix typo +* fix typo +* enable set traffic sink in cpp scenario +* enable compare entity type +* add doxygen comment +* add sinkable_entity_type to the configuration class +* add sinkable_entity_type variable +* add get_entity_type function +* rename variable in TrafficController class +* rename argument and member variables +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge pull request `#1488 `_ from tier4/refactor/concealer-1 diff --git a/simulation/traffic_simulator/include/traffic_simulator/api/api.hpp b/simulation/traffic_simulator/include/traffic_simulator/api/api.hpp index bb74b7099a9..be13d11637e 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/api/api.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/api/api.hpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -72,15 +73,7 @@ class API node, entity_manager_ptr_->getHdmapUtils(), getROS2Parameter("architecture_type", "awf/universe/20240605"))), traffic_controller_ptr_(std::make_shared( - entity_manager_ptr_->getHdmapUtils(), [this]() { return API::getEntityNames(); }, - [this](const auto & entity_name) { - if (const auto entity = getEntity(entity_name)) { - return entity->getMapPose(); - } else { - THROW_SEMANTIC_ERROR("Entity ", std::quoted(entity_name), " does not exists."); - } - }, - [this](const auto & name) { return API::despawn(name); }, configuration.auto_sink)), + entity_manager_ptr_, configuration.auto_sink_entity_types)), clock_pub_(rclcpp::create_publisher( node, "/clock", rclcpp::QoS(rclcpp::KeepLast(1)).best_effort(), rclcpp::PublisherOptionsWithAllocator())), diff --git a/simulation/traffic_simulator/include/traffic_simulator/api/configuration.hpp b/simulation/traffic_simulator/include/traffic_simulator/api/configuration.hpp index 155fab255b9..22007c7c6bc 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/api/configuration.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/api/configuration.hpp @@ -21,6 +21,7 @@ #include #include #include +#include #include namespace traffic_simulator @@ -31,7 +32,7 @@ struct Configuration using Pathname = boost::filesystem::path; - bool auto_sink = true; + std::set auto_sink_entity_types = {}; bool verbose = false; diff --git a/simulation/traffic_simulator/include/traffic_simulator/entity/entity_manager.hpp b/simulation/traffic_simulator/include/traffic_simulator/entity/entity_manager.hpp index 89c2bbec9d3..75af7e4972a 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/entity/entity_manager.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/entity/entity_manager.hpp @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include diff --git a/simulation/traffic_simulator/include/traffic_simulator/traffic/traffic_controller.hpp b/simulation/traffic_simulator/include/traffic_simulator/traffic/traffic_controller.hpp index 75c2a53ea83..3ed3561f75a 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/traffic/traffic_controller.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/traffic/traffic_controller.hpp @@ -27,10 +27,11 @@ #define TRAFFIC_SIMULATOR__TRAFFIC__TRAFFIC_CONTROLLER_HPP_ #include +#include #include +#include #include #include -#include #include #include @@ -42,10 +43,8 @@ class TrafficController { public: explicit TrafficController( - std::shared_ptr hdmap_utils, - const std::function(void)> & get_entity_names_function, - const std::function & get_entity_pose_function, - const std::function & despawn_function, bool auto_sink = false); + const std::shared_ptr entity_manager_ptr, + const std::set auto_sink_entity_types /*= {}*/); template void addModule(Ts &&... xs) @@ -53,19 +52,13 @@ class TrafficController auto module_ptr = std::make_shared(std::forward(xs)...); modules_.emplace_back(module_ptr); } - void execute(const double current_time, const double step_time); - auto makeDebugMarker() const -> const visualization_msgs::msg::MarkerArray; + auto execute(const double current_time, const double step_time) -> void; + auto makeDebugMarker() const -> visualization_msgs::msg::MarkerArray; private: - void autoSink(); - const std::shared_ptr hdmap_utils_; - std::vector> modules_; - const std::function(void)> get_entity_names_function; - const std::function get_entity_pose_function; - const std::function despawn_function; - -public: - const bool auto_sink; + auto appendAutoSinks(const std::set & auto_sink_entity_types) -> void; + const std::shared_ptr entity_manager_ptr_; + std::vector> modules_; }; } // namespace traffic } // namespace traffic_simulator diff --git a/simulation/traffic_simulator/include/traffic_simulator/traffic/traffic_module_base.hpp b/simulation/traffic_simulator/include/traffic_simulator/traffic/traffic_module_base.hpp index 41e52aaf0e4..b660cb0a281 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/traffic/traffic_module_base.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/traffic/traffic_module_base.hpp @@ -36,7 +36,7 @@ class TrafficModuleBase { public: TrafficModuleBase() {} - virtual void execute(const double current_time, const double step_time) = 0; + virtual auto execute(const double current_time, const double step_time) -> void = 0; virtual auto appendDebugMarker(visualization_msgs::msg::MarkerArray &) const -> void{}; }; } // namespace traffic diff --git a/simulation/traffic_simulator/include/traffic_simulator/traffic/traffic_sink.hpp b/simulation/traffic_simulator/include/traffic_simulator/traffic/traffic_sink.hpp index 0754ace3f92..e3a99f23a86 100644 --- a/simulation/traffic_simulator/include/traffic_simulator/traffic/traffic_sink.hpp +++ b/simulation/traffic_simulator/include/traffic_simulator/traffic/traffic_sink.hpp @@ -31,6 +31,8 @@ #include #include #include +#include +#include #include #include @@ -38,25 +40,63 @@ namespace traffic_simulator { namespace traffic { +struct TrafficSinkConfig +{ + /** + * @brief Construct a new TrafficSinkConfig object + * @param radius Radius of the traffic sink + * @param position Position of the traffic sink + * @param sinkable_entity_types Candidates for despawn. + */ + explicit TrafficSinkConfig( + const double radius, const geometry_msgs::msg::Point & position, + const std::set & sinkable_entity_types, + const std::optional lanelet_id_opt) + : radius(radius), + position(position), + sinkable_entity_types(sinkable_entity_types), + description([](const std::optional lanelet_id_opt) -> std::string { + static long unique_id = 0L; + if (lanelet_id_opt.has_value()) { + return std::string("auto_") + std::to_string(lanelet_id_opt.value()); + } else { + return std::string("custom_") + std::to_string(unique_id++); + } + }(lanelet_id_opt)) + { + } + + const double radius; + const geometry_msgs::msg::Point position; + const std::set sinkable_entity_types; + const std::string description; +}; + class TrafficSink : public TrafficModuleBase { public: + /** + * @brief Construct a new Traffic Sink object + * @param entity_manager_ptr Shared pointer, refers to the EntityManager + * @param config TrafficSink configuration + */ explicit TrafficSink( - lanelet::Id lanelet_id, double radius, const geometry_msgs::msg::Point & position, - const std::function(void)> & get_entity_names_function, - const std::function & get_entity_pose_function, - const std::function & despawn_function); - const lanelet::Id lanelet_id; - const double radius; - const geometry_msgs::msg::Point position; - void execute(const double current_time, const double step_time) override; + const std::shared_ptr entity_manager_ptr, + const TrafficSinkConfig & config); + /** + * @note execute calls despawn on each entity only when both: + * 1. Its distance from the TrafficSink is <= config.radius [m]. + * 2. Its EntityType is in config.sinkable_entity_types. + */ + auto execute(const double current_time, const double step_time) -> void override; auto appendDebugMarker(visualization_msgs::msg::MarkerArray & marker_array) const -> void override; private: - const std::function(void)> get_entity_names_function; - const std::function get_entity_pose_function; - const std::function despawn_function; + auto isEntitySinkable(const std::string & entity_name) const noexcept(false) -> bool; + + const TrafficSinkConfig config_; + const std::shared_ptr entity_manager_ptr_; }; } // namespace traffic } // namespace traffic_simulator diff --git a/simulation/traffic_simulator/package.xml b/simulation/traffic_simulator/package.xml index 57fb4c28ae3..8f3c6fef100 100644 --- a/simulation/traffic_simulator/package.xml +++ b/simulation/traffic_simulator/package.xml @@ -1,7 +1,7 @@ traffic_simulator - 7.3.5 + 7.4.0 control traffic flow masaya kataoka diff --git a/simulation/traffic_simulator/src/traffic/traffic_controller.cpp b/simulation/traffic_simulator/src/traffic/traffic_controller.cpp index cd8ab6d5a37..5e764e933c1 100644 --- a/simulation/traffic_simulator/src/traffic/traffic_controller.cpp +++ b/simulation/traffic_simulator/src/traffic/traffic_controller.cpp @@ -37,48 +37,45 @@ namespace traffic_simulator namespace traffic { TrafficController::TrafficController( - std::shared_ptr hdmap_utils, - const std::function(void)> & get_entity_names_function, - const std::function & get_entity_pose_function, - const std::function & despawn_function, bool auto_sink) -: hdmap_utils_(hdmap_utils), - get_entity_names_function(get_entity_names_function), - get_entity_pose_function(get_entity_pose_function), - despawn_function(despawn_function), - auto_sink(auto_sink) + const std::shared_ptr entity_manager_ptr, + const std::set auto_sink_entity_types) +: entity_manager_ptr_(entity_manager_ptr), modules_() { - if (auto_sink) { - autoSink(); + if (not auto_sink_entity_types.empty()) { + appendAutoSinks(auto_sink_entity_types); } } -void TrafficController::autoSink() +auto TrafficController::appendAutoSinks(const std::set & auto_sink_entity_types) + -> void { - for (const auto & lanelet_id : hdmap_utils_->getLaneletIds()) { - if (hdmap_utils_->getNextLaneletIds(lanelet_id).empty()) { + static constexpr double sink_radius = 1.0; + const auto hdmap_utils_ptr = entity_manager_ptr_->getHdmapUtils(); + for (const auto & lanelet_id : hdmap_utils_ptr->getLaneletIds()) { + if (hdmap_utils_ptr->getNextLaneletIds(lanelet_id).empty()) { LaneletPose lanelet_pose; lanelet_pose.lanelet_id = lanelet_id; - lanelet_pose.s = pose::laneletLength(lanelet_id, hdmap_utils_); - const auto pose = pose::toMapPose(lanelet_pose, hdmap_utils_); - addModule( - lanelet_id, 1, pose.position, get_entity_names_function, get_entity_pose_function, - despawn_function); + lanelet_pose.s = pose::laneletLength(lanelet_id, hdmap_utils_ptr); + const auto pose = pose::toMapPose(lanelet_pose, hdmap_utils_ptr); + const auto traffic_sink_config = TrafficSinkConfig( + sink_radius, pose.position, auto_sink_entity_types, std::make_optional(lanelet_id)); + addModule(entity_manager_ptr_, traffic_sink_config); } } } -void TrafficController::execute(const double current_time, const double step_time) +auto TrafficController::execute(const double current_time, const double step_time) -> void { for (const auto & module : modules_) { module->execute(current_time, step_time); } } -auto TrafficController::makeDebugMarker() const -> const visualization_msgs::msg::MarkerArray +auto TrafficController::makeDebugMarker() const -> visualization_msgs::msg::MarkerArray { - static const auto marker_array = [&]() { + static const auto marker_array = [this]() { visualization_msgs::msg::MarkerArray marker_array; - for (size_t i = 0; i < modules_.size(); ++i) { + for (std::size_t i = 0UL; i < modules_.size(); ++i) { modules_[i]->appendDebugMarker(marker_array); } return marker_array; diff --git a/simulation/traffic_simulator/src/traffic/traffic_sink.cpp b/simulation/traffic_simulator/src/traffic/traffic_sink.cpp index b85663f17d6..dc41a3a3a72 100644 --- a/simulation/traffic_simulator/src/traffic/traffic_sink.cpp +++ b/simulation/traffic_simulator/src/traffic/traffic_sink.cpp @@ -26,9 +26,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -38,28 +40,17 @@ namespace traffic_simulator namespace traffic { TrafficSink::TrafficSink( - lanelet::Id lanelet_id, double radius, const geometry_msgs::msg::Point & position, - const std::function(void)> & get_entity_names_function, - const std::function & get_entity_pose_function, - const std::function & despawn_function) -: TrafficModuleBase(), - lanelet_id(lanelet_id), - radius(radius), - position(position), - get_entity_names_function(get_entity_names_function), - get_entity_pose_function(get_entity_pose_function), - despawn_function(despawn_function) + const std::shared_ptr entity_manager_ptr, const TrafficSinkConfig & config) +: TrafficModuleBase(), config_(config), entity_manager_ptr_(entity_manager_ptr) { } -void TrafficSink::execute( - [[maybe_unused]] const double current_time, [[maybe_unused]] const double step_time) +auto TrafficSink::execute( + [[maybe_unused]] const double current_time, [[maybe_unused]] const double step_time) -> void { - const auto names = get_entity_names_function(); - for (const auto & name : names) { - const auto pose = get_entity_pose_function(name); - if (math::geometry::getDistance(position, pose) <= radius) { - despawn_function(name); + for (const auto & entity_name : entity_manager_ptr_->getEntityNames()) { + if (isEntitySinkable(entity_name)) { + entity_manager_ptr_->despawnEntity(entity_name); } } } @@ -67,30 +58,46 @@ void TrafficSink::execute( auto TrafficSink::appendDebugMarker(visualization_msgs::msg::MarkerArray & marker_array) const -> void { - const auto lanelet_text = std::to_string(lanelet_id); visualization_msgs::msg::Marker traffic_sink_marker; traffic_sink_marker.header.frame_id = "map"; - traffic_sink_marker.ns = "traffic_controller/traffic_sink/" + lanelet_text; + traffic_sink_marker.ns = "traffic_controller/traffic_sink/" + config_.description; traffic_sink_marker.id = 0; traffic_sink_marker.action = traffic_sink_marker.ADD; traffic_sink_marker.type = 3; // cylinder traffic_sink_marker.pose = - geometry_msgs::build().position(position).orientation( - geometry_msgs::build().x(0).y(0).z(0).w(1)); + geometry_msgs::build() + .position(config_.position) + .orientation(geometry_msgs::build().x(0).y(0).z(0).w(1)); traffic_sink_marker.color = color_names::makeColorMsg("firebrick", 0.99); - traffic_sink_marker.scale.x = radius * 2; - traffic_sink_marker.scale.y = radius * 2; + traffic_sink_marker.scale.x = config_.radius * 2.0; + traffic_sink_marker.scale.y = config_.radius * 2.0; traffic_sink_marker.scale.z = 1.0; marker_array.markers.emplace_back(traffic_sink_marker); visualization_msgs::msg::Marker text_marker; text_marker = traffic_sink_marker; text_marker.id = 1; - text_marker.type = 9; //text - text_marker.text = lanelet_text; + text_marker.type = 9; // text + text_marker.text = config_.description; text_marker.color = color_names::makeColorMsg("white", 0.99); text_marker.scale.z = 0.6; marker_array.markers.emplace_back(text_marker); } + +auto TrafficSink::isEntitySinkable(const std::string & entity_name) const noexcept(false) -> bool +{ + if (const auto entity = entity_manager_ptr_->getEntity(entity_name); entity == nullptr) { + THROW_SEMANTIC_ERROR("Entity ", std::quoted(entity_name), " does not exists."); + } else if ( + config_.sinkable_entity_types.find(entity->getEntityType().type) == + config_.sinkable_entity_types.end()) { + return false; + } else if (math::geometry::getDistance(config_.position, entity->getMapPose()) > config_.radius) { + return false; + } else { + return true; + } +} + } // namespace traffic } // namespace traffic_simulator diff --git a/simulation/traffic_simulator_msgs/CHANGELOG.rst b/simulation/traffic_simulator_msgs/CHANGELOG.rst index c85edc363de..bf022203baf 100644 --- a/simulation/traffic_simulator_msgs/CHANGELOG.rst +++ b/simulation/traffic_simulator_msgs/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package openscenario_msgs * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/simulation/traffic_simulator_msgs/package.xml b/simulation/traffic_simulator_msgs/package.xml index ec34af2836b..fd468c39c05 100644 --- a/simulation/traffic_simulator_msgs/package.xml +++ b/simulation/traffic_simulator_msgs/package.xml @@ -2,7 +2,7 @@ traffic_simulator_msgs - 7.3.5 + 7.4.0 ROS messages for openscenario Masaya Kataoka Apache License 2.0 diff --git a/test_runner/random_test_runner/CHANGELOG.rst b/test_runner/random_test_runner/CHANGELOG.rst index e642432dfff..133ef007e02 100644 --- a/test_runner/random_test_runner/CHANGELOG.rst +++ b/test_runner/random_test_runner/CHANGELOG.rst @@ -21,6 +21,21 @@ Changelog for package random_test_runner * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/test_runner/random_test_runner/package.xml b/test_runner/random_test_runner/package.xml index eb67a633808..25ec95f7d46 100644 --- a/test_runner/random_test_runner/package.xml +++ b/test_runner/random_test_runner/package.xml @@ -2,7 +2,7 @@ random_test_runner - 7.3.5 + 7.4.0 Random behavior test runner piotr-zyskowski-rai Apache License 2.0 diff --git a/test_runner/scenario_test_runner/CHANGELOG.rst b/test_runner/scenario_test_runner/CHANGELOG.rst index 656922eada0..bbfc3bc90c3 100644 --- a/test_runner/scenario_test_runner/CHANGELOG.rst +++ b/test_runner/scenario_test_runner/CHANGELOG.rst @@ -35,6 +35,21 @@ Changelog for package scenario_test_runner * Merge remote-tracking branch 'origin/master' into feature/publish_empty_context * Contributors: Masaya Kataoka +7.4.0 (2024-12-23) +------------------ +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' into RJD-1457/traffic_sink_refactor +* Merge tag '6.0.1' into RJD-1457/traffic_sink_refactor +* Merge branch 'master' of https://github.com/tier4/scenario_simulator_v2 into feature/enable_specify_entity_type_in_autosink +* Merge branch 'master' into feature/enable_specify_entity_type_in_autosink +* Contributors: Masaya Kataoka, Michał Ciasnocha, robomic + 7.3.5 (2024-12-20) ------------------ * Merge branch 'master' into refactor/concealer-1 diff --git a/test_runner/scenario_test_runner/package.xml b/test_runner/scenario_test_runner/package.xml index b54ac457339..6a98d40fea3 100644 --- a/test_runner/scenario_test_runner/package.xml +++ b/test_runner/scenario_test_runner/package.xml @@ -2,7 +2,7 @@ scenario_test_runner - 7.3.5 + 7.4.0 scenario test runner package Tatsuya Yamasaki Apache License 2.0