Nav2 Navigation Stack - lyrical  lyrical
ROS 2 Navigation Stack
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mppi::CriticManager Class Reference

Manager of objective function plugins for scoring trajectories. More...

#include <nav2_mppi_controller/include/nav2_mppi_controller/critic_manager.hpp>

Collaboration diagram for mppi::CriticManager:
Collaboration graph
[legend]

Public Types

typedef std::vector< std::unique_ptr< critics::CriticFunction > > Critics
 

Public Member Functions

 CriticManager ()=default
 Constructor for mppi::CriticManager.
 
virtual ~CriticManager ()=default
 Virtual Destructor for mppi::CriticManager.
 
void on_configure (nav2::LifecycleNode::WeakPtr parent, const std::string &name, std::shared_ptr< nav2_costmap_2d::Costmap2DROS >, ParametersHandler *)
 Configure critic manager on bringup and load plugins. More...
 
void evalTrajectoriesScores (CriticData &data)
 Score trajectories by the set of loaded critic functions. More...
 
const std::vector< std::pair< std::string, Eigen::ArrayXf > > & getCriticCosts () const
 Get stored per-critic costs from last evaluation. More...
 

Protected Member Functions

void getParams ()
 Get parameters (critics to load)
 
virtual void loadCritics ()
 Load the critic plugins.
 
std::string getFullName (const std::string &name)
 Get full-name namespaced critic IDs.
 

Protected Attributes

nav2::LifecycleNode::WeakPtr parent_
 
std::shared_ptr< nav2_costmap_2d::Costmap2DROScostmap_ros_
 
std::string name_
 
ParametersHandlerparameters_handler_
 
std::vector< std::string > critic_names_
 
std::unique_ptr< pluginlib::ClassLoader< critics::CriticFunction > > loader_
 
Critics critics_
 
nav2::Publisher< nav2_msgs::msg::CriticsStats >::SharedPtr critics_effect_pub_
 
bool visualize_
 
std::vector< std::pair< std::string, Eigen::ArrayXf > > critic_costs_
 
rclcpp::Clock::SharedPtr clock_
 
rclcpp::Logger logger_ {rclcpp::get_logger("MPPIController")}
 

Detailed Description

Manager of objective function plugins for scoring trajectories.

Definition at line 43 of file critic_manager.hpp.

Member Function Documentation

◆ evalTrajectoriesScores()

void mppi::CriticManager::evalTrajectoriesScores ( CriticData data)

Score trajectories by the set of loaded critic functions.

Parameters
CriticDataStruct of necessary information to pass to the critic functions

Definition at line 76 of file critic_manager.cpp.

Referenced by mppi::Optimizer::optimize().

Here is the caller graph for this function:

◆ getCriticCosts()

const std::vector<std::pair<std::string, Eigen::ArrayXf> >& mppi::CriticManager::getCriticCosts ( ) const
inline

Get stored per-critic costs from last evaluation.

Returns
Vector of (critic_name, cost_array) pairs

Definition at line 79 of file critic_manager.hpp.

Referenced by mppi::Optimizer::getCriticCosts().

Here is the caller graph for this function:

◆ on_configure()

void mppi::CriticManager::on_configure ( nav2::LifecycleNode::WeakPtr  parent,
const std::string &  name,
std::shared_ptr< nav2_costmap_2d::Costmap2DROS costmap_ros,
ParametersHandler param_handler 
)

Configure critic manager on bringup and load plugins.

Parameters
parentWeakPtr to node
nameName of plugin
costmap_rosCostmap2DROS object of environment
dynamic_parameter_handlerParameter handler object

Definition at line 20 of file critic_manager.cpp.

References getParams(), and loadCritics().

Referenced by mppi::Optimizer::initialize().

Here is the call graph for this function:
Here is the caller graph for this function:

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