Autoware.Auto
track_class_variable.hpp
Go to the documentation of this file.
1 // Copyright 2021 Apex.AI, Inc.
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 
17 #ifndef TRACKING__TRACK_CLASS_VARIABLE_HPP_
18 #define TRACKING__TRACK_CLASS_VARIABLE_HPP_
19 
20 
21 #include <autoware_auto_perception_msgs/msg/object_classification.hpp>
24 
25 
26 namespace autoware
27 {
28 namespace perception
29 {
30 namespace tracking
31 {
32 
40 template<std::uint8_t kClassificationConstant>
42  public std::integral_constant<std::uint8_t, kClassificationConstant> {};
43 
54 template<typename StateT>
56 {
57  static_assert(
59  "The provided type must represent a GenericState type.");
60 
61  auto assert_indices_match_classification_constants = [](auto variable) {
62  using VariableT = decltype(variable);
63  static_assert(
64  StateT::template index_of<VariableT>() == VariableT::value,
65  "The index of the variable must correspond to the integral constant stored inside of "
66  "this variable class.");
67  };
69 }
70 
73  ClassificationVariable<autoware_auto_perception_msgs::msg::ObjectClassification::UNKNOWN>,
74  ClassificationVariable<autoware_auto_perception_msgs::msg::ObjectClassification::CAR>,
75  ClassificationVariable<autoware_auto_perception_msgs::msg::ObjectClassification::TRUCK>,
76  ClassificationVariable<autoware_auto_perception_msgs::msg::ObjectClassification::BUS>,
77  ClassificationVariable<autoware_auto_perception_msgs::msg::ObjectClassification::TRAILER>,
78  ClassificationVariable<autoware_auto_perception_msgs::msg::ObjectClassification::MOTORCYCLE>,
79  ClassificationVariable<autoware_auto_perception_msgs::msg::ObjectClassification::BICYCLE>,
81 
82 } // namespace tracking
83 } // namespace perception
84 } // namespace autoware
85 
86 #endif // TRACKING__TRACK_CLASS_VARIABLE_HPP_
autoware::common::state_vector::is_state
Forward-declare is_state trait.
Definition: generic_state.hpp:51
autoware::perception::tracking::ClassificationVariable
A struct to create a variable type from a given uint8_t value.
Definition: track_class_variable.hpp:41
autoware::perception::tracking::ObjectClassificationState
common::state_vector::FloatState< ClassificationVariable< autoware_auto_perception_msgs::msg::ObjectClassification::UNKNOWN >, ClassificationVariable< autoware_auto_perception_msgs::msg::ObjectClassification::CAR >, ClassificationVariable< autoware_auto_perception_msgs::msg::ObjectClassification::TRUCK >, ClassificationVariable< autoware_auto_perception_msgs::msg::ObjectClassification::BUS >, ClassificationVariable< autoware_auto_perception_msgs::msg::ObjectClassification::TRAILER >, ClassificationVariable< autoware_auto_perception_msgs::msg::ObjectClassification::MOTORCYCLE >, ClassificationVariable< autoware_auto_perception_msgs::msg::ObjectClassification::BICYCLE >, ClassificationVariable< autoware_auto_perception_msgs::msg::ObjectClassification::PEDESTRIAN > > ObjectClassificationState
A common state used for classification in the tracker.
Definition: track_class_variable.hpp:80
autoware::common::state_vector::GenericState
A representation of a generic state vectors with specified variables.
Definition: generic_state.hpp:60
variable.hpp
Contains base tag structs that define variables and traits to check if a type is one.
generic_state.hpp
This file defines a class for a generic state vector representation.
autoware
This file defines the lanelet2_map_provider_node class.
Definition: quick_sort.hpp:24
autoware::common::state_vector::Variable
A tag struct used to disambiguate variables from other types.
Definition: variable.hpp:40
autoware::perception::tracking::assert_indices_match_classification_constants
static void assert_indices_match_classification_constants()
Check that all the indices in the state vector correspond to the integral constant that the variable ...
Definition: track_class_variable.hpp:55
autoware::common::type_traits::visit
constexpr COMMON_PUBLIC std::enable_if_t< I==sizeof...(TypesT)> visit(std::tuple< TypesT... > &, Callable) noexcept
Visit every element in a tuple.
Definition: type_traits.hpp:80