Skip to content

Commit 36d9d64

Browse files
refactor(perception_utils): add label util function (#1908)
* refactor(perception_utils): add label util function Signed-off-by: scepter914 <scepter914@gmail.com> * fix hpp define Signed-off-by: scepter914 <scepter914@gmail.com> * Update common/perception_utils/include/perception_utils/object_classification.hpp Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> * fix isVehicle function Signed-off-by: scepter914 <scepter914@gmail.com> * add CarLikeVehicle function Signed-off-by: scepter914 <scepter914@gmail.com> Signed-off-by: scepter914 <scepter914@gmail.com> Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>
1 parent e66a67e commit 36d9d64

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright 2022 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+
#ifndef PERCEPTION_UTILS__OBJECT_CLASSIFICATION_HPP_
16+
#define PERCEPTION_UTILS__OBJECT_CLASSIFICATION_HPP_
17+
18+
#include "autoware_auto_perception_msgs/msg/object_classification.hpp"
19+
20+
namespace perception_utils
21+
{
22+
using autoware_auto_perception_msgs::msg::ObjectClassification;
23+
24+
bool isVehicle(const uint8_t object_classification)
25+
{
26+
return object_classification == ObjectClassification::BICYCLE ||
27+
object_classification == ObjectClassification::BUS ||
28+
object_classification == ObjectClassification::CAR ||
29+
object_classification == ObjectClassification::MOTORCYCLE ||
30+
object_classification == ObjectClassification::TRAILER ||
31+
object_classification == ObjectClassification::TRUCK;
32+
}
33+
34+
bool isCarLikeVehicle(const uint8_t object_classification)
35+
{
36+
return object_classification == ObjectClassification::BUS ||
37+
object_classification == ObjectClassification::CAR ||
38+
object_classification == ObjectClassification::TRAILER ||
39+
object_classification == ObjectClassification::TRUCK;
40+
}
41+
42+
bool isLargeVehicle(const uint8_t object_classification)
43+
{
44+
return object_classification == ObjectClassification::BUS ||
45+
object_classification == ObjectClassification::TRAILER ||
46+
object_classification == ObjectClassification::TRUCK;
47+
}
48+
} // namespace perception_utils
49+
50+
#endif // PERCEPTION_UTILS__OBJECT_CLASSIFICATION_HPP_

0 commit comments

Comments
 (0)