15 #include "nav2_mppi_controller/critics/goal_angle_critic.hpp"
17 namespace mppi::critics
24 getParam(power_,
"cost_power", 1);
25 getParam(weight_,
"cost_weight", 3.0);
27 getParam(threshold_to_consider_,
"threshold_to_consider", 0.5);
31 "GoalAngleCritic instantiated with %d power, %f weight, and %f "
33 power_, weight_, threshold_to_consider_);
38 if (!enabled_ || !utils::withinPositionGoalTolerance(
39 threshold_to_consider_, data.state.pose.pose, data.goal))
44 const auto goal_idx = data.path.x.shape(0) - 1;
45 const float goal_yaw = data.path.yaws(goal_idx);
47 data.costs += xt::pow(
48 xt::mean(xt::abs(utils::shortest_angular_distance(data.trajectories.yaws, goal_yaw)), {1}) *
54 #include <pluginlib/class_list_macros.hpp>
56 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,...