|
| 1 | +// Copyright 2024 TIER IV, 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 | +// |
| 16 | +// Author: v1.0 Taekjin Lee |
| 17 | + |
| 18 | +#ifndef AUTOWARE__MULTI_OBJECT_TRACKER__OBJECT_MODEL__TYPES_HPP_ |
| 19 | +#define AUTOWARE__MULTI_OBJECT_TRACKER__OBJECT_MODEL__TYPES_HPP_ |
| 20 | + |
| 21 | +#include <autoware_perception_msgs/msg/detected_object.hpp> |
| 22 | +#include <autoware_perception_msgs/msg/detected_object_kinematics.hpp> |
| 23 | +#include <autoware_perception_msgs/msg/detected_objects.hpp> |
| 24 | +#include <autoware_perception_msgs/msg/object_classification.hpp> |
| 25 | +#include <autoware_perception_msgs/msg/shape.hpp> |
| 26 | +#include <autoware_perception_msgs/msg/tracked_object.hpp> |
| 27 | +#include <autoware_perception_msgs/msg/tracked_object_kinematics.hpp> |
| 28 | +#include <geometry_msgs/msg/polygon.hpp> |
| 29 | +#include <geometry_msgs/msg/pose_with_covariance.hpp> |
| 30 | +#include <geometry_msgs/msg/twist_with_covariance.hpp> |
| 31 | +#include <geometry_msgs/msg/vector3.hpp> |
| 32 | +#include <std_msgs/msg/header.hpp> |
| 33 | +#include <unique_identifier_msgs/msg/uuid.hpp> |
| 34 | + |
| 35 | +#include <boost/optional.hpp> |
| 36 | + |
| 37 | +#include <vector> |
| 38 | + |
| 39 | +namespace autoware::multi_object_tracker |
| 40 | +{ |
| 41 | +namespace types |
| 42 | +{ |
| 43 | +enum OrientationAvailability : uint8_t { |
| 44 | + UNAVAILABLE = 0, |
| 45 | + SIGN_UNKNOWN = 1, |
| 46 | + AVAILABLE = 2, |
| 47 | +}; |
| 48 | + |
| 49 | +struct ObjectKinematics |
| 50 | +{ |
| 51 | + geometry_msgs::msg::PoseWithCovariance pose_with_covariance; |
| 52 | + geometry_msgs::msg::TwistWithCovariance twist_with_covariance; |
| 53 | + bool has_position_covariance = false; |
| 54 | + OrientationAvailability orientation_availability; |
| 55 | + bool has_twist = false; |
| 56 | + bool has_twist_covariance = false; |
| 57 | +}; |
| 58 | + |
| 59 | +struct DynamicObject |
| 60 | +{ |
| 61 | + unique_identifier_msgs::msg::UUID object_id = unique_identifier_msgs::msg::UUID(); |
| 62 | + uint channel_index; |
| 63 | + float existence_probability; |
| 64 | + std::vector<autoware_perception_msgs::msg::ObjectClassification> classification; |
| 65 | + ObjectKinematics kinematics; |
| 66 | + autoware_perception_msgs::msg::Shape shape; |
| 67 | +}; |
| 68 | + |
| 69 | +struct DynamicObjectList |
| 70 | +{ |
| 71 | + std_msgs::msg::Header header; |
| 72 | + uint channel_index; |
| 73 | + std::vector<DynamicObject> objects; |
| 74 | +}; |
| 75 | + |
| 76 | +DynamicObject toDynamicObject( |
| 77 | + const autoware_perception_msgs::msg::DetectedObject & det_object, const uint channel_index = 0); |
| 78 | + |
| 79 | +DynamicObjectList toDynamicObjectList( |
| 80 | + const autoware_perception_msgs::msg::DetectedObjects & det_objects, const uint channel_index = 0); |
| 81 | + |
| 82 | +autoware_perception_msgs::msg::TrackedObject toTrackedObjectMsg(const DynamicObject & dyn_object); |
| 83 | + |
| 84 | +} // namespace types |
| 85 | + |
| 86 | +} // namespace autoware::multi_object_tracker |
| 87 | + |
| 88 | +#endif // AUTOWARE__MULTI_OBJECT_TRACKER__OBJECT_MODEL__TYPES_HPP_ |
0 commit comments