|
lanelet2_route_planning v2.0.0
|
Lanelet2 route planning node. More...
#include <lanelet2_route_planning.hpp>
Public Member Functions | |
| Lanelet2RoutePlanning () | |
| Constructor. | |
Private Member Functions | |
| template<typename T > | |
| void | declareAndLoadParameter (const std::string &name, T ¶m, const std::string &description, const bool add_to_auto_reconfigurable_params=true, const bool is_required=false, const bool read_only=false, const std::optional< double > &from_value=std::nullopt, const std::optional< double > &to_value=std::nullopt, const std::optional< double > &step_value=std::nullopt, const std::string &additional_constraints="") |
| Declares and loads a ROS parameter. | |
| rcl_interfaces::msg::SetParametersResult | parametersCallback (const std::vector< rclcpp::Parameter > ¶meters) |
| Handles reconfiguration when a parameter value is changed. | |
| void | setup () |
| Sets up subscribers, publishers, etc. to configure the node. | |
| bool | checkMap (bool handle_update) |
| Checks if map is loaded and handles map updates. | |
| bool | buildRoutingGraph () |
| Builds the lanelet2 routing graph based on the current map. | |
| void | egoDataCallback (const perception_msgs::msg::EgoData::SharedPtr msg) |
| Callback for EgoData. | |
| void | publishTimerCallback () |
| Callback to periodically publish the route. | |
| void | globalRoutePublishTimerCallback () |
| Callback to periodically publish the adaptively sampled global route. | |
| rclcpp_action::GoalResponse | actionHandleGoal (const rclcpp_action::GoalUUID &uuid, std::shared_ptr< const route_planning_msgs::action::PlanRoute::Goal > goal) |
| Action goal callback: processes a route planning request. | |
| rclcpp_action::CancelResponse | actionHandleCancel (const std::shared_ptr< rclcpp_action::ServerGoalHandle< route_planning_msgs::action::PlanRoute > > goal_handle) |
| Action cancel callback: cancels a running action. | |
| void | actionHandleAccepted (const std::shared_ptr< rclcpp_action::ServerGoalHandle< route_planning_msgs::action::PlanRoute > > goal_handle) |
| Action accepted callback: starts action execution. | |
| void | actionExecute (const std::shared_ptr< rclcpp_action::ServerGoalHandle< route_planning_msgs::action::PlanRoute > > goal_handle) |
| Action execution: continually publishes route progress. | |
| bool | planRoute (const geometry_msgs::msg::PointStamped &destination, const std::vector< geometry_msgs::msg::PointStamped > &intermediate_destinations={}) |
| Plans a lanelet route to the destination. | |
| void | buildGlobalRouteMessage () |
| Builds a global ROS route message from the latest planned lanelet route. | |
| void | buildEnrichedRouteMessage () |
| Builds an enriched ROS route message from the latest planned lanelet route. | |
| void | publishHealth (const unsigned char status, const std::string &msg, const rclcpp::Time &now) |
| Publishes health diagnostic. | |
Private Attributes | |
| std::vector< std::tuple< std::string, std::function< void(const rclcpp::Parameter &)> > > | auto_reconfigurable_params_ |
| Auto-reconfigurable parameters for dynamic reconfiguration. | |
| OnSetParametersCallbackHandle::SharedPtr | parameters_callback_ |
| Callback handle for dynamic parameter reconfiguration. | |
| rclcpp::Subscription< perception_msgs::msg::EgoData >::SharedPtr | subscriber_ego_data_ |
| Subscriber for ego data. | |
| rclcpp::Publisher< route_planning_msgs::msg::Route >::SharedPtr | publisher_route_ |
| Publisher for enriched route. | |
| rclcpp::Publisher< route_planning_msgs::msg::Route >::SharedPtr | publisher_global_route_ |
| Publisher for the adaptively sampled global route. | |
| rclcpp::TimerBase::SharedPtr | publish_timer_ |
| Timer for publishing the enriched route. | |
| rclcpp::TimerBase::SharedPtr | global_route_publish_timer_ |
| Timer for publishing the global route. | |
| rclcpp_action::Server< route_planning_msgs::action::PlanRoute >::SharedPtr | action_server_ |
| Action server. | |
| route_planning_msgs::action::PlanRoute::Feedback::SharedPtr | action_feedback_ |
| Latest action feedback. | |
| route_planning_msgs::action::PlanRoute::Result::SharedPtr | action_result_ |
| Latest action result. | |
| std::shared_ptr< rclcpp_action::ServerGoalHandle< route_planning_msgs::action::PlanRoute > > | action_goal_handle_ |
| Latest action goal handle. | |
| rclcpp::CallbackGroup::SharedPtr | action_callback_group_ |
| Callback group for action server. | |
| rclcpp::Time | action_start_time_ |
| Latest action start time to compute action duration. | |
| std::unique_ptr< tf2_ros::Buffer > | tf_buffer_ |
| Transform buffer. | |
| std::shared_ptr< tf2_ros::TransformListener > | tf_listener_ |
| Transform listener. | |
| perception_msgs::msg::EgoData | latest_ego_data_ |
| Latest ego data in map frame. | |
| std::unique_ptr< Lanelet2MapInterface > | ll2_interface_ |
| Lanelet2 map interface. | |
| lanelet::routing::RoutingGraphUPtr | routing_graph_ |
| Lanelet routing graph for current map. | |
| geometry_msgs::msg::Point | starting_point_ |
| Starting point in map frame. | |
| geometry_msgs::msg::Point | destination_ |
| Destination point in map frame. | |
| std::vector< geometry_msgs::msg::Point > | intermediate_destinations_ |
| Intermediate points in map frame. | |
| lanelet::routing::Route | latest_route_ |
| Latest planned lanelet route. | |
| bool | has_enriched_route_ = false |
| Flag indicating that route has been enriched at least once. | |
| bool | is_publishing_route_ |
| Controlling flag for route publication. | |
| route_planning_msgs::msg::Route | latest_route_msg_ |
| Latest route message to publish. | |
| route_planning_msgs::msg::Route | latest_full_route_msg_ |
| Latest complete minimal route used internally for progress tracking. | |
| route_planning_msgs::msg::Route | latest_global_route_msg_ |
| Latest adaptively sampled non-enriched global route. | |
| std::vector< Eigen::Vector2d > | latest_reference_line_ |
| Latest complete dense reference line in the map frame. | |
| std::vector< size_t > | latest_lanelet_idx_by_reference_line_point_idx_ |
| Latest mapping between global route reference line and lanelet indices. | |
| std::vector< std::vector< int > > | latest_suggested_turn_signal_distance_ahead_by_route_element_by_lane_element_ |
| Latest suggested turn signal distance ahead by route element by lane element. | |
| std::string | ll2_map_server_name_ = "lanelet2_map_server" |
| Name of lanelet2_map_server node (parameter) | |
| double | publish_frequency_ = 10.0 |
| Frequency of route publication [Hz] (parameter) | |
| double | action_feedback_frequency_ = 1.0 |
| Frequency of action feedback publication [Hz] (parameter) | |
| double | publish_frequency_global_ = 1.0 |
| Frequency of global route publication [Hz] (parameter) | |
| double | sampling_distance_ = 1.0 |
| Distance between resampled points along route [m] (parameter) | |
| double | sampling_max_lateral_error_global_ = 0.5 |
| Maximum lateral error of the adaptively sampled global reference line [m] (parameter) | |
| bool | project_destination_to_reference_line_ = true |
| Whether to project destination to reference line (parameter) | |
| double | destination_distance_threshold_ = 1.0 |
| Distance to destination where destination is considered reached [m] (parameter) | |
| double | required_traveled_distance_proportion_ = 0.5 |
| Proportion of route length that must have been traveled before considering destination reached [0..1] (parameter) | |
| double | enrich_route_ahead_ego_distance_ = 100.0 |
| Distance ahead of ego position where global route is enriched with more information [m] (negative=unlimited) (parameter) | |
| double | enrich_route_behind_ego_distance_ = 10.0 |
| Distance behind ego position where global route is enriched with more information [m] (negative=unlimited) (parameter) | |
| double | route_undershoot_distance_ = 0.0 |
| Undershoot route by this distance before ego position [m] (parameter) | |
| double | route_overshoot_distance_ = 0.0 |
| Overshoot route by this distance behind destination [m] (parameter) | |
| double | max_drivable_space_radius_ = 50.0 |
| Maximum distance to left/right drivable space bounds, if not otherwise restricted [m] (parameter) | |
| int | max_num_threads_ = 0 |
| Maximum number of threads for parallel processing (0=max available) (parameter) | |
| double | transform_timeout_ = 0.02 |
| How long to wait for a transform to be available [s] (parameter) | |
| std::map< std::string, std::string > | health_kv_ |
| Health key-value pairs for diagnostic message. | |
| std::mutex | health_kv_mutex_ |
| Mutex protecting health key-value pairs across threads. | |
| rclcpp::Publisher< diagnostic_msgs::msg::DiagnosticArray >::SharedPtr | health_diagnostic_pub_ |
| Health diagnostic publisher. | |
| diagnostic_updater::Updater | diagnostic_updater_ |
| Diagnostic updater for monitoring topic frequencies and timestamps. | |
| std::unique_ptr< diagnostic_updater::TopicDiagnostic > | ego_data_diagnostic_ |
| Diagnostic to auto-diagnose ego data topic. | |
| std::unique_ptr< diagnostic_updater::HeaderlessTopicDiagnostic > | route_timer_diagnostic_ |
| Diagnostic to auto-diagnose route timer frequency. | |
| std::unique_ptr< diagnostic_updater::HeaderlessTopicDiagnostic > | global_route_timer_diagnostic_ |
| Diagnostic to auto-diagnose global route timer frequency. | |
| TopicDiagnosticConfig | ego_data_diagnostic_config_ = {45.45, 55.55, 0.0, 0.002} |
| Configuration for auto-diagnosed ego data topic. | |
| TopicDiagnosticConfig | route_timer_diagnostic_config_ = {18.18, 22.22} |
| Configuration for auto-diagnosed route timer. | |
| TopicDiagnosticConfig | global_route_timer_diagnostic_config_ = {0.91, 1.11} |
| Configuration for auto-diagnosed global route timer. | |
Lanelet2 route planning node.
Definition at line 64 of file lanelet2_route_planning.hpp.
| lanelet2_route_planning::Lanelet2RoutePlanning::Lanelet2RoutePlanning | ( | ) |
Constructor.
Definition at line 27 of file lanelet2_route_planning.cpp.
|
private |
Action execution: continually publishes route progress.
Periodically publishes route traveling progress. Checks for goal completion or cancellation.
| [in] | goal_handle | action goal handle |
Definition at line 512 of file lanelet2_route_planning.cpp.
|
private |
Action accepted callback: starts action execution.
Processes accepted action goal requests.
Initializes action feedback and starts action execution in a separate thread.
| [in] | goal_handle | action goal handle |
| goal_handle | action goal handle |
Definition at line 482 of file lanelet2_route_planning.cpp.
|
private |
Action cancel callback: cancels a running action.
Sets a flag to cancel action execution.
| [in] | goal_handle | action goal handle |
Definition at line 467 of file lanelet2_route_planning.cpp.
|
private |
Action goal callback: processes a route planning request.
Plans a global route to the destination before accepting the goal. Aborts any existing running action.
| [in] | uuid | unique goal identifier |
| [in] | goal | action goal |
Definition at line 425 of file lanelet2_route_planning.cpp.
|
private |
Builds an enriched ROS route message from the latest planned lanelet route.
The enriched route message is locally enriched around the ego position. The enriched part contains adjacent lanes, drivable space, and regulatory elements.
Definition at line 843 of file lanelet2_route_planning.cpp.
|
private |
Builds a global ROS route message from the latest planned lanelet route.
The global route message only contains a global reference line along a single lane of the shortest path of the route.
Definition at line 736 of file lanelet2_route_planning.cpp.
|
private |
Builds the lanelet2 routing graph based on the current map.
Definition at line 295 of file lanelet2_route_planning.cpp.
|
private |
Checks if map is loaded and handles map updates.
| [in] | handle_update | whether to handle map update |
Definition at line 222 of file lanelet2_route_planning.cpp.
|
private |
Declares and loads a ROS parameter.
| [in] | name | name |
| [in] | param | parameter variable to load into |
| [in] | description | description |
| [in] | add_to_auto_reconfigurable_params | enable reconfiguration of parameter |
| [in] | is_required | whether failure to load parameter will stop node |
| [in] | read_only | set parameter to read-only |
| [in] | from_value | parameter range minimum |
| [in] | to_value | parameter range maximum |
| [in] | step_value | parameter range step |
| [in] | additional_constraints | additional constraints description |
Definition at line 108 of file lanelet2_route_planning.cpp.
|
private |
Callback for EgoData.
Recomputes the local route if the node is currently publishing a route.
| [in] | msg |
Definition at line 320 of file lanelet2_route_planning.cpp.
|
private |
Callback to periodically publish the adaptively sampled global route.
Definition at line 406 of file lanelet2_route_planning.cpp.
|
private |
Handles reconfiguration when a parameter value is changed.
| [in] | parameters | parameters |
Definition at line 180 of file lanelet2_route_planning.cpp.
|
private |
Plans a lanelet route to the destination.
Planned lanelet route is stored in latest_route_.
| [in] | destination | destination |
Definition at line 578 of file lanelet2_route_planning.cpp.
|
private |
Publishes health diagnostic.
| status | status code |
| msg | status message |
| now | current time for stamping |
Definition at line 1044 of file lanelet2_route_planning.cpp.
|
private |
Callback to periodically publish the route.
Definition at line 359 of file lanelet2_route_planning.cpp.
|
private |
Sets up subscribers, publishers, etc. to configure the node.
Definition at line 238 of file lanelet2_route_planning.cpp.
|
private |
Callback group for action server.
Definition at line 280 of file lanelet2_route_planning.hpp.
|
private |
Latest action feedback.
Definition at line 265 of file lanelet2_route_planning.hpp.
|
private |
Frequency of action feedback publication [Hz] (parameter)
Definition at line 398 of file lanelet2_route_planning.hpp.
|
private |
Latest action goal handle.
Definition at line 275 of file lanelet2_route_planning.hpp.
|
private |
Latest action result.
Definition at line 270 of file lanelet2_route_planning.hpp.
|
private |
Action server.
Definition at line 260 of file lanelet2_route_planning.hpp.
|
private |
Latest action start time to compute action duration.
Definition at line 285 of file lanelet2_route_planning.hpp.
|
private |
Auto-reconfigurable parameters for dynamic reconfiguration.
Definition at line 225 of file lanelet2_route_planning.hpp.
|
private |
Destination point in map frame.
This is affected by project_destination_to_reference_line_.
Definition at line 324 of file lanelet2_route_planning.hpp.
|
private |
Distance to destination where destination is considered reached [m] (parameter)
Definition at line 423 of file lanelet2_route_planning.hpp.
|
private |
Diagnostic updater for monitoring topic frequencies and timestamps.
Definition at line 483 of file lanelet2_route_planning.hpp.
|
private |
Diagnostic to auto-diagnose ego data topic.
Definition at line 488 of file lanelet2_route_planning.hpp.
|
private |
Configuration for auto-diagnosed ego data topic.
Definition at line 503 of file lanelet2_route_planning.hpp.
|
private |
Distance ahead of ego position where global route is enriched with more information [m] (negative=unlimited) (parameter)
Definition at line 433 of file lanelet2_route_planning.hpp.
|
private |
Distance behind ego position where global route is enriched with more information [m] (negative=unlimited) (parameter)
Definition at line 438 of file lanelet2_route_planning.hpp.
|
private |
Timer for publishing the global route.
Definition at line 255 of file lanelet2_route_planning.hpp.
|
private |
Diagnostic to auto-diagnose global route timer frequency.
Definition at line 498 of file lanelet2_route_planning.hpp.
|
private |
Configuration for auto-diagnosed global route timer.
Definition at line 513 of file lanelet2_route_planning.hpp.
|
private |
Flag indicating that route has been enriched at least once.
Useful because the initial non-enriched global route is invalid as traveled and remaining route are not yet split.
Definition at line 344 of file lanelet2_route_planning.hpp.
|
private |
Health diagnostic publisher.
Definition at line 478 of file lanelet2_route_planning.hpp.
|
private |
Health key-value pairs for diagnostic message.
Definition at line 468 of file lanelet2_route_planning.hpp.
|
mutableprivate |
Mutex protecting health key-value pairs across threads.
Definition at line 473 of file lanelet2_route_planning.hpp.
|
private |
Intermediate points in map frame.
Used for route planning with intermediate waypoints. These are affected by project_destination_to_reference_line_.
Definition at line 332 of file lanelet2_route_planning.hpp.
|
private |
Controlling flag for route publication.
Definition at line 349 of file lanelet2_route_planning.hpp.
|
private |
Latest ego data in map frame.
Definition at line 300 of file lanelet2_route_planning.hpp.
|
private |
Latest complete minimal route used internally for progress tracking.
Definition at line 359 of file lanelet2_route_planning.hpp.
|
private |
Latest adaptively sampled non-enriched global route.
Definition at line 362 of file lanelet2_route_planning.hpp.
|
private |
Latest mapping between global route reference line and lanelet indices.
Used to easily find lanelet for a given point on the global reference line. Indexes into latest_route_.shortestPath().
Definition at line 375 of file lanelet2_route_planning.hpp.
|
private |
Latest complete dense reference line in the map frame.
Definition at line 367 of file lanelet2_route_planning.hpp.
|
private |
Latest planned lanelet route.
Definition at line 337 of file lanelet2_route_planning.hpp.
|
private |
Latest route message to publish.
Definition at line 354 of file lanelet2_route_planning.hpp.
|
private |
Latest suggested turn signal distance ahead by route element by lane element.
Used to store the suggested turn signal distances ahead for each lane element, which can only be propagated to preceding lane elements during postprocessing.
Definition at line 383 of file lanelet2_route_planning.hpp.
|
private |
Lanelet2 map interface.
Definition at line 305 of file lanelet2_route_planning.hpp.
|
private |
Name of lanelet2_map_server node (parameter)
Definition at line 388 of file lanelet2_route_planning.hpp.
|
private |
Maximum distance to left/right drivable space bounds, if not otherwise restricted [m] (parameter)
Definition at line 453 of file lanelet2_route_planning.hpp.
|
private |
Maximum number of threads for parallel processing (0=max available) (parameter)
Definition at line 458 of file lanelet2_route_planning.hpp.
|
private |
Callback handle for dynamic parameter reconfiguration.
Definition at line 230 of file lanelet2_route_planning.hpp.
|
private |
Whether to project destination to reference line (parameter)
Definition at line 418 of file lanelet2_route_planning.hpp.
|
private |
Frequency of route publication [Hz] (parameter)
Definition at line 393 of file lanelet2_route_planning.hpp.
|
private |
Frequency of global route publication [Hz] (parameter)
Definition at line 403 of file lanelet2_route_planning.hpp.
|
private |
Timer for publishing the enriched route.
Definition at line 250 of file lanelet2_route_planning.hpp.
|
private |
Publisher for the adaptively sampled global route.
Definition at line 245 of file lanelet2_route_planning.hpp.
|
private |
Publisher for enriched route.
Definition at line 240 of file lanelet2_route_planning.hpp.
|
private |
Proportion of route length that must have been traveled before considering destination reached [0..1] (parameter)
Definition at line 428 of file lanelet2_route_planning.hpp.
|
private |
Overshoot route by this distance behind destination [m] (parameter)
Definition at line 448 of file lanelet2_route_planning.hpp.
|
private |
Diagnostic to auto-diagnose route timer frequency.
Definition at line 493 of file lanelet2_route_planning.hpp.
|
private |
Configuration for auto-diagnosed route timer.
Definition at line 508 of file lanelet2_route_planning.hpp.
|
private |
Undershoot route by this distance before ego position [m] (parameter)
Definition at line 443 of file lanelet2_route_planning.hpp.
|
private |
Lanelet routing graph for current map.
Definition at line 310 of file lanelet2_route_planning.hpp.
|
private |
Distance between resampled points along route [m] (parameter)
Definition at line 408 of file lanelet2_route_planning.hpp.
|
private |
Maximum lateral error of the adaptively sampled global reference line [m] (parameter)
Definition at line 413 of file lanelet2_route_planning.hpp.
|
private |
Starting point in map frame.
This is affected by project_destination_to_reference_line_.
Definition at line 317 of file lanelet2_route_planning.hpp.
|
private |
Subscriber for ego data.
Definition at line 235 of file lanelet2_route_planning.hpp.
|
private |
Transform buffer.
Definition at line 290 of file lanelet2_route_planning.hpp.
|
private |
Transform listener.
Definition at line 295 of file lanelet2_route_planning.hpp.
|
private |
How long to wait for a transform to be available [s] (parameter)
Definition at line 463 of file lanelet2_route_planning.hpp.