Nav2 Navigation Stack - humble
humble
ROS 2 Navigation Stack
|
This class hosts variety of plugins of different algorithms to smooth or refine a path from the exposed SmoothPath action server. More...
#include <nav2_smoother/include/nav2_smoother/nav2_smoother.hpp>
Public Types | |
using | SmootherMap = std::unordered_map< std::string, nav2_core::Smoother::Ptr > |
Public Member Functions | |
SmootherServer (const rclcpp::NodeOptions &options=rclcpp::NodeOptions()) | |
A constructor for nav2_smoother::SmootherServer. More... | |
~SmootherServer () | |
Destructor for nav2_smoother::SmootherServer. | |
![]() | |
LifecycleNode (const std::string &node_name, const std::string &ns="", const rclcpp::NodeOptions &options=rclcpp::NodeOptions()) | |
A lifecycle node constructor. More... | |
void | add_parameter (const std::string &name, const rclcpp::ParameterValue &default_value, const std::string &description="", const std::string &additional_constraints="", bool read_only=false) |
Declare a parameter that has no integer or floating point range constraints. More... | |
void | add_parameter (const std::string &name, const rclcpp::ParameterValue &default_value, const floating_point_range fp_range, const std::string &description="", const std::string &additional_constraints="", bool read_only=false) |
Declare a parameter that has a floating point range constraint. More... | |
void | add_parameter (const std::string &name, const rclcpp::ParameterValue &default_value, const integer_range int_range, const std::string &description="", const std::string &additional_constraints="", bool read_only=false) |
Declare a parameter that has an integer range constraint. More... | |
std::shared_ptr< nav2_util::LifecycleNode > | shared_from_this () |
Get a shared pointer of this. | |
nav2_util::CallbackReturn | on_error (const rclcpp_lifecycle::State &) |
Abstracted on_error state transition callback, since unimplemented as of 2020 in the managed ROS2 node state machine. More... | |
virtual void | on_rcl_preshutdown () |
Perform preshutdown activities before our Context is shutdown. Note that this is related to our Context's shutdown sequence, not the lifecycle node state machine. | |
void | createBond () |
Create bond connection to lifecycle manager. | |
void | destroyBond () |
Destroy bond connection to lifecycle manager. | |
Protected Types | |
using | Action = nav2_msgs::action::SmoothPath |
using | ActionServer = nav2_util::SimpleActionServer< Action > |
Protected Member Functions | |
nav2_util::CallbackReturn | on_configure (const rclcpp_lifecycle::State &state) override |
Configures smoother parameters and member variables. More... | |
bool | loadSmootherPlugins () |
Loads smoother plugins from parameter file. More... | |
nav2_util::CallbackReturn | on_activate (const rclcpp_lifecycle::State &state) override |
Activates member variables. More... | |
nav2_util::CallbackReturn | on_deactivate (const rclcpp_lifecycle::State &state) override |
Deactivates member variables. More... | |
nav2_util::CallbackReturn | on_cleanup (const rclcpp_lifecycle::State &state) override |
Calls clean up states and resets member variables. More... | |
nav2_util::CallbackReturn | on_shutdown (const rclcpp_lifecycle::State &state) override |
Called when in Shutdown state. More... | |
void | smoothPlan () |
SmoothPath action server callback. Handles action server updates and spins server until goal is reached. More... | |
bool | findSmootherId (const std::string &c_name, std::string &name) |
Find the valid smoother ID name for the given request. More... | |
![]() | |
void | printLifecycleNodeNotification () |
Print notifications for lifecycle node. | |
void | register_rcl_preshutdown_callback () |
void | runCleanups () |
Protected Attributes | |
std::unique_ptr< ActionServer > | action_server_ |
std::shared_ptr< tf2_ros::Buffer > | tf_ |
std::shared_ptr< tf2_ros::TransformListener > | transform_listener_ |
rclcpp_lifecycle::LifecyclePublisher< nav_msgs::msg::Path >::SharedPtr | plan_publisher_ |
pluginlib::ClassLoader< nav2_core::Smoother > | lp_loader_ |
SmootherMap | smoothers_ |
std::vector< std::string > | default_ids_ |
std::vector< std::string > | default_types_ |
std::vector< std::string > | smoother_ids_ |
std::vector< std::string > | smoother_types_ |
std::string | smoother_ids_concat_ |
std::string | current_smoother_ |
std::shared_ptr< nav2_costmap_2d::CostmapSubscriber > | costmap_sub_ |
std::shared_ptr< nav2_costmap_2d::FootprintSubscriber > | footprint_sub_ |
std::shared_ptr< nav2_costmap_2d::CostmapTopicCollisionChecker > | collision_checker_ |
![]() | |
std::unique_ptr< rclcpp::PreShutdownCallbackHandle > | rcl_preshutdown_cb_handle_ {nullptr} |
std::unique_ptr< bond::Bond > | bond_ {nullptr} |
This class hosts variety of plugins of different algorithms to smooth or refine a path from the exposed SmoothPath action server.
Definition at line 45 of file nav2_smoother.hpp.
|
explicit |
A constructor for nav2_smoother::SmootherServer.
options | Additional options to control creation of the node. |
Definition at line 37 of file nav2_smoother.cpp.
|
protected |
Find the valid smoother ID name for the given request.
c_name | The requested smoother name |
name | Reference to the name to use for control if any valid available |
Definition at line 226 of file nav2_smoother.cpp.
Referenced by smoothPlan().
|
protected |
Loads smoother plugins from parameter file.
Definition at line 121 of file nav2_smoother.cpp.
References nav2_util::LifecycleNode::shared_from_this().
Referenced by on_configure().
|
overrideprotected |
Activates member variables.
Activates smoother, costmap, velocity publisher and smooth path action server
state | LifeCycle Node's state |
Definition at line 160 of file nav2_smoother.cpp.
References nav2_util::LifecycleNode::createBond().
|
overrideprotected |
Calls clean up states and resets member variables.
Smoother and costmap clean up state is called, and resets rest of the variables
state | LifeCycle Node's state |
Definition at line 196 of file nav2_smoother.cpp.
|
overrideprotected |
Configures smoother parameters and member variables.
Configures smoother plugin and costmap; Initialize odom subscriber, velocity publisher and smooth path action server.
state | LifeCycle Node's state |
pluginlib::PluginlibException | When failed to initialize smoother plugin |
Definition at line 66 of file nav2_smoother.cpp.
References loadSmootherPlugins(), nav2_util::LifecycleNode::shared_from_this(), and smoothPlan().
|
overrideprotected |
Deactivates member variables.
Deactivates smooth path action server, smoother, costmap and velocity publisher. Before calling deactivate state, velocity is being set to zero.
state | LifeCycle Node's state |
Definition at line 178 of file nav2_smoother.cpp.
References nav2_util::LifecycleNode::destroyBond().
|
overrideprotected |
Called when in Shutdown state.
state | LifeCycle Node's state |
Definition at line 220 of file nav2_smoother.cpp.
|
protected |
SmoothPath action server callback. Handles action server updates and spins server until goal is reached.
Provides global path to smoother received from action client. Local section of the path is optimized using smoother.
nav2_core::PlannerException |
Definition at line 255 of file nav2_smoother.cpp.
References findSmootherId().
Referenced by on_configure().