Nav2 Navigation Stack - kilted  kilted
ROS 2 Navigation Stack
state.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__STATE_HPP_
16 #define NAV2_MPPI_CONTROLLER__MODELS__STATE_HPP_
17 
18 #include <Eigen/Dense>
19 
20 #include <geometry_msgs/msg/pose_stamped.hpp>
21 #include <geometry_msgs/msg/twist.hpp>
22 
23 
24 namespace mppi::models
25 {
26 
31 struct State
32 {
33  Eigen::ArrayXXf vx;
34  Eigen::ArrayXXf vy;
35  Eigen::ArrayXXf wz;
36 
37  Eigen::ArrayXXf cvx;
38  Eigen::ArrayXXf cvy;
39  Eigen::ArrayXXf cwz;
40 
41  geometry_msgs::msg::PoseStamped pose;
42  geometry_msgs::msg::Twist speed;
43 
47  void reset(unsigned int batch_size, unsigned int time_steps)
48  {
49  vx.setZero(batch_size, time_steps);
50  vy.setZero(batch_size, time_steps);
51  wz.setZero(batch_size, time_steps);
52 
53  cvx.setZero(batch_size, time_steps);
54  cvy.setZero(batch_size, time_steps);
55  cwz.setZero(batch_size, time_steps);
56  }
57 };
58 } // namespace mppi::models
59 
60 #endif // NAV2_MPPI_CONTROLLER__MODELS__STATE_HPP_
State information: velocities, controls, poses, speed.
Definition: state.hpp:32
void reset(unsigned int batch_size, unsigned int time_steps)
Reset state data.
Definition: state.hpp:47