Nav2 Navigation Stack - jazzy  jazzy
ROS 2 Navigation Stack
path.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__MODELS__PATH_HPP_
16 #define NAV2_MPPI_CONTROLLER__MODELS__PATH_HPP_
17 
18 // xtensor creates warnings that needs to be ignored as we are building with -Werror
19 #pragma GCC diagnostic push
20 #pragma GCC diagnostic ignored "-Warray-bounds"
21 #pragma GCC diagnostic ignored "-Wstringop-overflow"
22 #include <xtensor/xtensor.hpp>
23 #pragma GCC diagnostic pop
24 
25 namespace mppi::models
26 {
27 
32 struct Path
33 {
34  xt::xtensor<float, 1> x;
35  xt::xtensor<float, 1> y;
36  xt::xtensor<float, 1> yaws;
37 
41  void reset(unsigned int size)
42  {
43  x = xt::zeros<float>({size});
44  y = xt::zeros<float>({size});
45  yaws = xt::zeros<float>({size});
46  }
47 };
48 
49 } // namespace mppi::models
50 
51 #endif // NAV2_MPPI_CONTROLLER__MODELS__PATH_HPP_
Path represented as a tensor.
Definition: path.hpp:33
void reset(unsigned int size)
Reset path data.
Definition: path.hpp:41