Nav2 Navigation Stack - lyrical  lyrical
ROS 2 Navigation Stack
smoother.hpp
1 // Copyright (c) 2021 RoboTech Vision
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 NAV2_CORE__SMOOTHER_HPP_
16 #define NAV2_CORE__SMOOTHER_HPP_
17 
18 #include <memory>
19 #include <string>
20 
21 #include "nav2_costmap_2d/costmap_subscriber.hpp"
22 #include "nav2_costmap_2d/footprint_subscriber.hpp"
23 #include "nav2_ros_common/tf2_factories.hpp"
24 #include "nav2_ros_common/lifecycle_node.hpp"
25 #include "pluginlib/class_loader.hpp"
26 #include "nav_msgs/msg/path.hpp"
27 
28 
29 namespace nav2_core
30 {
31 
36 class Smoother
37 {
38 public:
39  using Ptr = std::shared_ptr<nav2_core::Smoother>;
40 
44  virtual ~Smoother() {}
45 
46  virtual void configure(
47  const nav2::LifecycleNode::WeakPtr &,
48  std::string name, nav2::TransformBuffer::SharedPtr,
49  std::shared_ptr<nav2_costmap_2d::CostmapSubscriber>,
50  std::shared_ptr<nav2_costmap_2d::FootprintSubscriber>) = 0;
51 
55  virtual void cleanup() = 0;
56 
60  virtual void activate() = 0;
61 
65  virtual void deactivate() = 0;
66 
74  virtual bool smooth(
75  nav_msgs::msg::Path & path,
76  const rclcpp::Duration & max_time) = 0;
77 };
78 
79 } // namespace nav2_core
80 
81 #endif // NAV2_CORE__SMOOTHER_HPP_
smoother interface that acts as a virtual base class for all smoother plugins
Definition: smoother.hpp:37
virtual void deactivate()=0
Method to deactivate smoother and any threads involved in execution.
virtual void activate()=0
Method to activate smoother and any threads involved in execution.
virtual void cleanup()=0
Method to cleanup resources.
virtual ~Smoother()
Virtual destructor.
Definition: smoother.hpp:44
virtual bool smooth(nav_msgs::msg::Path &path, const rclcpp::Duration &max_time)=0
Method to smooth given path.