15 #include "nav2_mppi_controller/critics/twirling_critic.hpp"
17 namespace mppi::critics
24 getParam(power_,
"cost_power", 1);
25 getParam(weight_,
"cost_weight", 10.0f);
28 logger_,
"TwirlingCritic instantiated with %d power and %f weight.", power_, weight_);
33 using xt::evaluation_strategy::immediate;
35 utils::withinPositionGoalTolerance(data.goal_checker, data.state.pose.pose, data.goal))
41 data.costs += xt::pow(xt::mean(xt::fabs(data.state.wz), {1}, immediate) * weight_, power_);
43 data.costs += xt::mean(xt::fabs(data.state.wz), {1}, immediate) * weight_;
49 #include <pluginlib/class_list_macros.hpp>
51 PLUGINLIB_EXPORT_CLASS(
auto getParamGetter(const std::string &ns)
Get an object to retreive parameters.
Abstract critic objective function to score trajectories.
void initialize() override
Initialize critic.
void score(CriticData &data) override
Evaluate cost related to robot orientation at goal pose (considered only if robot near last goal in c...
Data to pass to critics for scoring, including state, trajectories, pruned path, global goal,...