Skip to content

Commit

Permalink
refactor(lidar_centerpoint): refactor isCarLikeVehicle function (#2030)
Browse files Browse the repository at this point in the history
Signed-off-by: scepter914 <[email protected]>

Signed-off-by: scepter914 <[email protected]>
  • Loading branch information
scepter914 authored Oct 11, 2022
1 parent 88e9324 commit 4d85af2
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions perception/lidar_centerpoint/lib/ros_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@

#include "lidar_centerpoint/ros_utils.hpp"

#include <tier4_autoware_utils/geometry/geometry.hpp>
#include <tier4_autoware_utils/math/constants.hpp>
#include "perception_utils/perception_utils.hpp"
#include "tier4_autoware_utils/geometry/geometry.hpp"
#include "tier4_autoware_utils/math/constants.hpp"

namespace centerpoint
{
Expand All @@ -40,7 +41,7 @@ void box3DToDetectedObject(
rclcpp::get_logger("lidar_centerpoint"), "Unexpected label: UNKNOWN is set.");
}

if (isCarLikeVehicleLabel(classification.label)) {
if (perception_utils::isCarLikeVehicle(classification.label)) {
obj.kinematics.orientation_availability =
autoware_auto_perception_msgs::msg::DetectedObjectKinematics::SIGN_UNKNOWN;
}
Expand Down Expand Up @@ -91,10 +92,4 @@ uint8_t getSemanticType(const std::string & class_name)
}
}

bool isCarLikeVehicleLabel(const uint8_t label)
{
return label == Label::CAR || label == Label::TRUCK || label == Label::BUS ||
label == Label::TRAILER;
}

} // namespace centerpoint

0 comments on commit 4d85af2

Please sign in to comment.