15 #ifndef NAV2_MPPI_CONTROLLER__CRITICS__PATH_ANGLE_CRITIC_HPP_
16 #define NAV2_MPPI_CONTROLLER__CRITICS__PATH_ANGLE_CRITIC_HPP_
19 #include "nav2_mppi_controller/critic_function.hpp"
20 #include "nav2_mppi_controller/models/state.hpp"
21 #include "nav2_mppi_controller/tools/utils.hpp"
22 #include "nav2_core/controller_exceptions.hpp"
24 namespace mppi::critics
30 enum class PathAngleMode
32 FORWARD_PREFERENCE = 0,
33 NO_DIRECTIONAL_PREFERENCE = 1,
34 CONSIDER_FEASIBLE_PATH_ORIENTATIONS = 2
40 std::string modeToStr(
const PathAngleMode & mode)
42 if (mode == PathAngleMode::FORWARD_PREFERENCE) {
43 return "Forward Preference";
44 }
else if (mode == PathAngleMode::CONSIDER_FEASIBLE_PATH_ORIENTATIONS) {
45 return "Consider Feasible Path Orientations";
46 }
else if (mode == PathAngleMode::NO_DIRECTIONAL_PREFERENCE) {
47 return "No Directional Preference";
49 return "Invalid mode!";
75 float max_angle_to_furthest_{0};
76 float threshold_to_consider_{0};
78 size_t offset_from_furthest_{0};
79 bool reversing_allowed_{
true};
80 PathAngleMode mode_{0};
82 unsigned int power_{0};
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,...