Autoware.Auto
motion_model.hpp
Go to the documentation of this file.
1 // Copyright 2018 the Autoware Foundation
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 // Co-developed by Tier IV, Inc. and Apex.AI, Inc.
16 
21 #ifndef MOTION_MODEL__MOTION_MODEL_HPP_
22 #define MOTION_MODEL__MOTION_MODEL_HPP_
23 
24 #include <common/types.hpp>
25 #include <Eigen/Core>
26 #include <chrono>
28 
30 
31 namespace autoware
32 {
34 namespace motion
35 {
37 namespace motion_model
38 {
39 
42 
45 template<int32_t NumStates>
46 class MOTION_MODEL_PUBLIC MotionModel
47 {
48 public:
57  virtual void predict(
58  Eigen::Matrix<float32_t, NumStates, 1U> & x,
59  const std::chrono::nanoseconds & dt) const = 0;
66  virtual void predict(const std::chrono::nanoseconds & dt) = 0;
70  virtual void compute_jacobian(
71  Eigen::Matrix<float32_t, NumStates, NumStates> & F,
72  const std::chrono::nanoseconds & dt) = 0;
79  virtual void compute_jacobian_and_predict(
80  Eigen::Matrix<float32_t, NumStates, NumStates> & F,
81  const std::chrono::nanoseconds & dt) = 0;
85  virtual float32_t operator[](const index_t idx) const = 0;
88  virtual void reset(const Eigen::Matrix<float32_t, NumStates, 1U> & x) = 0;
91  virtual const Eigen::Matrix<float32_t, NumStates, 1U> & get_state() const = 0;
94  constexpr index_t get_num_states() const noexcept {return NumStates;}
95 
97  virtual ~MotionModel() = default;
98 
99 private:
100  MotionModel<NumStates> & operator=(const MotionModel<NumStates> & rhs) = delete;
101 }; // class MotionModel
102 } // namespace motion_model
103 } // namespace motion
104 } // namespace autoware
105 
106 #endif // MOTION_MODEL__MOTION_MODEL_HPP_
types.hpp
This file includes common type definition.
autoware::motion::motion_model::index_t
Eigen::Index index_t
indexing matches what matrices use
Definition: motion_model.hpp:41
autoware::motion::motion_model::MotionModel::get_num_states
constexpr index_t get_num_states() const noexcept
get dimensionality of this model
Definition: motion_model.hpp:94
autoware
This file defines the lanelet2_map_provider_node class.
Definition: quick_sort.hpp:24
autoware::motion::motion_model::MotionModel
Virtual interface for all motion models for use with prediction.
Definition: motion_model.hpp:46
x
DifferentialState x
Definition: kinematic_bicycle.snippet.hpp:28
autoware::common::types::float32_t
float float32_t
Definition: types.hpp:36
motion
Definition: controller_base.hpp:30
visibility_control.hpp
autoware::common::geometry::spatial_hash::Index
std::size_t Index
Index type for identifying bins of the hash/lattice.
Definition: spatial_hash_config.hpp:49