Skip to content

Commit

Permalink
refactor(perception_utils): add label util function (autowarefoundati…
Browse files Browse the repository at this point in the history
…on#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>
  • Loading branch information
2 people authored and boyali committed Oct 19, 2022
1 parent b810ad2 commit f27b651
Showing 1 changed file with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Copyright 2022 TIER IV, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef PERCEPTION_UTILS__OBJECT_CLASSIFICATION_HPP_
#define PERCEPTION_UTILS__OBJECT_CLASSIFICATION_HPP_

#include "autoware_auto_perception_msgs/msg/object_classification.hpp"

namespace perception_utils
{
using autoware_auto_perception_msgs::msg::ObjectClassification;

bool isVehicle(const uint8_t object_classification)
{
return object_classification == ObjectClassification::BICYCLE ||
object_classification == ObjectClassification::BUS ||
object_classification == ObjectClassification::CAR ||
object_classification == ObjectClassification::MOTORCYCLE ||
object_classification == ObjectClassification::TRAILER ||
object_classification == ObjectClassification::TRUCK;
}

bool isCarLikeVehicle(const uint8_t object_classification)
{
return object_classification == ObjectClassification::BUS ||
object_classification == ObjectClassification::CAR ||
object_classification == ObjectClassification::TRAILER ||
object_classification == ObjectClassification::TRUCK;
}

bool isLargeVehicle(const uint8_t object_classification)
{
return object_classification == ObjectClassification::BUS ||
object_classification == ObjectClassification::TRAILER ||
object_classification == ObjectClassification::TRUCK;
}
} // namespace perception_utils

#endif // PERCEPTION_UTILS__OBJECT_CLASSIFICATION_HPP_

0 comments on commit f27b651

Please sign in to comment.