Nav2 Navigation Stack - humble  humble
ROS 2 Navigation Stack
trajectories.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__TRAJECTORIES_HPP_
16 #define NAV2_MPPI_CONTROLLER__MODELS__TRAJECTORIES_HPP_
17 
18 #include <xtensor/xtensor.hpp>
19 #include <xtensor/xview.hpp>
20 
21 namespace mppi::models
22 {
23 
29 {
30  xt::xtensor<float, 2> x;
31  xt::xtensor<float, 2> y;
32  xt::xtensor<float, 2> yaws;
33 
37  void reset(unsigned int batch_size, unsigned int time_steps)
38  {
39  x = xt::zeros<float>({batch_size, time_steps});
40  y = xt::zeros<float>({batch_size, time_steps});
41  yaws = xt::zeros<float>({batch_size, time_steps});
42  }
43 };
44 
45 } // namespace mppi::models
46 
47 #endif // NAV2_MPPI_CONTROLLER__MODELS__TRAJECTORIES_HPP_
Candidate Trajectories.
void reset(unsigned int batch_size, unsigned int time_steps)
Reset state data.