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__PEDESTRIAN__FOLLOW_LANE_ACTION_HPP_
16 #define BEHAVIOR_TREE_PLUGIN__PEDESTRIAN__FOLLOW_LANE_ACTION_HPP_
17 
18 #include <behaviortree_cpp_v3/behavior_tree.h>
19 #include <behaviortree_cpp_v3/bt_factory.h>
20 
24 #include <get_parameter/get_parameter.hpp>
25 #include <memory>
27 #include <string>
29 #include <traffic_simulator_msgs/msg/entity_status.hpp>
30 #include <traffic_simulator_msgs/msg/waypoints_array.hpp>
31 #include <vector>
32 
33 namespace entity_behavior
34 {
35 namespace pedestrian
36 {
37 
39 {
40 public:
41  FollowLaneAction(const std::string & name, const BT::NodeConfiguration & config);
42  bool checkPreconditions() override;
43  BT::NodeStatus doAction() override;
44  void getBlackBoardValues() override;
45  static BT::PortsList providedPorts()
46  {
48  }
50  const lanelet::Ids pedestrian_lanes, const bool see_around,
51  const std::vector<geometry_msgs::msg::Point> & waypoints) const;
52  traffic_simulator_msgs::msg::WaypointsArray calculateWaypoints(
53  const lanelet::Ids & following_lanelets) const;
54 
55 private:
56  bool use_trajectory_based_front_entity_detection_;
57  double trajectory_based_detection_offset_;
58 };
59 } // namespace pedestrian
60 } // namespace entity_behavior
61 
62 #endif // BEHAVIOR_TREE_PLUGIN__PEDESTRIAN__FOLLOW_LANE_ACTION_HPP_
Definition: pedestrian_action_node.hpp:29
static BT::PortsList providedPorts()
Definition: pedestrian_action_node.hpp:33
Definition: follow_lane_action.hpp:39
static BT::PortsList providedPorts()
Definition: follow_lane_action.hpp:45
traffic_simulator_msgs::msg::WaypointsArray calculateWaypoints(const lanelet::Ids &following_lanelets) const
Definition: follow_lane_action.cpp:117
bool checkPreconditions() override
Definition: follow_lane_action.cpp:164
FollowLaneAction(const std::string &name, const BT::NodeConfiguration &config)
Definition: follow_lane_action.cpp:30
bool detectObstacleInLane(const lanelet::Ids pedestrian_lanes, const bool see_around, const std::vector< geometry_msgs::msg::Point > &waypoints) const
Definition: follow_lane_action.cpp:41
BT::NodeStatus doAction() override
Definition: follow_lane_action.cpp:175
void getBlackBoardValues() override
Definition: follow_lane_action.cpp:39
Definition: action_node.hpp:43
std::string string
Definition: junit5.hpp:26