scenario_simulator_v2 C++ API
follow_lane_action.hpp
Go to the documentation of this file.
1 // Copyright 2015 TIER IV, Inc. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef BEHAVIOR_TREE_PLUGIN__VEHICLE__FOLLOW_LANE_SEQUENCE__FOLLOW_LANE_ACTION_HPP_
16 #define BEHAVIOR_TREE_PLUGIN__VEHICLE__FOLLOW_LANE_SEQUENCE__FOLLOW_LANE_ACTION_HPP_
17 
20 #include <optional>
21 #include <string>
22 #include <vector>
23 
24 namespace entity_behavior
25 {
26 namespace vehicle
27 {
28 namespace follow_lane_sequence
29 {
31 {
32 public:
33  FollowLaneAction(const std::string & name, const BT::NodeConfiguration & config);
34  bool checkPreconditions() override;
35  BT::NodeStatus doAction() override;
36  void getBlackBoardValues() override;
37  static BT::PortsList providedPorts()
38  {
40  }
41  const traffic_simulator_msgs::msg::WaypointsArray calculateWaypoints() override;
42  const std::optional<traffic_simulator_msgs::msg::Obstacle> calculateObstacle(
43  const traffic_simulator_msgs::msg::WaypointsArray & waypoints) override;
44 
45 private:
46  std::optional<traffic_simulator::LaneletPose> target_lanelet_pose_;
47  bool use_trajectory_based_front_entity_detection_;
48  double trajectory_based_detection_width_;
49  static constexpr double waypoint_interval = 1.0;
50  static constexpr double front_entity_stop_margin = 5.0;
51  static constexpr double bounding_box_half_factor = 0.5;
52  static constexpr double stop_line_margin = 5.0;
53  static constexpr double conflicting_entity_margin = 3.0;
54 };
55 } // namespace follow_lane_sequence
56 } // namespace vehicle
57 } // namespace entity_behavior
58 
59 #endif // BEHAVIOR_TREE_PLUGIN__VEHICLE__FOLLOW_LANE_SEQUENCE__FOLLOW_LANE_ACTION_HPP_
Definition: vehicle_action_node.hpp:36
static BT::PortsList providedPorts()
Definition: vehicle_action_node.hpp:41
BT::NodeStatus doAction() override
Definition: follow_lane_action.cpp:89
void getBlackBoardValues() override
Definition: follow_lane_action.cpp:67
FollowLaneAction(const std::string &name, const BT::NodeConfiguration &config)
Definition: follow_lane_action.cpp:31
bool checkPreconditions() override
Definition: follow_lane_action.cpp:78
const std::optional< traffic_simulator_msgs::msg::Obstacle > calculateObstacle(const traffic_simulator_msgs::msg::WaypointsArray &waypoints) override
Definition: follow_lane_action.cpp:43
const traffic_simulator_msgs::msg::WaypointsArray calculateWaypoints() override
Definition: follow_lane_action.cpp:49
static BT::PortsList providedPorts()
Definition: follow_lane_action.hpp:37
Definition: action_node.hpp:43
std::string string
Definition: junit5.hpp:26