Nav2 Navigation Stack - rolling  main
ROS 2 Navigation Stack
goal_critic.hpp
1 // Copyright (c) 2022 Samsung Research America, @artofnothingness Alexey Budyakov
2 // Copyright (c) 2023 Open Navigation LLC
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef NAV2_MPPI_CONTROLLER__CRITICS__GOAL_CRITIC_HPP_
17 #define NAV2_MPPI_CONTROLLER__CRITICS__GOAL_CRITIC_HPP_
18 
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 
23 namespace mppi::critics
24 {
25 
30 class GoalCritic : public CriticFunction
31 {
32 public:
36  void initialize() override;
37 
43  void score(CriticData & data) override;
44 
45 protected:
46  unsigned int power_{0};
47  float weight_{0};
48  float threshold_to_consider_{0};
49  bool enforce_path_inversion_{false};
50 };
51 
52 } // namespace mppi::critics
53 
54 #endif // NAV2_MPPI_CONTROLLER__CRITICS__GOAL_CRITIC_HPP_
Abstract critic objective function to score trajectories.
void initialize() override
Initialize critic.
Definition: goal_critic.cpp:22
void score(CriticData &data) override
Evaluate cost related to goal following.
Definition: goal_critic.cpp:38
Data to pass to critics for scoring, including state, trajectories, pruned path, global goal,...
Definition: critic_data.hpp:40