Nav2 Navigation Stack - kilted  kilted
ROS 2 Navigation Stack
constraint_critic.hpp
1 // Copyright (c) 2022 Samsung Research America, @artofnothingness Alexey Budyakov
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef NAV2_MPPI_CONTROLLER__CRITICS__CONSTRAINT_CRITIC_HPP_
16 #define NAV2_MPPI_CONTROLLER__CRITICS__CONSTRAINT_CRITIC_HPP_
17 
18 #include "nav2_mppi_controller/critic_function.hpp"
19 #include "nav2_mppi_controller/models/state.hpp"
20 #include "nav2_mppi_controller/tools/utils.hpp"
21 
22 namespace mppi::critics
23 {
24 
30 {
31 public:
35  void initialize() override;
36 
42  void score(CriticData & data) override;
43 
44  float getMaxVelConstraint() {return max_vel_;}
45  float getMinVelConstraint() {return min_vel_;}
46 
47 protected:
48  unsigned int power_{0};
49  float weight_{0};
50  float min_vel_;
51  float max_vel_;
52 };
53 
54 } // namespace mppi::critics
55 
56 #endif // NAV2_MPPI_CONTROLLER__CRITICS__CONSTRAINT_CRITIC_HPP_
Critic objective function for enforcing feasible constraints.
void score(CriticData &data) override
Evaluate cost related to goal following.
void initialize() override
Initialize critic.
Abstract critic objective function to score trajectories.
Data to pass to critics for scoring, including state, trajectories, pruned path, global goal,...
Definition: critic_data.hpp:40