Nav2 Navigation Stack - humble  humble
ROS 2 Navigation Stack
critic_data.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__CRITIC_DATA_HPP_
16 #define NAV2_MPPI_CONTROLLER__CRITIC_DATA_HPP_
17 
18 #include <memory>
19 #include <vector>
20 #include <xtensor/xtensor.hpp>
21 
22 #include "geometry_msgs/msg/pose_stamped.hpp"
23 #include "nav2_core/goal_checker.hpp"
24 #include "nav2_mppi_controller/models/state.hpp"
25 #include "nav2_mppi_controller/models/trajectories.hpp"
26 #include "nav2_mppi_controller/models/path.hpp"
27 #include "nav2_mppi_controller/motion_models.hpp"
28 
29 
30 namespace mppi
31 {
32 
38 struct CriticData
39 {
40  const models::State & state;
41  const models::Trajectories & trajectories;
42  const models::Path & path;
43  const geometry_msgs::msg::Pose & goal;
44 
45  xt::xtensor<float, 1> & costs;
46  float & model_dt;
47 
48  bool fail_flag;
49  nav2_core::GoalChecker * goal_checker;
50  std::shared_ptr<MotionModel> motion_model;
51  std::optional<std::vector<bool>> path_pts_valid;
52  std::optional<size_t> furthest_reached_path_point;
53 };
54 
55 } // namespace mppi
56 
57 #endif // NAV2_MPPI_CONTROLLER__CRITIC_DATA_HPP_
Function-object for checking whether a goal has been reached.
Data to pass to critics for scoring, including state, trajectories, pruned path, global goal,...
Definition: critic_data.hpp:39
Path represented as a tensor.
Definition: path.hpp:28
State information: velocities, controls, poses, speed.
Definition: state.hpp:31
Candidate Trajectories.