Nav2 Navigation Stack - kilted  kilted
ROS 2 Navigation Stack
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
nav2_smoother::SimpleSmoother Class Reference

A path smoother implementation. More...

#include <nav2_smoother/include/nav2_smoother/simple_smoother.hpp>

Inheritance diagram for nav2_smoother::SimpleSmoother:
Inheritance graph
[legend]
Collaboration diagram for nav2_smoother::SimpleSmoother:
Collaboration graph
[legend]

Public Member Functions

 SimpleSmoother ()=default
 A constructor for nav2_smoother::SimpleSmoother.
 
 ~SimpleSmoother () override=default
 A destructor for nav2_smoother::SimpleSmoother.
 
void configure (const rclcpp_lifecycle::LifecycleNode::WeakPtr &, std::string name, std::shared_ptr< tf2_ros::Buffer >, std::shared_ptr< nav2_costmap_2d::CostmapSubscriber >, std::shared_ptr< nav2_costmap_2d::FootprintSubscriber >) override
 
void cleanup () override
 Method to cleanup resources.
 
void activate () override
 Method to activate smoother and any threads involved in execution.
 
void deactivate () override
 Method to deactivate smoother and any threads involved in execution.
 
bool smooth (nav_msgs::msg::Path &path, const rclcpp::Duration &max_time) override
 Method to smooth given path. More...
 
- Public Member Functions inherited from nav2_core::Smoother
virtual ~Smoother ()
 Virtual destructor.
 

Protected Member Functions

void smoothImpl (nav_msgs::msg::Path &path, bool &reversing_segment, const nav2_costmap_2d::Costmap2D *costmap, const double &max_time)
 Smoother method - does the smoothing on a segment. More...
 
double getFieldByDim (const geometry_msgs::msg::PoseStamped &msg, const unsigned int &dim)
 Get the field value for a given dimension. More...
 
void setFieldByDim (geometry_msgs::msg::PoseStamped &msg, const unsigned int dim, const double &value)
 Set the field value for a given dimension. More...
 

Protected Attributes

double tolerance_
 
double data_w_
 
double smooth_w_
 
int max_its_
 
int refinement_ctr_
 
int refinement_num_
 
bool do_refinement_
 
bool enforce_path_inversion_
 
std::shared_ptr< nav2_costmap_2d::CostmapSubscribercostmap_sub_
 
rclcpp::Logger logger_ {rclcpp::get_logger("SimpleSmoother")}
 

Additional Inherited Members

- Public Types inherited from nav2_core::Smoother
using Ptr = std::shared_ptr< nav2_core::Smoother >
 

Detailed Description

A path smoother implementation.

Definition at line 43 of file simple_smoother.hpp.

Member Function Documentation

◆ getFieldByDim()

double nav2_smoother::SimpleSmoother::getFieldByDim ( const geometry_msgs::msg::PoseStamped &  msg,
const unsigned int &  dim 
)
inlineprotected

Get the field value for a given dimension.

Parameters
msgCurrent pose to sample
dimDimension ID of interest
Returns
dim value

Definition at line 205 of file simple_smoother.cpp.

◆ setFieldByDim()

void nav2_smoother::SimpleSmoother::setFieldByDim ( geometry_msgs::msg::PoseStamped &  msg,
const unsigned int  dim,
const double &  value 
)
inlineprotected

Set the field value for a given dimension.

Parameters
msgCurrent pose to sample
dimDimension ID of interest
valueto set the dimension to for the pose

Definition at line 217 of file simple_smoother.cpp.

◆ smooth()

bool nav2_smoother::SimpleSmoother::smooth ( nav_msgs::msg::Path &  path,
const rclcpp::Duration &  max_time 
)
overridevirtual

Method to smooth given path.

Parameters
pathIn-out path to be smoothed
max_timeMaximum duration smoothing should take
Returns
If smoothing was completed (true) or interrupted by time limit (false)

Implements nav2_core::Smoother.

Definition at line 62 of file simple_smoother.cpp.

◆ smoothImpl()

void nav2_smoother::SimpleSmoother::smoothImpl ( nav_msgs::msg::Path &  path,
bool &  reversing_segment,
const nav2_costmap_2d::Costmap2D costmap,
const double &  max_time 
)
protected

Smoother method - does the smoothing on a segment.

Parameters
pathReference to path
reversing_segmentReturn if this is a reversing segment
costmapPointer to minimal costmap
max_timeMaximum time to compute, stop early if over limit

Definition at line 112 of file simple_smoother.cpp.

References nav2_costmap_2d::Costmap2D::getCost(), and nav2_costmap_2d::Costmap2D::worldToMap().

Here is the call graph for this function:

The documentation for this class was generated from the following files: