|
lanelet2_route_planning v2.0.0
|
Action client node for planning a route. More...
#include <plan_route_action_client.hpp>
Public Member Functions | |
| PlanRouteActionClient () | |
| Constructor. | |
Private Types | |
| using | PlanRoute = route_planning_msgs::action::PlanRoute |
| using | GoalHandlePlanRoute = rclcpp_action::ClientGoalHandle<PlanRoute> |
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. | |
| void | goalPoseCallback (const geometry_msgs::msg::PoseStamped::SharedPtr msg) |
| Callback for goal pose (most likely received from RViz) | |
| void | autoPlanningTimerCallback () |
| Callback for automatically planning a route, e.g., if waypoints are given. | |
| void | planToNextWaypoint () |
| Plans to next waypoint. | |
| void | planToRandomDestination () |
| Plans to a random destination. | |
| void | sendGoal (const geometry_msgs::msg::PoseStamped::SharedPtr msg, const std::vector< geometry_msgs::msg::PointStamped > &intermediate_destinations={}) |
| Sends a goal to the action server. | |
| void | goalResponseCallback (const GoalHandlePlanRoute::SharedPtr &goal_handle) |
| Callback for goal response from the action server. | |
| void | feedbackCallback (GoalHandlePlanRoute::SharedPtr goal_handle, const std::shared_ptr< const PlanRoute::Feedback > feedback) |
| Callback for feedback from the action server. | |
| void | resultCallback (const GoalHandlePlanRoute::WrappedResult &result) |
| Callback for result from the action server. | |
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< geometry_msgs::msg::PoseStamped >::SharedPtr | goal_pose_subscriber_ |
| Subscriber for goal pose. | |
| rclcpp_action::Client< PlanRoute >::SharedPtr | action_client_ |
| Action client. | |
| std::shared_future< GoalHandlePlanRoute::SharedPtr > | goal_handle_future_ |
| Goal handle. | |
| rclcpp::TimerBase::SharedPtr | auto_planning_timer_ |
| Timer to automatically plan route, e.g., if waypoints are given. | |
| std::unique_ptr< Lanelet2MapInterface > | ll2_interface_ |
| Lanelet2 map interface. | |
| std::vector< std::pair< double, double > > | waypoints_ |
| WGS84 waypoints to endlessly follow. | |
| std::vector< double > | waypoint_wait_times_ |
| Wait time for each waypoint [s]; negative values mark intermediate destinations. | |
| size_t | next_waypoint_idx_ = 0 |
| Index of next waypoint to follow. | |
| bool | has_active_waypoint_ = false |
| Whether the active goal belongs to the waypoint list. | |
| double | active_waypoint_wait_time_s_ = 0.0 |
| Wait time of the active waypoint [s]. | |
| double | auto_planning_resume_time_s_ = 0.0 |
| Earliest wall-clock time at which automatic planning may continue. | |
| bool | has_completed_one_goal_ = false |
| Whether one goal has been completed (succeeded or failed) | |
| std::string | ll2_map_server_name_ = "ll2_map_server" |
| Name of lanelet2_map_server node (parameter) | |
| std::vector< std::string > | waypoints_param_ |
| WGS84 waypoints to endlessly follow (parameter) | |
| bool | enable_random_destination_ = false |
| Whether to plan a route to a random destination (parameter) | |
| bool | enable_continuous_planning_ = false |
| Whether to continuously plan a new route (parameter) | |
| bool | cancel_route_ = false |
| Flag to cancel the route planning action (parameter) | |
Action client node for planning a route.
Definition at line 33 of file plan_route_action_client.hpp.
|
private |
Definition at line 35 of file plan_route_action_client.hpp.
|
private |
Definition at line 34 of file plan_route_action_client.hpp.
| plan_route_action_client::PlanRouteActionClient::PlanRouteActionClient | ( | ) |
Constructor.
Definition at line 67 of file plan_route_action_client.cpp.
|
private |
Callback for automatically planning a route, e.g., if waypoints are given.
Does nothing, if no waypoints are given and random planning is disabled. Precedence: random planning, waypoints
Definition at line 243 of file plan_route_action_client.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 85 of file plan_route_action_client.cpp.
|
private |
Callback for feedback from the action server.
| [in] | goal_handle | goal handle |
| [in] | feedback | action feedback |
Definition at line 429 of file plan_route_action_client.cpp.
|
private |
Callback for goal pose (most likely received from RViz)
| [in] | msg | goal pose |
Definition at line 234 of file plan_route_action_client.cpp.
|
private |
Callback for goal response from the action server.
| [in] | goal_handle | goal handle |
Definition at line 419 of file plan_route_action_client.cpp.
|
private |
Handles reconfiguration when a parameter value is changed.
| [in] | parameters | parameters |
Definition at line 155 of file plan_route_action_client.cpp.
|
private |
Plans to next waypoint.
Definition at line 263 of file plan_route_action_client.cpp.
|
private |
Plans to a random destination.
Definition at line 341 of file plan_route_action_client.cpp.
|
private |
Callback for result from the action server.
| [in] | result | action result |
Definition at line 442 of file plan_route_action_client.cpp.
|
private |
Sends a goal to the action server.
| [in] | msg | goal pose |
| [in] | intermediate_destinations | intermediate destinations to route via |
Definition at line 389 of file plan_route_action_client.cpp.
|
private |
Sets up subscribers, publishers, etc. to configure the node.
Definition at line 200 of file plan_route_action_client.cpp.
|
private |
Action client.
Definition at line 157 of file plan_route_action_client.hpp.
|
private |
Wait time of the active waypoint [s].
Definition at line 197 of file plan_route_action_client.hpp.
|
private |
Earliest wall-clock time at which automatic planning may continue.
Definition at line 202 of file plan_route_action_client.hpp.
|
private |
Timer to automatically plan route, e.g., if waypoints are given.
Definition at line 167 of file plan_route_action_client.hpp.
|
private |
Auto-reconfigurable parameters for dynamic reconfiguration.
Definition at line 142 of file plan_route_action_client.hpp.
|
private |
Flag to cancel the route planning action (parameter)
Definition at line 236 of file plan_route_action_client.hpp.
|
private |
Whether to continuously plan a new route (parameter)
Either to the next waypoint or to a random destination, if enabled
Definition at line 231 of file plan_route_action_client.hpp.
|
private |
Whether to plan a route to a random destination (parameter)
Definition at line 224 of file plan_route_action_client.hpp.
|
private |
Goal handle.
Definition at line 162 of file plan_route_action_client.hpp.
|
private |
Subscriber for goal pose.
Definition at line 152 of file plan_route_action_client.hpp.
|
private |
Whether the active goal belongs to the waypoint list.
Definition at line 192 of file plan_route_action_client.hpp.
|
private |
Whether one goal has been completed (succeeded or failed)
Definition at line 207 of file plan_route_action_client.hpp.
|
private |
Lanelet2 map interface.
Definition at line 172 of file plan_route_action_client.hpp.
|
private |
Name of lanelet2_map_server node (parameter)
Definition at line 212 of file plan_route_action_client.hpp.
|
private |
Index of next waypoint to follow.
Definition at line 187 of file plan_route_action_client.hpp.
|
private |
Callback handle for dynamic parameter reconfiguration.
Definition at line 147 of file plan_route_action_client.hpp.
|
private |
Wait time for each waypoint [s]; negative values mark intermediate destinations.
Definition at line 182 of file plan_route_action_client.hpp.
|
private |
WGS84 waypoints to endlessly follow.
Definition at line 177 of file plan_route_action_client.hpp.
|
private |
WGS84 waypoints to endlessly follow (parameter)
list of strings with comma-separated '<LATITUDE>,<LONGITUDE>[,<WAIT_TIME_S>]'
Definition at line 219 of file plan_route_action_client.hpp.