15 #ifndef BEHAVIOR_TREE_PLUGIN__ACTION_NODE_HPP_
16 #define BEHAVIOR_TREE_PLUGIN__ACTION_NODE_HPP_
18 #include <behaviortree_cpp_v3/action_node.h>
33 #include <traffic_simulator_msgs/msg/obstacle.hpp>
34 #include <traffic_simulator_msgs/msg/waypoints_array.hpp>
35 #include <unordered_map>
40 BT::PortsList
operator+(
const BT::PortsList & ports_0,
const BT::PortsList & ports_1);
52 -> std::optional<std::string>;
56 -> std::optional<double>;
59 const std::vector<geometry_msgs::msg::Point> & waypoints)
const -> std::optional<double>;
75 void halt() override final { setStatus(BT::NodeStatus::IDLE); }
81 BT::InputPort<double>(
"current_time"),
82 BT::InputPort<double>(
"matching_distance_for_lanelet_pose_calculation"),
83 BT::InputPort<double>(
"step_time"),
84 BT::InputPort<EntityStatusDict>(
"other_entity_status"),
85 BT::InputPort<lanelet::Ids>(
"route_lanelets"),
86 BT::InputPort<std::optional<double>>(
"target_speed"),
87 BT::InputPort<std::shared_ptr<hdmap_utils::HdMapUtils>>(
"hdmap_utils"),
88 BT::InputPort<std::shared_ptr<traffic_simulator::CanonicalizedEntityStatus>>(
"canonicalized_entity_status"),
89 BT::InputPort<std::shared_ptr<traffic_simulator::TrafficLightsBase>>(
"traffic_lights"),
90 BT::InputPort<traffic_simulator::behavior::Request>(
"request"),
91 BT::OutputPort<std::optional<traffic_simulator_msgs::msg::Obstacle>>(
"obstacle"),
92 BT::OutputPort<traffic_simulator_msgs::msg::WaypointsArray>(
"waypoints"),
93 BT::OutputPort<traffic_simulator::behavior::Request>(
"request"),
103 double width_extension_right = 0.0,
double width_extension_left = 0.0,
104 double length_extension_front = 0.0,
double length_extension_rear = 0.0) const
105 ->
std::optional<
double>;
109 double target_speed, const traffic_simulator_msgs::msg::DynamicConstraints &) const
112 double target_speed, const traffic_simulator_msgs::msg::DynamicConstraints &) const
128 auto getDistanceToTargetEntityOnCrosswalk(
129 const
math::geometry::CatmullRomSplineInterface & spline,
132 const
math::geometry::CatmullRomSplineInterface & spline,
133 const
traffic_simulator::CanonicalizedEntityStatus & status,
double width_extension_right = 0.0,
134 double width_extension_left = 0.0,
double length_extension_front = 0.0,
135 double length_extension_rear = 0.0) const ->
std::optional<
double>;
136 auto getConflictingEntityStatus(const lanelet::Ids & following_lanelets) const
138 auto getConflictingEntityStatusOnCrossWalk(const lanelet::Ids &
route_lanelets) const
140 auto getConflictingEntityStatusOnLane(const lanelet::Ids &
route_lanelets) const
142 auto isOtherEntityAtConsideredAltitude(
143 const
traffic_simulator::CanonicalizedEntityStatus & entity_status) const ->
bool;
Definition: action_node.hpp:43
EntityStatusDict other_entity_status
Definition: action_node.hpp:124
auto getDistanceToTrafficLightStopLine(const lanelet::Ids &route_lanelets, const math::geometry::CatmullRomSplineInterface &spline) const -> std::optional< double >
Definition: action_node.cpp:205
void halt() override final
Definition: action_node.hpp:75
~ActionNode() override=default
lanelet::Ids route_lanelets
Definition: action_node.hpp:125
std::shared_ptr< traffic_simulator::CanonicalizedEntityStatus > canonicalized_entity_status
Definition: action_node.hpp:119
auto stopEntity() const -> void
Definition: action_node.cpp:97
auto calculateStopDistance(const traffic_simulator_msgs::msg::DynamicConstraints &) const -> double
Definition: action_node.cpp:550
auto getDistanceToStopLine(const lanelet::Ids &route_lanelets, const std::vector< geometry_msgs::msg::Point > &waypoints) const -> std::optional< double >
Definition: action_node.cpp:228
auto setCanonicalizedEntityStatus(const traffic_simulator::EntityStatus &entity_status) -> void
Definition: action_node.cpp:104
auto calculateUpdatedEntityStatus(double target_speed, const traffic_simulator_msgs::msg::DynamicConstraints &) const -> traffic_simulator::EntityStatus
Definition: action_node.cpp:416
auto getHorizon() const -> double
Definition: action_node.cpp:92
std::shared_ptr< traffic_simulator::TrafficLightsBase > traffic_lights
Definition: action_node.hpp:118
double step_time
Definition: action_node.hpp:121
traffic_simulator::behavior::Request request
Definition: action_node.hpp:116
auto getDistanceToFrontEntity(const math::geometry::CatmullRomSplineInterface &spline) const -> std::optional< double >
Definition: action_node.cpp:235
auto calculateUpdatedEntityStatusInWorldFrame(double target_speed, const traffic_simulator_msgs::msg::DynamicConstraints &) const -> traffic_simulator::EntityStatus
Definition: action_node.cpp:509
auto getDistanceToTargetEntityPolygon(const math::geometry::CatmullRomSplineInterface &spline, const std::string target_name, double width_extension_right=0.0, double width_extension_left=0.0, double length_extension_front=0.0, double length_extension_rear=0.0) const -> std::optional< double >
Definition: action_node.cpp:299
auto getEntityStatus(const std::string &target_name) const -> const traffic_simulator::CanonicalizedEntityStatus &
Definition: action_node.cpp:289
auto getDistanceToConflictingEntity(const lanelet::Ids &route_lanelets, const math::geometry::CatmullRomSplineInterface &spline) const -> std::optional< double >
Definition: action_node.cpp:336
double default_matching_distance_for_lanelet_pose_calculation
Definition: action_node.hpp:122
auto getYieldStopDistance(const lanelet::Ids &following_lanelets) const -> std::optional< double >
Definition: action_node.cpp:125
auto getFrontEntityName(const math::geometry::CatmullRomSplineInterface &spline) const -> std::optional< std::string >
Definition: action_node.cpp:245
auto getRightOfWayEntities() const -> std::vector< traffic_simulator::CanonicalizedEntityStatus >
Definition: action_node.cpp:181
auto getOtherEntityStatus(lanelet::Id lanelet_id) const -> std::vector< traffic_simulator::CanonicalizedEntityStatus >
Definition: action_node.cpp:111
double current_time
Definition: action_node.hpp:120
static BT::PortsList providedPorts()
Definition: action_node.hpp:77
ActionNode(const std::string &name, const BT::NodeConfiguration &config)
Definition: action_node.cpp:43
auto executeTick() -> BT::NodeStatus override
throws if the derived class return RUNNING.
Definition: action_node.cpp:48
auto foundConflictingEntity(const lanelet::Ids &following_lanelets) const -> bool
Definition: action_node.cpp:394
std::optional< double > target_speed
Definition: action_node.hpp:123
virtual auto getBlackBoardValues() -> void
Definition: action_node.cpp:50
Definition: catmull_rom_spline_interface.hpp:30
Definition: entity_status.hpp:32
Definition: action_node.hpp:39
std::unordered_map< std::string, traffic_simulator::CanonicalizedEntityStatus > EntityStatusDict
Definition: behavior_plugin_base.hpp:37
BT::PortsList operator+(const BT::PortsList &ports_0, const BT::PortsList &ports_1)
Definition: action_node.cpp:36
Definition: bounding_box.hpp:32
Request
Definition: behavior.hpp:25
std::string string
Definition: junit5.hpp:26
traffic_simulator_msgs::EntityStatus EntityStatus
Definition: helper_functions.hpp:32