diff --git a/mock/cpp_mock_scenarios/CMakeLists.txt b/mock/cpp_mock_scenarios/CMakeLists.txt
index 669465e6482..d43bfd534a7 100644
--- a/mock/cpp_mock_scenarios/CMakeLists.txt
+++ b/mock/cpp_mock_scenarios/CMakeLists.txt
@@ -42,6 +42,7 @@ option(BUILD_CPP_MOCK_SCENARIOS "Building the C++ scenarios" OFF)
if(BUILD_CPP_MOCK_SCENARIOS)
add_subdirectory(src/behavior_plugin)
add_subdirectory(src/collision)
+ add_subdirectory(src/context_gamma_planner)
add_subdirectory(src/crosswalk)
add_subdirectory(src/follow_front_entity)
add_subdirectory(src/follow_lane)
diff --git a/mock/cpp_mock_scenarios/package.xml b/mock/cpp_mock_scenarios/package.xml
index b87013c4ff7..ce9f7ac4209 100644
--- a/mock/cpp_mock_scenarios/package.xml
+++ b/mock/cpp_mock_scenarios/package.xml
@@ -20,6 +20,7 @@
openscenario_visualization
scenario_test_runner
behavior_tree_plugin
+ context_gamma_planner
ament_lint_auto
ament_cmake_clang_format
diff --git a/mock/cpp_mock_scenarios/src/context_gamma_planner/CMakeLists.txt b/mock/cpp_mock_scenarios/src/context_gamma_planner/CMakeLists.txt
new file mode 100644
index 00000000000..959cae23e22
--- /dev/null
+++ b/mock/cpp_mock_scenarios/src/context_gamma_planner/CMakeLists.txt
@@ -0,0 +1,252 @@
+ament_auto_add_executable(spawn
+ spawn.cpp
+)
+target_link_libraries(spawn
+ ${PROTOBUF_LIBRARY}
+ pthread
+ sodium
+ zmq
+)
+
+ament_auto_add_executable(stop_at_crosswalk
+ stop_at_crosswalk.cpp
+)
+target_link_libraries(stop_at_crosswalk
+ ${PROTOBUF_LIBRARY}
+ pthread
+ sodium
+ zmq
+)
+
+ament_auto_add_executable(parked_at_crosswalk
+ parked_at_crosswalk.cpp
+)
+target_link_libraries(parked_at_crosswalk
+ ${PROTOBUF_LIBRARY}
+ pthread
+ sodium
+ zmq
+)
+
+ament_auto_add_executable(reverse_walk_at_road
+ reverse_walk_at_road.cpp
+)
+target_link_libraries(reverse_walk_at_road
+ ${PROTOBUF_LIBRARY}
+ pthread
+ sodium
+ zmq
+)
+
+ament_auto_add_executable(pedestrian_follow_lane
+ pedestrian_follow_lane.cpp
+)
+target_link_libraries(pedestrian_follow_lane
+ ${PROTOBUF_LIBRARY}
+ pthread
+ sodium
+ zmq
+)
+
+ament_auto_add_executable(stop_line_running
+ stop_line_running.cpp
+)
+target_link_libraries(stop_line_running
+ ${PROTOBUF_LIBRARY}
+ pthread
+ sodium
+ zmq
+)
+
+ament_auto_add_executable(traffic_light_running
+ traffic_light_running.cpp
+)
+target_link_libraries(traffic_light_running
+ ${PROTOBUF_LIBRARY}
+ pthread
+ sodium
+ zmq
+)
+
+ament_auto_add_executable(head_on_pedestrian
+head_on_pedestrian.cpp
+)
+target_link_libraries(head_on_pedestrian
+ ${PROTOBUF_LIBRARY}
+ pthread
+ sodium
+ zmq
+)
+
+ament_auto_add_executable(adaptive_cruise
+adaptive_cruise.cpp
+)
+target_link_libraries(adaptive_cruise
+ ${PROTOBUF_LIBRARY}
+ pthread
+ sodium
+ zmq
+)
+
+ament_auto_add_executable(follow_trajectory
+follow_trajectory.cpp
+)
+target_link_libraries(follow_trajectory
+ ${PROTOBUF_LIBRARY}
+ pthread
+ sodium
+ zmq
+)
+
+ament_auto_add_executable(follow_trajectory_closed
+follow_trajectory_closed.cpp
+)
+target_link_libraries(follow_trajectory_closed
+ ${PROTOBUF_LIBRARY}
+ pthread
+ sodium
+ zmq
+)
+
+ament_auto_add_executable(lane_change_time
+lane_change_time.cpp
+)
+target_link_libraries(lane_change_time
+ ${PROTOBUF_LIBRARY}
+ pthread
+ sodium
+ zmq
+)
+
+ament_auto_add_executable(lane_change_lateral
+lane_change_lateral.cpp
+)
+target_link_libraries(lane_change_lateral
+ ${PROTOBUF_LIBRARY}
+ pthread
+ sodium
+ zmq
+)
+
+ament_auto_add_executable(lane_change_longitudinal
+lane_change_longitudinal.cpp
+)
+target_link_libraries(lane_change_longitudinal
+ ${PROTOBUF_LIBRARY}
+ pthread
+ sodium
+ zmq
+)
+
+ament_auto_add_executable(follow_trajectory_dynamic_constraints
+follow_trajectory_dynamic_constraints.cpp
+)
+target_link_libraries(follow_trajectory_dynamic_constraints
+ ${PROTOBUF_LIBRARY}
+ pthread
+ sodium
+ zmq
+)
+
+ament_auto_add_executable(road_end
+road_end.cpp
+)
+target_link_libraries(road_end
+ ${PROTOBUF_LIBRARY}
+ pthread
+ sodium
+ zmq
+)
+
+if(${tf2_geometry_msgs_VERSION} VERSION_LESS 0.18.0)
+ target_compile_definitions(spawn PUBLIC
+ USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
+ )
+ target_compile_definitions(stop_at_crosswalk PUBLIC
+ USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
+ )
+ target_compile_definitions(parked_at_crosswalk PUBLIC
+ USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
+ )
+ target_compile_definitions(reverse_walk_at_road PUBLIC
+ USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
+ )
+ target_compile_definitions(pedestrian_follow_lane PUBLIC
+ USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
+ )
+ target_compile_definitions(stop_line_running PUBLIC
+ USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
+ )
+ target_compile_definitions(traffic_light_running PUBLIC
+ USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
+ )
+ target_compile_definitions(head_on_pedestrian PUBLIC
+ USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
+ )
+ target_compile_definitions(adaptive_cruise PUBLIC
+ USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
+ )
+ target_compile_definitions(follow_trajectory PUBLIC
+ USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
+ )
+ target_compile_definitions(follow_trajectory_closed PUBLIC
+ USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
+ )
+ target_compile_definitions(lane_change_time PUBLIC
+ USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
+ )
+ target_compile_definitions(lane_change_lateral PUBLIC
+ USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
+ )
+ target_compile_definitions(lane_change_longitudinal PUBLIC
+ USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
+ )
+ target_compile_definitions(follow_trajectory_dynamic_constraints PUBLIC
+ USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
+ )
+ target_compile_definitions(road_end PUBLIC
+ USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
+ )
+endif()
+
+install(TARGETS
+ stop_at_crosswalk
+ parked_at_crosswalk
+ reverse_walk_at_road
+ spawn
+ pedestrian_follow_lane
+ stop_line_running
+ traffic_light_running
+ head_on_pedestrian
+ adaptive_cruise
+ follow_trajectory
+ follow_trajectory_closed
+ lane_change_time
+ lane_change_lateral
+ lane_change_longitudinal
+ follow_trajectory_dynamic_constraints
+ road_end
+ DESTINATION lib/${PROJECT_NAME}
+)
+
+if(BUILD_TESTING)
+ find_package(ament_lint_auto REQUIRED)
+ ament_lint_auto_find_test_dependencies()
+ include(./cmake/add_cpp_mock_scenario_test.cmake)
+ add_cpp_mock_scenario_test(${PROJECT_NAME} "spawn" "20.0")
+ add_cpp_mock_scenario_test(${PROJECT_NAME} "parked_at_crosswalk" "60.0")
+ add_cpp_mock_scenario_test(${PROJECT_NAME} "pedestrian_follow_lane" "60.0")
+ add_cpp_mock_scenario_test(${PROJECT_NAME} "reverse_walk_at_road" "120.0")
+ add_cpp_mock_scenario_test(${PROJECT_NAME} "stop_at_crosswalk" "40.0")
+ add_cpp_mock_scenario_test(${PROJECT_NAME} "stop_line_running" "200.0")
+ add_cpp_mock_scenario_test(${PROJECT_NAME} "traffic_light_running" "30.0")
+ add_cpp_mock_scenario_test(${PROJECT_NAME} "head_on_pedestrian" "60.0")
+ add_cpp_mock_scenario_test(${PROJECT_NAME} "adaptive_cruise" "120.0")
+ add_cpp_mock_scenario_test(${PROJECT_NAME} "follow_trajectory" "40.0")
+ add_cpp_mock_scenario_test(${PROJECT_NAME} "follow_trajectory_closed" "80.0")
+ add_cpp_mock_scenario_test(${PROJECT_NAME} "lane_change_time" "20.0")
+ add_cpp_mock_scenario_test(${PROJECT_NAME} "lane_change_lateral" "20.0")
+ add_cpp_mock_scenario_test(${PROJECT_NAME} "lane_change_longitudinal" "20.0")
+ add_cpp_mock_scenario_test(${PROJECT_NAME} "follow_trajectory_dynamic_constraints" "40.0")
+ add_cpp_mock_scenario_test(${PROJECT_NAME} "road_end" "30.0")
+endif()
diff --git a/mock/cpp_mock_scenarios/src/context_gamma_planner/adaptive_cruise.cpp b/mock/cpp_mock_scenarios/src/context_gamma_planner/adaptive_cruise.cpp
new file mode 100644
index 00000000000..bebbbd16979
--- /dev/null
+++ b/mock/cpp_mock_scenarios/src/context_gamma_planner/adaptive_cruise.cpp
@@ -0,0 +1,131 @@
+// Copyright 2022 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
+
+// headers in STL
+#include
+#include
+#include
+
+class AdaptiveCruiseScenario : public cpp_mock_scenarios::CppScenarioNode
+{
+public:
+ explicit AdaptiveCruiseScenario(const rclcpp::NodeOptions & option)
+ : cpp_mock_scenarios::CppScenarioNode(
+ "adaptive_cruise", ament_index_cpp::get_package_share_directory("kashiwanoha_map") + "/map",
+ "lanelet2_map.osm", __FILE__, false, option)
+ {
+ start();
+ }
+
+private:
+ bool is_stoped_ego_ = false;
+ bool is_stoped_bob_ = false;
+ void onUpdate() override
+ {
+ const auto t = api_.getCurrentTime();
+ if (t >= 6) {
+ api_.requestSpeedChange("bob", 5, true);
+ }
+ if (
+ static_cast(api_.getEntityStatus("ego").getLaneletPose())
+ .lanelet_id == 34675 and
+ api_.getCurrentTwist("ego").linear.x < 0.4) {
+ is_stoped_ego_ = true;
+ }
+ if (
+ static_cast(api_.getEntityStatus("bob").getLaneletPose())
+ .lanelet_id == 34675 and
+ api_.getCurrentTwist("bob").linear.x < 0.4) {
+ is_stoped_bob_ = true;
+ }
+ if (is_stoped_ego_ and is_stoped_bob_) {
+ stop(cpp_mock_scenarios::Result::SUCCESS);
+ }
+ // LCOV_EXCL_STOP
+ if (t >= 120) {
+ stop(cpp_mock_scenarios::Result::FAILURE);
+ }
+ }
+
+ void onInitialize() override
+ {
+ //Vehicle setting
+ api_.spawn(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 3, 0, api_.getHdmapUtils()),
+ getVehicleParameters(), traffic_simulator::VehicleBehavior::contextGamma());
+ api_.setEntityStatus(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 3, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructActionStatus(10));
+ api_.requestSpeedChange("ego", 5, true);
+ api_.requestAssignRoute(
+ "ego", std::vector{
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34675, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34690, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34576, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34675, 0.0, 0, api_.getHdmapUtils())});
+
+ //Vehicle setting
+ api_.spawn(
+ "bob",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34585, 3, 0, api_.getHdmapUtils()),
+ getVehicleParameters(), traffic_simulator::VehicleBehavior::contextGamma());
+ api_.setEntityStatus(
+ "bob",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34585, 3, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructActionStatus(10));
+ api_.requestSpeedChange("bob", 0, true);
+ api_.requestAssignRoute(
+ "bob", std::vector{
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34675, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34690, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34576, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34675, 0.0, 0, api_.getHdmapUtils())});
+ }
+};
+
+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/mock/cpp_mock_scenarios/src/context_gamma_planner/follow_trajectory.cpp b/mock/cpp_mock_scenarios/src/context_gamma_planner/follow_trajectory.cpp
new file mode 100644
index 00000000000..2dcfb4678f2
--- /dev/null
+++ b/mock/cpp_mock_scenarios/src/context_gamma_planner/follow_trajectory.cpp
@@ -0,0 +1,132 @@
+// Copyright 2022 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
+
+// headers in STL
+#include
+#include
+#include
+
+class FollowTrajectoryScenario : public cpp_mock_scenarios::CppScenarioNode
+{
+public:
+ explicit FollowTrajectoryScenario(const rclcpp::NodeOptions & option)
+ : cpp_mock_scenarios::CppScenarioNode(
+ "follow_trajectory", ament_index_cpp::get_package_share_directory("kashiwanoha_map") + "/map",
+ "lanelet2_map.osm", __FILE__, false, option)
+ {
+ start();
+ }
+
+private:
+ traffic_simulator_msgs::msg::PolylineTrajectory follow_trajectory;
+ int vertex_num = 0;
+ Eigen::Vector3d toEigenVector3d(const geometry_msgs::msg::Point & pos)
+ {
+ return Eigen::Vector3d(pos.x, pos.y, pos.z);
+ }
+ void onUpdate() override
+ {
+ const auto t = api_.getCurrentTime();
+ const double distance_threshold = 4.0;
+ const auto ego_pos = toEigenVector3d(api_.getEntityStatus("ego").getMapPose().position);
+ const auto reference_pos =
+ toEigenVector3d(follow_trajectory.shape.vertices.at(vertex_num).position.position);
+
+ if ((ego_pos - reference_pos).norm() < distance_threshold) {
+ vertex_num++;
+ RCLCPP_INFO_STREAM(get_logger(), "passing vertex number: " << vertex_num);
+ }
+
+ if (vertex_num >= static_cast(follow_trajectory.shape.vertices.size())) {
+ stop(cpp_mock_scenarios::Result::SUCCESS);
+ }
+ // LCOV_EXCL_STOP
+ if (t >= 40) {
+ stop(cpp_mock_scenarios::Result::FAILURE);
+ }
+ }
+
+ void onInitialize() override
+ {
+ //Vehicle setting
+ api_.spawn(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 0, 0, api_.getHdmapUtils()),
+ getVehicleParameters(), traffic_simulator::VehicleBehavior::contextGamma());
+ api_.setEntityStatus(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructActionStatus(10));
+ api_.requestSpeedChange("ego", 7, true);
+
+ auto toVertex = [](double time, const geometry_msgs::msg::Pose & pose) {
+ traffic_simulator_msgs::msg::Vertex vertex;
+ vertex.position = pose;
+ vertex.time = time;
+ return vertex;
+ };
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 0.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 0.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 10.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 10.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 12.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34600, 30.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 13.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34600, 20.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 14.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 40.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 25.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 50.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+
+ follow_trajectory.initial_distance_offset = 0.0;
+ follow_trajectory.dynamic_constraints_ignorable = true;
+ follow_trajectory.base_time = 5.0;
+ follow_trajectory.closed = false;
+ std::shared_ptr follow_trajectory_ptr =
+ std::make_shared(follow_trajectory);
+ api_.requestFollowTrajectory("ego", follow_trajectory_ptr);
+ }
+};
+
+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/mock/cpp_mock_scenarios/src/context_gamma_planner/follow_trajectory_closed.cpp b/mock/cpp_mock_scenarios/src/context_gamma_planner/follow_trajectory_closed.cpp
new file mode 100644
index 00000000000..94e9ebfc6e7
--- /dev/null
+++ b/mock/cpp_mock_scenarios/src/context_gamma_planner/follow_trajectory_closed.cpp
@@ -0,0 +1,167 @@
+// Copyright 2022 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
+
+// headers in STL
+#include
+#include
+#include
+
+class FollowTrajectoryClosedScenario : public cpp_mock_scenarios::CppScenarioNode
+{
+public:
+ explicit FollowTrajectoryClosedScenario(const rclcpp::NodeOptions & option)
+ : cpp_mock_scenarios::CppScenarioNode(
+ "follow_trajectory_closed",
+ ament_index_cpp::get_package_share_directory("kashiwanoha_map") + "/map", "lanelet2_map.osm",
+ __FILE__, false, option)
+ {
+ start();
+ }
+
+private:
+ traffic_simulator_msgs::msg::PolylineTrajectory follow_trajectory;
+ int vertex_num = 0;
+ int loop_count = 0;
+ Eigen::Vector3d toEigenVector3d(const geometry_msgs::msg::Point & pos)
+ {
+ return Eigen::Vector3d(pos.x, pos.y, pos.z);
+ }
+ void onUpdate() override
+ {
+ const auto t = api_.getCurrentTime();
+ const double distance_threshold = 5.0;
+ const auto ego_pos = toEigenVector3d(api_.getEntityStatus("ego").getMapPose().position);
+ const auto reference_pos =
+ toEigenVector3d(follow_trajectory.shape.vertices.at(vertex_num).position.position);
+ if ((ego_pos - reference_pos).norm() < distance_threshold) {
+ if (vertex_num == static_cast(follow_trajectory.shape.vertices.size()) - 1) {
+ loop_count++;
+ vertex_num = 0;
+ RCLCPP_INFO_STREAM(get_logger(), "loop count: " << loop_count);
+ if (loop_count == 2) {
+ stop(cpp_mock_scenarios::Result::SUCCESS);
+ }
+ } else {
+ vertex_num++;
+ }
+ RCLCPP_INFO_STREAM(get_logger(), "passing vertex number: " << vertex_num);
+ }
+ // LCOV_EXCL_STOP
+ if (t >= 100) {
+ stop(cpp_mock_scenarios::Result::FAILURE);
+ }
+ }
+
+ void onInitialize() override
+ {
+ //Vehicle setting
+ api_.spawn(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 0, 0, api_.getHdmapUtils()),
+ getVehicleParameters(), traffic_simulator::VehicleBehavior::contextGamma());
+ api_.setEntityStatus(
+ "ego",
+ (traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 0, 0, api_.getHdmapUtils())),
+ traffic_simulator::helper::constructActionStatus(10));
+ api_.requestSpeedChange("ego", 7, true);
+
+ auto toVertex = [](double time, const geometry_msgs::msg::Pose & pose) {
+ traffic_simulator_msgs::msg::Vertex vertex;
+ vertex.position = pose;
+ vertex.time = time;
+ return vertex;
+ };
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 0.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 0.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 2.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 10.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 4.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34600, 30.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 6.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34600, 20.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 8.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 40.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 10.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 50.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 12.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34600, 0.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 14.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34600, 10.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 16.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 30.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 18.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 20.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 20.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34600, 40.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 22.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34600, 50.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 24.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 0.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+
+ follow_trajectory.initial_distance_offset = 0.0;
+ follow_trajectory.dynamic_constraints_ignorable = true;
+ follow_trajectory.base_time = 5.0;
+ follow_trajectory.closed = true;
+ std::shared_ptr follow_trajectory_ptr =
+ std::make_shared(follow_trajectory);
+ api_.requestFollowTrajectory("ego", follow_trajectory_ptr);
+ }
+};
+
+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/mock/cpp_mock_scenarios/src/context_gamma_planner/follow_trajectory_dynamic_constraints.cpp b/mock/cpp_mock_scenarios/src/context_gamma_planner/follow_trajectory_dynamic_constraints.cpp
new file mode 100644
index 00000000000..38e1094319a
--- /dev/null
+++ b/mock/cpp_mock_scenarios/src/context_gamma_planner/follow_trajectory_dynamic_constraints.cpp
@@ -0,0 +1,139 @@
+// Copyright 2022 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
+
+// headers in STL
+#include
+#include
+#include
+
+class FollowTrajectoryDynamicConstraintsScenario : public cpp_mock_scenarios::CppScenarioNode
+{
+public:
+ explicit FollowTrajectoryDynamicConstraintsScenario(const rclcpp::NodeOptions & option)
+ : cpp_mock_scenarios::CppScenarioNode(
+ "follow_trajectory_dynamic_constraints",
+ ament_index_cpp::get_package_share_directory("kashiwanoha_map") + "/map", "lanelet2_map.osm",
+ __FILE__, false, option)
+ {
+ start();
+ }
+
+private:
+ traffic_simulator_msgs::msg::PolylineTrajectory follow_trajectory;
+ int vertex_num = 0;
+ Eigen::Vector3d toEigenVector3d(const geometry_msgs::msg::Point & pos)
+ {
+ return Eigen::Vector3d(pos.x, pos.y, pos.z);
+ }
+ void onUpdate() override
+ {
+ const double t_threshold = 3.0;
+ const auto t = api_.getCurrentTime();
+ const auto reference_time =
+ follow_trajectory.base_time + follow_trajectory.shape.vertices.at(vertex_num).time;
+
+ const double distance_threshold = 4.0;
+ const auto ego_pos = toEigenVector3d(api_.getEntityStatus("ego").getMapPose().position);
+ const auto reference_pos =
+ toEigenVector3d(follow_trajectory.shape.vertices.at(vertex_num).position.position);
+
+ if (
+ reference_time - t_threshold < t and t < reference_time + t_threshold and
+ (ego_pos - reference_pos).norm() < distance_threshold) {
+ vertex_num++;
+ RCLCPP_INFO_STREAM(get_logger(), "passing vertex number: " << vertex_num);
+ }
+
+ if (vertex_num >= static_cast(follow_trajectory.shape.vertices.size()) - 1) {
+ stop(cpp_mock_scenarios::Result::SUCCESS);
+ }
+ // LCOV_EXCL_STOP
+ if (t >= 40) {
+ stop(cpp_mock_scenarios::Result::FAILURE);
+ }
+ }
+
+ void onInitialize() override
+ {
+ //Vehicle setting
+ api_.spawn(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 0, 0, api_.getHdmapUtils()),
+ getVehicleParameters(), traffic_simulator::VehicleBehavior::contextGamma());
+ api_.setEntityStatus(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructActionStatus(10));
+ api_.requestSpeedChange("ego", 7, true);
+
+ auto toVertex = [](double time, const geometry_msgs::msg::Pose & pose) {
+ traffic_simulator_msgs::msg::Vertex vertex;
+ vertex.position = pose;
+ vertex.time = time;
+ return vertex;
+ };
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 0.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 0.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 10.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 10.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 12.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34600, 30.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 13.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34600, 20.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 14.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 40.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 25.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 50.0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+
+ follow_trajectory.initial_distance_offset = 0.0;
+ follow_trajectory.dynamic_constraints_ignorable = false;
+ follow_trajectory.base_time = 5.0;
+ follow_trajectory.closed = false;
+ std::shared_ptr follow_trajectory_ptr =
+ std::make_shared(follow_trajectory);
+ api_.requestFollowTrajectory("ego", follow_trajectory_ptr);
+ }
+};
+
+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/mock/cpp_mock_scenarios/src/context_gamma_planner/head_on_pedestrian.cpp b/mock/cpp_mock_scenarios/src/context_gamma_planner/head_on_pedestrian.cpp
new file mode 100644
index 00000000000..0d4c8ccc6cc
--- /dev/null
+++ b/mock/cpp_mock_scenarios/src/context_gamma_planner/head_on_pedestrian.cpp
@@ -0,0 +1,203 @@
+// Copyright 2022 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
+
+// headers in STL
+#include
+#include
+#include
+
+class HeadOnPedestrianScenario : public cpp_mock_scenarios::CppScenarioNode
+{
+public:
+ explicit HeadOnPedestrianScenario(const rclcpp::NodeOptions & option)
+ : cpp_mock_scenarios::CppScenarioNode(
+ "head_on_pedstrian", ament_index_cpp::get_package_share_directory("kashiwanoha_map") + "/map",
+ "lanelet2_map.osm", __FILE__, false, option)
+ {
+ start();
+ }
+
+private:
+ Eigen::Vector3d toEigenVector3d(const geometry_msgs::msg::Point & pos)
+ {
+ return Eigen::Vector3d(pos.x, pos.y, pos.z);
+ }
+ std::vector init_pos;
+ void onUpdate() override
+ {
+ const auto t = api_.getCurrentTime();
+ float goal_threshold = 1.5;
+ if (
+ (init_pos[0] - toEigenVector3d(api_.getEntityStatus("ego").getMapPose().position)).norm() <
+ goal_threshold) {
+ api_.requestSpeedChange("ego", 0, true);
+ }
+ if (
+ (init_pos[1] - toEigenVector3d(api_.getEntityStatus("ego2").getMapPose().position)).norm() <
+ goal_threshold) {
+ api_.requestSpeedChange("ego2", 0, true);
+ }
+ if (
+ (init_pos[2] - toEigenVector3d(api_.getEntityStatus("bob").getMapPose().position)).norm() <
+ goal_threshold) {
+ api_.requestSpeedChange("bob", 0, true);
+ }
+ if (
+ (init_pos[3] - toEigenVector3d(api_.getEntityStatus("bob2").getMapPose().position)).norm() <
+ goal_threshold) {
+ api_.requestSpeedChange("bob2", 0, true);
+ }
+ if (
+ (init_pos[0] - toEigenVector3d(api_.getEntityStatus("ego").getMapPose().position)).norm() <
+ goal_threshold and
+ (init_pos[1] - toEigenVector3d(api_.getEntityStatus("ego2").getMapPose().position)).norm() <
+ goal_threshold and
+ (init_pos[2] - toEigenVector3d(api_.getEntityStatus("bob").getMapPose().position)).norm() <
+ goal_threshold and
+ (init_pos[3] - toEigenVector3d(api_.getEntityStatus("bob2").getMapPose().position)).norm() <
+ goal_threshold) {
+ stop(cpp_mock_scenarios::Result::SUCCESS);
+ }
+ // LCOV_EXCL_STOP
+ if (t >= 60) {
+ stop(cpp_mock_scenarios::Result::FAILURE);
+ }
+ }
+
+ void onInitialize() override
+ {
+ auto toVertex = [](double time, const geometry_msgs::msg::Pose & pose) {
+ traffic_simulator_msgs::msg::Vertex vertex;
+ vertex.position = pose;
+ vertex.time = time;
+ return vertex;
+ };
+ auto toTrajectory =
+ [&](const geometry_msgs::msg::Pose & start_pose, const geometry_msgs::msg::Pose & goal_pose) {
+ traffic_simulator_msgs::msg::PolylineTrajectory follow_trajectory;
+ follow_trajectory.shape.vertices.push_back(toVertex(0.0, start_pose));
+ follow_trajectory.shape.vertices.push_back(toVertex(10.0, goal_pose));
+ follow_trajectory.initial_distance_offset = 0.0;
+ follow_trajectory.dynamic_constraints_ignorable = true;
+ follow_trajectory.base_time = 0.0;
+ follow_trajectory.closed = false;
+ return follow_trajectory;
+ };
+ //Pedestrian1 setting
+ api_.spawn(
+ "bob",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34378, 0.0, -1, api_.getHdmapUtils()),
+ getPedestrianParameters(), traffic_simulator::PedestrianBehavior::contextGamma());
+ api_.requestSpeedChange(
+ "bob", 0.5, traffic_simulator::speed_change::Transition::LINEAR,
+ traffic_simulator::speed_change::Constraint(
+ traffic_simulator::speed_change::Constraint::Type::LONGITUDINAL_ACCELERATION, 1.0),
+ true);
+ std::shared_ptr follow_trajectory_ptr1 =
+ std::make_shared(toTrajectory(
+ traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34378, 0.0, -1, 0, 0, 0, api_.getHdmapUtils())),
+ traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34378, 7.5, 1, 0, 0, 0, api_.getHdmapUtils()))));
+ api_.requestFollowTrajectory("bob", follow_trajectory_ptr1);
+ //Pedestrian2 setting
+ api_.spawn(
+ "bob2",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34378, 0.0, 1, api_.getHdmapUtils()),
+ getPedestrianParameters(), traffic_simulator::PedestrianBehavior::contextGamma());
+ api_.requestSpeedChange(
+ "bob2", 0.5, traffic_simulator::speed_change::Transition::LINEAR,
+ traffic_simulator::speed_change::Constraint(
+ traffic_simulator::speed_change::Constraint::Type::LONGITUDINAL_ACCELERATION, 1.0),
+ true);
+ std::shared_ptr follow_trajectory_ptr2 =
+ std::make_shared(toTrajectory(
+ traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34378, 0.0, 1, 0, 0, 0, api_.getHdmapUtils())),
+ traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34378, 7.5, -1, 0, 0, 0, api_.getHdmapUtils()))));
+ api_.requestFollowTrajectory("bob2", follow_trajectory_ptr2);
+
+ //Pedestrian3 setting
+ api_.spawn(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34378, 7.5, 1, api_.getHdmapUtils()),
+ getPedestrianParameters(), traffic_simulator::PedestrianBehavior::contextGamma());
+ api_.requestSpeedChange(
+ "ego", 0.5, traffic_simulator::speed_change::Transition::LINEAR,
+ traffic_simulator::speed_change::Constraint(
+ traffic_simulator::speed_change::Constraint::Type::LONGITUDINAL_ACCELERATION, 1.0),
+ true);
+ std::shared_ptr follow_trajectory_ptr3 =
+ std::make_shared(toTrajectory(
+ traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34378, 7.5, 1, 0, 0, 0, api_.getHdmapUtils())),
+ traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34378, 0.0, -1, 0, 0, 0, api_.getHdmapUtils()))));
+ api_.requestFollowTrajectory("ego", follow_trajectory_ptr3);
+
+ //Pedestrian4 setting
+ api_.spawn(
+ "ego2",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34378, 7.5, -1, api_.getHdmapUtils()),
+ getPedestrianParameters(), traffic_simulator::PedestrianBehavior::contextGamma());
+ api_.requestSpeedChange(
+ "ego2", 0.5, traffic_simulator::speed_change::Transition::LINEAR,
+ traffic_simulator::speed_change::Constraint(
+ traffic_simulator::speed_change::Constraint::Type::LONGITUDINAL_ACCELERATION, 1.0),
+ true);
+ std::shared_ptr follow_trajectory_ptr4 =
+ std::make_shared(toTrajectory(
+ traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34378, 7.5, -1, 0, 0, 0, api_.getHdmapUtils())),
+ traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34378, 0.0, 1, 0, 0, 0, api_.getHdmapUtils()))));
+ api_.requestFollowTrajectory("ego2", follow_trajectory_ptr4);
+
+ init_pos.emplace_back(toEigenVector3d(api_.getEntityStatus("bob").getMapPose().position));
+ init_pos.emplace_back(toEigenVector3d(api_.getEntityStatus("bob2").getMapPose().position));
+ init_pos.emplace_back(toEigenVector3d(api_.getEntityStatus("ego").getMapPose().position));
+ init_pos.emplace_back(toEigenVector3d(api_.getEntityStatus("ego2").getMapPose().position));
+ }
+};
+
+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/mock/cpp_mock_scenarios/src/context_gamma_planner/lane_change_lateral.cpp b/mock/cpp_mock_scenarios/src/context_gamma_planner/lane_change_lateral.cpp
new file mode 100644
index 00000000000..e314bf5ba01
--- /dev/null
+++ b/mock/cpp_mock_scenarios/src/context_gamma_planner/lane_change_lateral.cpp
@@ -0,0 +1,88 @@
+// Copyright 2022 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
+
+// headers in STL
+#include
+#include
+#include
+
+class LaneChangeLateralScenario : public cpp_mock_scenarios::CppScenarioNode
+{
+public:
+ explicit LaneChangeLateralScenario(const rclcpp::NodeOptions & option)
+ : cpp_mock_scenarios::CppScenarioNode(
+ "lane_change_lateral",
+ ament_index_cpp::get_package_share_directory("kashiwanoha_map") + "/map", "lanelet2_map.osm",
+ __FILE__, false, option)
+ {
+ start();
+ }
+
+private:
+ void onUpdate() override
+ {
+ const auto t = api_.getCurrentTime();
+ if (1 < t && t < 1.1) {
+ api_.requestLaneChange(
+ "ego",
+ traffic_simulator::lane_change::RelativeTarget(
+ "ego", traffic_simulator::lane_change::Direction::RIGHT, 1, 0.0),
+ traffic_simulator::lane_change::TrajectoryShape::CUBIC,
+ traffic_simulator::lane_change::Constraint(
+ traffic_simulator::lane_change::Constraint::Type::LATERAL_VELOCITY, 1,
+ traffic_simulator::lane_change::Constraint::Policy::BEST_EFFORT));
+ }
+ if (
+ // api_.getEntityStatus("ego").getLaneletPose() and
+ static_cast(api_.getEntityStatus("ego").getLaneletPose())
+ .lanelet_id == 34462 and
+ static_cast(api_.getEntityStatus("ego").getLaneletPose()).s >=
+ 28.0) {
+ stop(cpp_mock_scenarios::Result::SUCCESS);
+ }
+ // LCOV_EXCL_STOP
+ if (t >= 30) {
+ stop(cpp_mock_scenarios::Result::FAILURE);
+ }
+ }
+
+ void onInitialize() override
+ {
+ //Vehicle setting
+ api_.spawn(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34513, 0, 0, api_.getHdmapUtils()),
+ getVehicleParameters(), traffic_simulator::VehicleBehavior::contextGamma());
+ api_.requestSpeedChange("ego", 7, true);
+ }
+};
+
+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/mock/cpp_mock_scenarios/src/context_gamma_planner/lane_change_longitudinal.cpp b/mock/cpp_mock_scenarios/src/context_gamma_planner/lane_change_longitudinal.cpp
new file mode 100644
index 00000000000..690e90c6fec
--- /dev/null
+++ b/mock/cpp_mock_scenarios/src/context_gamma_planner/lane_change_longitudinal.cpp
@@ -0,0 +1,88 @@
+// Copyright 2022 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
+
+// headers in STL
+#include
+#include
+#include
+
+class LaneChangeLongitudinalScenario : public cpp_mock_scenarios::CppScenarioNode
+{
+public:
+ explicit LaneChangeLongitudinalScenario(const rclcpp::NodeOptions & option)
+ : cpp_mock_scenarios::CppScenarioNode(
+ "lane_change_longitudinal",
+ ament_index_cpp::get_package_share_directory("kashiwanoha_map") + "/map", "lanelet2_map.osm",
+ __FILE__, false, option)
+ {
+ start();
+ }
+
+private:
+ void onUpdate() override
+ {
+ const auto t = api_.getCurrentTime();
+ if (1 < t && t < 1.1) {
+ api_.requestLaneChange(
+ "ego",
+ traffic_simulator::lane_change::RelativeTarget(
+ "ego", traffic_simulator::lane_change::Direction::RIGHT, 1, 0.0),
+ traffic_simulator::lane_change::TrajectoryShape::CUBIC,
+ traffic_simulator::lane_change::Constraint(
+ traffic_simulator::lane_change::Constraint::Type::LONGITUDINAL_DISTANCE, 20,
+ traffic_simulator::lane_change::Constraint::Policy::BEST_EFFORT));
+ }
+ if (
+ // api_.getEntityStatus("ego").getLaneletPose() and
+ static_cast(api_.getEntityStatus("ego").getLaneletPose())
+ .lanelet_id == 34462 and
+ static_cast(api_.getEntityStatus("ego").getLaneletPose()).s >=
+ 28.0) {
+ stop(cpp_mock_scenarios::Result::SUCCESS);
+ }
+ // LCOV_EXCL_STOP
+ if (t >= 30) {
+ stop(cpp_mock_scenarios::Result::FAILURE);
+ }
+ }
+
+ void onInitialize() override
+ {
+ //Vehicle setting
+ api_.spawn(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34513, 0, 0, api_.getHdmapUtils()),
+ getVehicleParameters(), traffic_simulator::VehicleBehavior::contextGamma());
+ api_.requestSpeedChange("ego", 7, true);
+ }
+};
+
+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/mock/cpp_mock_scenarios/src/context_gamma_planner/lane_change_time.cpp b/mock/cpp_mock_scenarios/src/context_gamma_planner/lane_change_time.cpp
new file mode 100644
index 00000000000..651ef6212b8
--- /dev/null
+++ b/mock/cpp_mock_scenarios/src/context_gamma_planner/lane_change_time.cpp
@@ -0,0 +1,92 @@
+// Copyright 2022 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
+
+// headers in STL
+#include
+#include
+#include
+
+class LaneChangeTimeScenario : public cpp_mock_scenarios::CppScenarioNode
+{
+public:
+ explicit LaneChangeTimeScenario(const rclcpp::NodeOptions & option)
+ : cpp_mock_scenarios::CppScenarioNode(
+ "lane_change_time", ament_index_cpp::get_package_share_directory("kashiwanoha_map") + "/map",
+ "lanelet2_map.osm", __FILE__, false, option)
+ {
+ start();
+ }
+
+private:
+ void onUpdate() override
+ {
+ const auto t = api_.getCurrentTime();
+ const double time_threshold = 1.0;
+ if (1 < t && t < 1.1) {
+ api_.requestLaneChange(
+ "ego",
+ traffic_simulator::lane_change::RelativeTarget(
+ "ego", traffic_simulator::lane_change::Direction::RIGHT, 1, 0.0),
+ traffic_simulator::lane_change::TrajectoryShape::CUBIC,
+ traffic_simulator::lane_change::Constraint(
+ traffic_simulator::lane_change::Constraint::Type::TIME, 4.0,
+ traffic_simulator::lane_change::Constraint::Policy::BEST_EFFORT));
+ }
+ if (
+ // api_.getEntityStatus("ego").getLaneletPose() and
+ static_cast(api_.getEntityStatus("ego").getLaneletPose())
+ .lanelet_id == 34462 and
+ static_cast(api_.getEntityStatus("ego").getLaneletPose()).s >=
+ 23.0377) {
+ if (5.0 - time_threshold < t && t < 5.0 + time_threshold) {
+ stop(cpp_mock_scenarios::Result::SUCCESS);
+ } else {
+ stop(cpp_mock_scenarios::Result::FAILURE);
+ }
+ }
+ // LCOV_EXCL_STOP
+ if (t >= 20) {
+ stop(cpp_mock_scenarios::Result::FAILURE);
+ }
+ }
+
+ void onInitialize() override
+ {
+ //Vehicle setting
+ api_.spawn(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34513, 0, 0, api_.getHdmapUtils()),
+ getVehicleParameters(), traffic_simulator::VehicleBehavior::contextGamma());
+ api_.requestSpeedChange("ego", 7, true);
+ }
+};
+
+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/mock/cpp_mock_scenarios/src/context_gamma_planner/parked_at_crosswalk.cpp b/mock/cpp_mock_scenarios/src/context_gamma_planner/parked_at_crosswalk.cpp
new file mode 100644
index 00000000000..7cb8076d701
--- /dev/null
+++ b/mock/cpp_mock_scenarios/src/context_gamma_planner/parked_at_crosswalk.cpp
@@ -0,0 +1,101 @@
+// Copyright 2022 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
+
+// headers in STL
+#include
+#include
+#include
+
+class ParkedAtCrosswalkScenario : public cpp_mock_scenarios::CppScenarioNode
+{
+public:
+ explicit ParkedAtCrosswalkScenario(const rclcpp::NodeOptions & option)
+ : cpp_mock_scenarios::CppScenarioNode(
+ "parked_at_crosswalk",
+ ament_index_cpp::get_package_share_directory("kashiwanoha_map") + "/map", "lanelet2_map.osm",
+ __FILE__, false, option)
+ {
+ start();
+ }
+
+private:
+ void onUpdate() override
+ {
+ const auto t = api_.getCurrentTime();
+ // LCOV_EXCL_START
+
+ if (api_.getEntityStatus("bob").getMapPose().position.y > 73744.0) {
+ stop(cpp_mock_scenarios::Result::SUCCESS);
+ }
+ // LCOV_EXCL_STOP
+ if (t >= 60) {
+ stop(cpp_mock_scenarios::Result::FAILURE);
+ }
+ }
+
+ void onInitialize() override
+ {
+ api_.spawn(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34981, 0, 0, api_.getHdmapUtils()),
+ getVehicleParameters());
+ api_.setEntityStatus(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34981, 0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructActionStatus(5.7));
+ api_.requestSpeedChange("ego", 0, true);
+ api_.requestAssignRoute(
+ "ego", std::vector{
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34675, 0.0, 0.0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34690, 0.0, 0.0, api_.getHdmapUtils()),
+ });
+
+ api_.spawn(
+ "bob",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34378, 0.0, 0, api_.getHdmapUtils()),
+ getPedestrianParameters(), traffic_simulator::PedestrianBehavior::contextGamma());
+ api_.requestSpeedChange(
+ "bob", 0.5, traffic_simulator::speed_change::Transition::LINEAR,
+ traffic_simulator::speed_change::Constraint(
+ traffic_simulator::speed_change::Constraint::Type::LONGITUDINAL_ACCELERATION, 1.0),
+ true);
+ const geometry_msgs::msg::Pose goal_pose = traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34378, 7.5, 0, 0, 0, 0, api_.getHdmapUtils()));
+ api_.requestAcquirePosition("bob", goal_pose);
+ }
+};
+
+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/mock/cpp_mock_scenarios/src/context_gamma_planner/pedestrian_follow_lane.cpp b/mock/cpp_mock_scenarios/src/context_gamma_planner/pedestrian_follow_lane.cpp
new file mode 100644
index 00000000000..6a1e9c993df
--- /dev/null
+++ b/mock/cpp_mock_scenarios/src/context_gamma_planner/pedestrian_follow_lane.cpp
@@ -0,0 +1,94 @@
+// Copyright 2022 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
+
+// headers in STL
+#include
+#include
+#include
+
+class PedestrianFollowLane : public cpp_mock_scenarios::CppScenarioNode
+{
+public:
+ explicit PedestrianFollowLane(const rclcpp::NodeOptions & option)
+ : cpp_mock_scenarios::CppScenarioNode(
+ "pedestrian_follow_lane",
+ ament_index_cpp::get_package_share_directory("kashiwanoha_map") + "/map", "lanelet2_map.osm",
+ __FILE__, false, option)
+ {
+ start();
+ }
+
+private:
+ int step_ = 0;
+ const std::vector checkpoint_ids_ = {35016, 35036, 34981};
+ void onUpdate() override
+ {
+ const auto t = api_.getCurrentTime();
+ if (
+ static_cast(api_.getEntityStatus("ego").getLaneletPose())
+ .lanelet_id == checkpoint_ids_.at(step_)) {
+ step_++;
+ }
+ if (step_ == static_cast(checkpoint_ids_.size())) {
+ stop(cpp_mock_scenarios::Result::SUCCESS);
+ }
+
+ // LCOV_EXCL_STOP
+ if (t >= 100) {
+ stop(cpp_mock_scenarios::Result::FAILURE);
+ }
+ }
+
+ void onInitialize() override
+ {
+ api_.spawn(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34426, 10.0, 0, api_.getHdmapUtils()),
+ getPedestrianParameters(), traffic_simulator::PedestrianBehavior::contextGamma());
+ api_.requestSpeedChange(
+ "ego", 4.0, traffic_simulator::speed_change::Transition::LINEAR,
+ traffic_simulator::speed_change::Constraint(
+ traffic_simulator::speed_change::Constraint::Type::LONGITUDINAL_ACCELERATION, 1.0),
+ true);
+ api_.requestAssignRoute(
+ "ego", std::vector{
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 35016, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 35026, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 35036, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34981, 1.0, 0, api_.getHdmapUtils())});
+ }
+};
+
+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/mock/cpp_mock_scenarios/src/context_gamma_planner/reverse_walk_at_road.cpp b/mock/cpp_mock_scenarios/src/context_gamma_planner/reverse_walk_at_road.cpp
new file mode 100644
index 00000000000..e763630ed08
--- /dev/null
+++ b/mock/cpp_mock_scenarios/src/context_gamma_planner/reverse_walk_at_road.cpp
@@ -0,0 +1,123 @@
+// Copyright 2022 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
+class ReverseWalkAtRoadScenario : public cpp_mock_scenarios::CppScenarioNode
+{
+public:
+ explicit ReverseWalkAtRoadScenario(const rclcpp::NodeOptions & option)
+ : cpp_mock_scenarios::CppScenarioNode(
+ "reverse_walk_at_road",
+ ament_index_cpp::get_package_share_directory("kashiwanoha_map") + "/map", "lanelet2_map.osm",
+ __FILE__, false, option)
+ {
+ start();
+ }
+
+private:
+ const geometry_msgs::msg::Pose goal_pose_ =
+ traffic_simulator::pose::toMapPose(traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34976, 2, 0, 0, 0, 0, api_.getHdmapUtils()));
+ void onUpdate() override
+ {
+ const auto t = api_.getCurrentTime();
+ if (6.5 < t && t < 7) {
+ api_.requestSpeedChange("ego", 0, true);
+ }
+ const Eigen::Vector3d target_pose{goal_pose_.position.x, goal_pose_.position.y, 0};
+ const Eigen::Vector3d current_pose{
+ api_.getEntityStatus("bob").getMapPose().position.x,
+ api_.getEntityStatus("bob").getMapPose().position.y, 0};
+ if ((target_pose - current_pose).norm() < 2.0) {
+ stop(cpp_mock_scenarios::Result::SUCCESS);
+ }
+ // LCOV_EXCL_STOP
+ if (t >= 120) {
+ stop(cpp_mock_scenarios::Result::FAILURE);
+ }
+ }
+
+ void onInitialize() override
+ {
+ api_.spawn(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34976, 0, 0, api_.getHdmapUtils()),
+ getVehicleParameters(), traffic_simulator::VehicleBehavior::contextGamma());
+ api_.setEntityStatus(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34976, 0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructActionStatus());
+ api_.requestAssignRoute(
+ "ego", std::vector{
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34591, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34690, 0.0, 0, api_.getHdmapUtils()),
+ });
+ api_.requestSpeedChange("ego", 7, true);
+
+ api_.spawn(
+ "bob",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34981, 0.0, 0, api_.getHdmapUtils()),
+ getPedestrianParameters(), traffic_simulator::PedestrianBehavior::contextGamma());
+ api_.requestSpeedChange(
+ "bob", 1, traffic_simulator::speed_change::Transition::LINEAR,
+ traffic_simulator::speed_change::Constraint(
+ traffic_simulator::speed_change::Constraint::Type::LONGITUDINAL_ACCELERATION, 1.0),
+ true);
+
+ auto toVertex = [](double time, const geometry_msgs::msg::Pose & pose) {
+ traffic_simulator_msgs::msg::Vertex vertex;
+ vertex.position = pose;
+ vertex.time = time;
+ return vertex;
+ };
+ traffic_simulator_msgs::msg::PolylineTrajectory follow_trajectory;
+ follow_trajectory.shape.vertices.push_back(toVertex(
+ 0.0, traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34981, 0, 0, 0, 0, 0, api_.getHdmapUtils()))));
+ follow_trajectory.shape.vertices.push_back(toVertex(30.0, goal_pose_));
+
+ follow_trajectory.initial_distance_offset = 0.0;
+ follow_trajectory.dynamic_constraints_ignorable = true;
+ follow_trajectory.base_time = 0.0;
+ follow_trajectory.closed = false;
+ std::shared_ptr follow_trajectory_ptr =
+ std::make_shared(follow_trajectory);
+ api_.requestFollowTrajectory("bob", follow_trajectory_ptr);
+ }
+};
+
+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/mock/cpp_mock_scenarios/src/context_gamma_planner/road_end.cpp b/mock/cpp_mock_scenarios/src/context_gamma_planner/road_end.cpp
new file mode 100644
index 00000000000..e4e937a37ef
--- /dev/null
+++ b/mock/cpp_mock_scenarios/src/context_gamma_planner/road_end.cpp
@@ -0,0 +1,82 @@
+// Copyright 2022 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
+
+// headers in STL
+#include
+#include
+#include
+
+class RoadEndScenario : public cpp_mock_scenarios::CppScenarioNode
+{
+public:
+ explicit RoadEndScenario(const rclcpp::NodeOptions & option)
+ : cpp_mock_scenarios::CppScenarioNode(
+ "road_end", ament_index_cpp::get_package_share_directory("kashiwanoha_map") + "/map",
+ "lanelet2_map.osm", __FILE__, false, option)
+ {
+ start();
+ }
+
+private:
+ void onUpdate() override
+ {
+ const auto t = api_.getCurrentTime();
+ if (
+ api_.getEntityStatus("ego").getLaneletPose().s > 55.0 and
+ api_.getEntityStatus("ego").getLaneletPose().lanelet_id == 34468 and
+ api_.getEntityStatus("ego").getTwist().linear.x < 0.01) {
+ stop(cpp_mock_scenarios::Result::SUCCESS);
+ }
+ // LCOV_EXCL_STOP
+ if (t >= 30) {
+ stop(cpp_mock_scenarios::Result::FAILURE);
+ }
+ }
+
+ void onInitialize() override
+ {
+ //Vehicle setting
+ api_.spawn(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34468, 30, 0, api_.getHdmapUtils()),
+ getVehicleParameters(), traffic_simulator::VehicleBehavior::contextGamma());
+ api_.requestSpeedChange("ego", 5, true);
+ api_.requestAssignRoute(
+ "ego", std::vector{
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34468, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34696, 0.0, 0, api_.getHdmapUtils()),
+ });
+ }
+};
+
+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/mock/cpp_mock_scenarios/src/context_gamma_planner/spawn.cpp b/mock/cpp_mock_scenarios/src/context_gamma_planner/spawn.cpp
new file mode 100644
index 00000000000..4dfe978c856
--- /dev/null
+++ b/mock/cpp_mock_scenarios/src/context_gamma_planner/spawn.cpp
@@ -0,0 +1,98 @@
+// Copyright 2015-2020 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
+
+// headers in STL
+#include
+#include
+#include
+
+class SpawnScenario : public cpp_mock_scenarios::CppScenarioNode
+{
+public:
+ explicit SpawnScenario(const rclcpp::NodeOptions & option)
+ : cpp_mock_scenarios::CppScenarioNode(
+ "spawn", ament_index_cpp::get_package_share_directory("kashiwanoha_map") + "/map",
+ "lanelet2_map.osm", __FILE__, false, option)
+ {
+ start();
+ }
+
+private:
+ void onUpdate() override
+ {
+ const auto t = api_.getCurrentTime();
+
+ // LCOV_EXCL_STOP
+ if (t >= 5) {
+ stop(cpp_mock_scenarios::Result::SUCCESS);
+ }
+ }
+
+ void onInitialize() override
+ {
+ //Vehicle setting
+ api_.spawn(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 120545, 0, 0, api_.getHdmapUtils()),
+ getVehicleParameters(), traffic_simulator::VehicleBehavior::contextGamma());
+ api_.setEntityStatus(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 120545, 0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructActionStatus(10));
+ api_.requestSpeedChange("ego", 0, true);
+ api_.requestAssignRoute(
+ "ego", std::vector{
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34675, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34690, 0.0, 0, api_.getHdmapUtils()),
+ });
+
+ //Pedestrian setting
+ api_.spawn(
+ "bob",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34378, 0.0, 0, api_.getHdmapUtils()),
+ getPedestrianParameters(), traffic_simulator::PedestrianBehavior::contextGamma());
+ api_.requestSpeedChange(
+ "bob", 0.0, traffic_simulator::speed_change::Transition::LINEAR,
+ traffic_simulator::speed_change::Constraint(
+ traffic_simulator::speed_change::Constraint::Type::LONGITUDINAL_ACCELERATION, 1.0),
+ true);
+ const geometry_msgs::msg::Pose goal_pose = traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34378, 7.5, 0, 0, 0, 0, api_.getHdmapUtils()));
+ api_.requestAcquirePosition("bob", goal_pose);
+ }
+};
+
+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/mock/cpp_mock_scenarios/src/context_gamma_planner/stop_at_crosswalk.cpp b/mock/cpp_mock_scenarios/src/context_gamma_planner/stop_at_crosswalk.cpp
new file mode 100644
index 00000000000..722f3048ce7
--- /dev/null
+++ b/mock/cpp_mock_scenarios/src/context_gamma_planner/stop_at_crosswalk.cpp
@@ -0,0 +1,109 @@
+// Copyright 2022 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
+
+// headers in STL
+#include
+#include
+#include
+
+class StopAtCrosswalkScenario : public cpp_mock_scenarios::CppScenarioNode
+{
+public:
+ 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)
+ {
+ start();
+ }
+
+private:
+ bool is_stoped_ = false;
+ void onUpdate() override
+ {
+ const auto t = api_.getCurrentTime();
+ if (
+ static_cast(api_.getEntityStatus("ego").getLaneletPose())
+ .lanelet_id == 34981 &&
+ api_.getCurrentTwist("ego").linear.x < 2.0) {
+ is_stoped_ = true;
+ }
+ if (
+ static_cast(api_.getEntityStatus("ego").getLaneletPose())
+ .lanelet_id == 34579 &&
+ is_stoped_) {
+ stop(cpp_mock_scenarios::Result::SUCCESS);
+ }
+ // LCOV_EXCL_STOP
+ if (t >= 40) {
+ stop(cpp_mock_scenarios::Result::FAILURE);
+ }
+ }
+
+ void onInitialize() override
+ {
+ //Vehicle setting
+ api_.spawn(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 120545, 0, 0, api_.getHdmapUtils()),
+ getVehicleParameters(), traffic_simulator::VehicleBehavior::contextGamma());
+ api_.setEntityStatus(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 120545, 0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructActionStatus(10));
+ api_.requestSpeedChange("ego", 7, true);
+ api_.requestAssignRoute(
+ "ego", std::vector{
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34675, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34690, 0.0, 0, api_.getHdmapUtils())});
+
+ //Pedestrian setting
+ api_.spawn(
+ "bob",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34378, 0.0, 0, api_.getHdmapUtils()),
+ getPedestrianParameters(), traffic_simulator::PedestrianBehavior::contextGamma());
+ api_.requestSpeedChange(
+ "bob", 0.5, traffic_simulator::speed_change::Transition::LINEAR,
+ traffic_simulator::speed_change::Constraint(
+ traffic_simulator::speed_change::Constraint::Type::LONGITUDINAL_ACCELERATION, 1.0),
+ true);
+ const geometry_msgs::msg::Pose goal_pose = traffic_simulator::pose::toMapPose(
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34378, 7.5, 0, 0, 0, 0, api_.getHdmapUtils()));
+ api_.requestAcquirePosition("bob", goal_pose);
+ }
+};
+
+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/mock/cpp_mock_scenarios/src/context_gamma_planner/stop_line_running.cpp b/mock/cpp_mock_scenarios/src/context_gamma_planner/stop_line_running.cpp
new file mode 100644
index 00000000000..1928e72efa6
--- /dev/null
+++ b/mock/cpp_mock_scenarios/src/context_gamma_planner/stop_line_running.cpp
@@ -0,0 +1,104 @@
+// Copyright 2022 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
+
+// headers in STL
+#include
+#include
+#include
+
+class StopLineRunningScenario : public cpp_mock_scenarios::CppScenarioNode
+{
+public:
+ explicit StopLineRunningScenario(const rclcpp::NodeOptions & option)
+ : cpp_mock_scenarios::CppScenarioNode(
+ "stop_line_running", ament_index_cpp::get_package_share_directory("kashiwanoha_map") + "/map",
+ "lanelet2_map.osm", __FILE__, false, option)
+ {
+ start();
+ }
+
+private:
+ bool is_stoped_ = false;
+ int stop_count_ = 0;
+ void onUpdate() override
+ {
+ const auto t = api_.getCurrentTime();
+ if (
+ static_cast(api_.getEntityStatus("ego").getLaneletPose())
+ .lanelet_id == 34675 and
+ api_.getCurrentTwist("ego").linear.x < 0.2) {
+ is_stoped_ = true;
+ }
+ if (
+ is_stoped_ and
+ static_cast(api_.getEntityStatus("ego").getLaneletPose())
+ .lanelet_id == 34744) {
+ is_stoped_ = false;
+ stop_count_++;
+ }
+ if (stop_count_ == 2) {
+ stop(cpp_mock_scenarios::Result::SUCCESS);
+ }
+ // LCOV_EXCL_STOP
+ if (t >= 200) {
+ stop(cpp_mock_scenarios::Result::FAILURE);
+ }
+ }
+
+ void onInitialize() override
+ {
+ //Vehicle setting
+ api_.spawn(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 0, 0, api_.getHdmapUtils()),
+ getVehicleParameters(), traffic_simulator::VehicleBehavior::contextGamma());
+ api_.setEntityStatus(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructActionStatus(10));
+ api_.requestSpeedChange("ego", 7, true);
+ api_.requestAssignRoute(
+ "ego", std::vector{
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34675, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34690, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34576, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34579, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34675, 0.0, 0, api_.getHdmapUtils())});
+ }
+};
+
+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/mock/cpp_mock_scenarios/src/context_gamma_planner/traffic_light_running.cpp b/mock/cpp_mock_scenarios/src/context_gamma_planner/traffic_light_running.cpp
new file mode 100644
index 00000000000..1c517bbe646
--- /dev/null
+++ b/mock/cpp_mock_scenarios/src/context_gamma_planner/traffic_light_running.cpp
@@ -0,0 +1,113 @@
+// Copyright 2022 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
+
+// headers in STL
+#include
+#include
+#include
+
+class TrafficLightRunningScenario : public cpp_mock_scenarios::CppScenarioNode
+{
+public:
+ explicit TrafficLightRunningScenario(const rclcpp::NodeOptions & option)
+ : cpp_mock_scenarios::CppScenarioNode(
+ "traffic_light_running",
+ ament_index_cpp::get_package_share_directory("kashiwanoha_map") + "/map", "lanelet2_map.osm",
+ __FILE__, false, option)
+ {
+ start();
+ }
+
+private:
+ const traffic_simulator::TrafficLight::Bulb green_{
+ traffic_simulator::TrafficLight::Color::green,
+ traffic_simulator::TrafficLight::Status::solid_on,
+ traffic_simulator::TrafficLight::Shape::circle};
+ const traffic_simulator::TrafficLight::Bulb red_{
+ traffic_simulator::TrafficLight::Color::red, traffic_simulator::TrafficLight::Status::solid_on,
+ traffic_simulator::TrafficLight::Shape::circle};
+ void onUpdate() override
+ {
+ const auto t = api_.getCurrentTime();
+
+ // traffic light control
+ if (1.0 <= t && t <= 1.1) {
+ api_.getConventionalTrafficLight(34836).emplace(red_);
+ api_.getConventionalTrafficLight(34802).emplace(red_);
+ }
+ if (10.0 <= t && t <= 10.1) {
+ api_.getConventionalTrafficLight(34836).clear();
+ api_.getConventionalTrafficLight(34802).clear();
+ api_.getConventionalTrafficLight(34836).emplace(green_);
+ api_.getConventionalTrafficLight(34802).emplace(green_);
+ }
+
+ if (
+ t < 10.1 &&
+ static_cast(api_.getEntityStatus("ego").getLaneletPose())
+ .lanelet_id == 34624) {
+ stop(cpp_mock_scenarios::Result::FAILURE);
+ }
+ if (
+ t >= 10.1 &&
+ static_cast(api_.getEntityStatus("ego").getLaneletPose())
+ .lanelet_id == 34624) {
+ stop(cpp_mock_scenarios::Result::SUCCESS);
+ }
+ // LCOV_EXCL_STOP
+ if (t >= 30) {
+ stop(cpp_mock_scenarios::Result::FAILURE);
+ }
+ }
+
+ void onInitialize() override
+ {
+ //Vehicle setting
+ api_.spawn(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34408, 0, 0, api_.getHdmapUtils()),
+ getVehicleParameters(), traffic_simulator::VehicleBehavior::contextGamma());
+ api_.setEntityStatus(
+ "ego",
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34408, 0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructActionStatus(10));
+ api_.requestSpeedChange("ego", 5, true);
+ api_.requestAssignRoute(
+ "ego", std::vector{
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34630, 0.0, 0, api_.getHdmapUtils()),
+ traffic_simulator::helper::constructCanonicalizedLaneletPose(
+ 34696, 0.0, 0, api_.getHdmapUtils())});
+ }
+};
+
+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/simulation/context_gamma_planner/context_gamma_planner/CMakeLists.txt b/simulation/context_gamma_planner/context_gamma_planner/CMakeLists.txt
new file mode 100644
index 00000000000..48d48d5663d
--- /dev/null
+++ b/simulation/context_gamma_planner/context_gamma_planner/CMakeLists.txt
@@ -0,0 +1,70 @@
+cmake_minimum_required(VERSION 3.8)
+project(context_gamma_planner)
+
+if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ add_compile_options(-Wall -Wextra -Wpedantic)
+endif()
+
+# find dependencies
+find_package(ament_cmake_auto REQUIRED)
+include(FindProtobuf REQUIRED)
+#find_package (glog 0.6.0 REQUIRED)
+
+
+ament_auto_find_build_dependencies()
+
+ament_auto_add_library(context_gamma_planner SHARED
+ src/behavior/action_node_base.cpp
+ src/behavior/pedestrian/action_node.cpp
+ src/behavior/pedestrian/follow_lane_action.cpp
+ src/behavior/pedestrian/follow_polyline_trajectory_action.cpp
+ src/behavior/vehicle/action_node.cpp
+ src/behavior/vehicle/follow_lane_action.cpp
+ src/behavior/vehicle/follow_polyline_trajectory_action.cpp
+ src/behavior/vehicle/lane_change_action.cpp
+ src/constraints/constraint_activator_base.cpp
+ src/constraints/constraint_base.cpp
+ src/constraints/pedestrian/constraint_activator.cpp
+ src/constraints/road_edge_constraint.cpp
+ src/constraints/stop_line_constraint.cpp
+ src/constraints/traffic_light_constraint.cpp
+ src/constraints/vehicle/constraint_activator.cpp
+ src/pedestrian_plugin.cpp
+ src/planner/goal_planner_base.cpp
+ src/planner/follow_polyline_trajectory_planner_base.cpp
+ src/planner/pedestrian/follow_lane_planner.cpp
+ src/planner/pedestrian/follow_polyline_trajectory_planner.cpp
+ src/planner/vehicle/follow_lane_planner.cpp
+ src/planner/vehicle/follow_polyline_trajectory_planner.cpp
+ src/planner/vehicle/lane_change_planner.cpp
+ src/transition_events/logging_event.cpp
+ src/transition_events/reset_request_event.cpp
+ src/transition_events/transition_event.cpp
+ src/vehicle_plugin.cpp
+)
+
+target_link_libraries(${PROJECT_NAME}
+ glog
+)
+
+pluginlib_export_plugin_description_file(traffic_simulator plugins.xml)
+
+if(${tf2_geometry_msgs_VERSION} VERSION_LESS 0.18.0)
+ target_compile_definitions(context_gamma_planner PUBLIC
+ USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
+ )
+endif()
+
+if(BUILD_TESTING)
+ find_package(ament_lint_auto REQUIRED)
+ ament_lint_auto_find_test_dependencies()
+ find_package(ament_cmake_gtest REQUIRED)
+ add_subdirectory(test)
+endif()
+
+install(
+ DIRECTORY config test/maps launch
+ DESTINATION share/${PROJECT_NAME}
+)
+
+ament_auto_package()
diff --git a/simulation/context_gamma_planner/context_gamma_planner/config/pedestrian_behavior.xml b/simulation/context_gamma_planner/context_gamma_planner/config/pedestrian_behavior.xml
new file mode 100644
index 00000000000..d776bb412da
--- /dev/null
+++ b/simulation/context_gamma_planner/context_gamma_planner/config/pedestrian_behavior.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/simulation/context_gamma_planner/context_gamma_planner/config/vehicle_behavior.xml b/simulation/context_gamma_planner/context_gamma_planner/config/vehicle_behavior.xml
new file mode 100644
index 00000000000..9e83f4baa64
--- /dev/null
+++ b/simulation/context_gamma_planner/context_gamma_planner/config/vehicle_behavior.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/simulation/context_gamma_planner/context_gamma_planner/include/context_gamma_planner/behavior/action_node_base.hpp b/simulation/context_gamma_planner/context_gamma_planner/include/context_gamma_planner/behavior/action_node_base.hpp
new file mode 100644
index 00000000000..a12733f2339
--- /dev/null
+++ b/simulation/context_gamma_planner/context_gamma_planner/include/context_gamma_planner/behavior/action_node_base.hpp
@@ -0,0 +1,104 @@
+// Copyright 2015-2020 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.
+
+#ifndef CONTEXT_GAMMA_PLANNER__ACTION_NODE_HPP_
+#define CONTEXT_GAMMA_PLANNER__ACTION_NODE_HPP_
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+namespace context_gamma_planner
+{
+class ActionNodeBase : public BT::ActionNodeBase
+{
+public:
+ ActionNodeBase(const std::string & name, const BT::NodeConfiguration & config);
+ ~ActionNodeBase() override = default;
+ /// throws if the derived class return RUNNING.
+ auto executeTick() -> BT::NodeStatus override;
+
+ /**
+ * @brief Halts the execution of the action node.
+ */
+ void halt() override final { setStatus(BT::NodeStatus::IDLE); }
+
+ /**
+ * @brief A list of ports for a behavior tree node.
+ */
+ static BT::PortsList providedPorts()
+ {
+ return {
+ // clang-format off
+ BT::InputPort>("activator"),
+ BT::InputPort("request"),
+ BT::InputPort>("hdmap_utils"),
+ BT::InputPort>("canonicalized_entity_status"),
+ BT::InputPort("current_time"),
+ BT::InputPort("step_time"),
+ BT::InputPort("other_entity_status"),
+ BT::InputPort>("goal_poses"),
+ BT::InputPort>("route_lanelets"),
+ BT::InputPort>("target_speed"),
+ BT::OutputPort>("planning_speed"),
+ BT::OutputPort("next_goal"),
+ BT::OutputPort>("updated_status"),
+ BT::OutputPort("request"),
+ BT::InputPort("other_entity_status"),
+ BT::InputPort>("route_lanelets"),
+ BT::InputPort>("traffic_lights"),
+ BT::OutputPort>("hdmap_utils"),
+ BT::OutputPort>("obstacle"),
+ BT::OutputPort("waypoints")};
+ // clang-format on
+ }
+
+ /**
+ * @brief This function retrieves the values stored in the blackboard and performs any necessary operations.
+ */
+ auto getBlackBoardValues() -> void;
+
+protected:
+ std::shared_ptr activator;
+ traffic_simulator::behavior::Request request;
+ std::shared_ptr hdmap_utils;
+ std::shared_ptr traffic_lights;
+ std::shared_ptr entity_status;
+ double current_time;
+ double step_time;
+ std::optional target_speed;
+ std::shared_ptr updated_status;
+ entity_behavior::EntityStatusDict other_entity_status;
+ std::vector route_lanelets;
+};
+} // namespace context_gamma_planner
+
+#endif // CONTEXT_GAMMA_PLANNER__ACTION_NODE_HPP_
\ No newline at end of file
diff --git a/simulation/context_gamma_planner/context_gamma_planner/include/context_gamma_planner/behavior/pedestrian/action_node.hpp b/simulation/context_gamma_planner/context_gamma_planner/include/context_gamma_planner/behavior/pedestrian/action_node.hpp
new file mode 100644
index 00000000000..40414513b65
--- /dev/null
+++ b/simulation/context_gamma_planner/context_gamma_planner/include/context_gamma_planner/behavior/pedestrian/action_node.hpp
@@ -0,0 +1,59 @@
+// Copyright 2015-2020 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.
+
+#ifndef CONTEXT_GAMMA_PLANNER__PEDESTRIAN__PEDESTRIAN_ACTION_NODE_HPP_
+#define CONTEXT_GAMMA_PLANNER__PEDESTRIAN__PEDESTRIAN_ACTION_NODE_HPP_
+
+#include
+
+#include