Autoware.Auto
tracked_object.hpp
Go to the documentation of this file.
1 // Copyright 2021 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 
18 
19 #ifndef TRACKING__TRACKED_OBJECT_HPP_
20 #define TRACKING__TRACKED_OBJECT_HPP_
21 
22 #include <chrono>
23 
24 #include "autoware_auto_msgs/msg/detected_dynamic_object_array.hpp"
25 #include "autoware_auto_msgs/msg/tracked_dynamic_object.hpp"
26 #include "autoware_auto_msgs/msg/tracked_dynamic_object_array.hpp"
32 
33 
34 namespace autoware
35 {
36 namespace perception
37 {
38 namespace tracking
39 {
40 
42 class TRACKING_PUBLIC TrackedObject
43 {
44 public:
45  // Aliases for convenience
50  using TrackedObjectMsg = autoware_auto_msgs::msg::TrackedDynamicObject;
51  using DetectedObjectMsg = autoware_auto_msgs::msg::DetectedDynamicObject;
52 
58  TrackedObject(const DetectedObjectMsg & detection, float default_variance, float noise_variance);
60  // TODO(nikolai.morin): Change signature to use absolute time after #1002
61  void predict(std::chrono::nanoseconds dt);
62 
64  void update(const DetectedObjectMsg & detection);
65 
67  void no_update();
68 
70  const TrackedObjectMsg & msg();
71 
72 private:
74  TrackedObjectMsg m_msg;
76  EKF m_ekf;
78  size_t m_ticks_since_last_seen = 0;
80  size_t m_ticks_alive = 0;
81 };
82 
83 } // namespace tracking
84 } // namespace perception
85 } // namespace autoware
86 
87 #endif // TRACKING__TRACKED_OBJECT_HPP_
autoware::perception::tracking::TrackedObject::DetectedObjectMsg
autoware_auto_msgs::msg::DetectedDynamicObject DetectedObjectMsg
Definition: tracked_object.hpp:51
autoware::perception::tracking::TrackedObject::TrackedObjectMsg
autoware_auto_msgs::msg::TrackedDynamicObject TrackedObjectMsg
Definition: tracked_object.hpp:50
linear_motion_model.hpp
This file defines the linear motion model.
visibility_control.hpp
autoware
This file defines the lanelet2_map_provider_node class.
Definition: quick_sort.hpp:24
autoware::prediction::LinearMotionModel
A generic linear motion model class.
Definition: linear_motion_model.hpp:45
autoware::prediction::WienerNoise
A class that describes the Wiener process noise.
Definition: wiener_noise.hpp:47
wiener_noise.hpp
This file contains the Wiener noise model classes.
autoware::prediction::KalmanFilter< MotionModel, NoiseModel >
autoware::prediction::GenericState
A representation of a generic state vectors with specified variables.
Definition: generic_state.hpp:50
kalman_filter.hpp
This file defines a Kalman filter implementation of the filter interface.
autoware::prediction::state::ConstAccelerationXY
FloatState< variable::X, variable::X_VELOCITY, variable::X_ACCELERATION, variable::Y, variable::Y_VELOCITY, variable::Y_ACCELERATION > ConstAccelerationXY
A 2D state with no rotation.
Definition: common_states.hpp:43
autoware::perception::tracking::TrackedObject
Internal class containing the object state and other information.
Definition: tracked_object.hpp:42
common_states.hpp
This file holds a collection of states that are commonly used in this package.