Skip to content

Commit

Permalink
refactor(object_recognition_utils): add autoware prefix to object_rec…
Browse files Browse the repository at this point in the history
…ognition_utils (#8946)

Signed-off-by: Esteve Fernandez <[email protected]>
  • Loading branch information
esteve authored Oct 15, 2024
1 parent b502351 commit 95bb2c6
Show file tree
Hide file tree
Showing 83 changed files with 273 additions and 240 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ common/autoware_grid_map_utils/** [email protected]
common/autoware_interpolation/** [email protected] [email protected]
common/autoware_kalman_filter/** [email protected] [email protected] [email protected]
common/autoware_motion_utils/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
common/autoware_object_recognition_utils/** [email protected] [email protected] [email protected]
common/autoware_overlay_rviz_plugin/autoware_mission_details_overlay_rviz_plugin/** [email protected]
common/autoware_overlay_rviz_plugin/autoware_overlay_rviz_plugin/** [email protected]
common/autoware_path_distance_calculator/** [email protected]
Expand All @@ -24,7 +25,6 @@ common/fake_test_node/** [email protected] [email protected] shumpei.wakabay
common/global_parameter_loader/** [email protected]
common/glog_component/** [email protected]
common/goal_distance_calculator/** [email protected]
common/object_recognition_utils/** [email protected] [email protected] [email protected]
common/osqp_interface/** [email protected] [email protected] [email protected] [email protected]
common/polar_grid/** [email protected]
common/qp_interface/** [email protected] [email protected] [email protected] [email protected]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.14)
project(object_recognition_utils)
project(autoware_object_recognition_utils)

find_package(autoware_cmake REQUIRED)
autoware_package()

find_package(Boost REQUIRED)

ament_auto_add_library(object_recognition_utils SHARED
ament_auto_add_library(${PROJECT_NAME} SHARED
src/predicted_path_utils.cpp
src/conversion.cpp
)
Expand All @@ -19,7 +19,7 @@ if(BUILD_TESTING)
ament_add_ros_isolated_gtest(test_object_recognition_utils ${test_files})

target_link_libraries(test_object_recognition_utils
object_recognition_utils
${PROJECT_NAME}
)
endif()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# object_recognition_utils
# autoware_object_recognition_utils

## Purpose

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef OBJECT_RECOGNITION_UTILS__CONVERSION_HPP_
#define OBJECT_RECOGNITION_UTILS__CONVERSION_HPP_
#ifndef AUTOWARE__OBJECT_RECOGNITION_UTILS__CONVERSION_HPP_
#define AUTOWARE__OBJECT_RECOGNITION_UTILS__CONVERSION_HPP_

#include <autoware_perception_msgs/msg/detected_objects.hpp>
#include <autoware_perception_msgs/msg/tracked_objects.hpp>

namespace object_recognition_utils
namespace autoware::object_recognition_utils
{
using autoware_perception_msgs::msg::DetectedObject;
using autoware_perception_msgs::msg::DetectedObjects;
Expand All @@ -28,6 +28,6 @@ using autoware_perception_msgs::msg::TrackedObjects;
DetectedObject toDetectedObject(const TrackedObject & tracked_object);
DetectedObjects toDetectedObjects(const TrackedObjects & tracked_objects);
TrackedObject toTrackedObject(const DetectedObject & detected_object);
} // namespace object_recognition_utils
} // namespace autoware::object_recognition_utils

#endif // OBJECT_RECOGNITION_UTILS__CONVERSION_HPP_
#endif // AUTOWARE__OBJECT_RECOGNITION_UTILS__CONVERSION_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef OBJECT_RECOGNITION_UTILS__GEOMETRY_HPP_
#define OBJECT_RECOGNITION_UTILS__GEOMETRY_HPP_
#ifndef AUTOWARE__OBJECT_RECOGNITION_UTILS__GEOMETRY_HPP_
#define AUTOWARE__OBJECT_RECOGNITION_UTILS__GEOMETRY_HPP_

#include <autoware_perception_msgs/msg/detected_object.hpp>
#include <autoware_perception_msgs/msg/predicted_object.hpp>
#include <autoware_perception_msgs/msg/tracked_object.hpp>
#include <geometry_msgs/msg/pose.hpp>

namespace object_recognition_utils
namespace autoware::object_recognition_utils
{
template <class T>
geometry_msgs::msg::Pose getPose([[maybe_unused]] const T & p)
Expand Down Expand Up @@ -52,6 +52,6 @@ inline geometry_msgs::msg::Pose getPose(const autoware_perception_msgs::msg::Pre
{
return obj.kinematics.initial_pose_with_covariance.pose;
}
} // namespace object_recognition_utils
} // namespace autoware::object_recognition_utils

#endif // OBJECT_RECOGNITION_UTILS__GEOMETRY_HPP_
#endif // AUTOWARE__OBJECT_RECOGNITION_UTILS__GEOMETRY_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef OBJECT_RECOGNITION_UTILS__MATCHING_HPP_
#define OBJECT_RECOGNITION_UTILS__MATCHING_HPP_
#ifndef AUTOWARE__OBJECT_RECOGNITION_UTILS__MATCHING_HPP_
#define AUTOWARE__OBJECT_RECOGNITION_UTILS__MATCHING_HPP_

#include "autoware/object_recognition_utils/geometry.hpp"
#include "autoware/universe_utils/geometry/boost_geometry.hpp"
#include "autoware/universe_utils/geometry/boost_polygon_utils.hpp"
#include "object_recognition_utils/geometry.hpp"

#include <boost/geometry.hpp>

Expand All @@ -26,7 +26,7 @@
#include <utility>
#include <vector>

namespace object_recognition_utils
namespace autoware::object_recognition_utils
{
using autoware::universe_utils::Polygon2d;
// minimum area to avoid division by zero
Expand Down Expand Up @@ -126,6 +126,6 @@ double get2dRecall(const T1 source_object, const T2 target_object)

return std::min(1.0, intersection_area / target_area);
}
} // namespace object_recognition_utils
} // namespace autoware::object_recognition_utils

#endif // OBJECT_RECOGNITION_UTILS__MATCHING_HPP_
#endif // AUTOWARE__OBJECT_RECOGNITION_UTILS__MATCHING_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef OBJECT_RECOGNITION_UTILS__OBJECT_CLASSIFICATION_HPP_
#define OBJECT_RECOGNITION_UTILS__OBJECT_CLASSIFICATION_HPP_
#ifndef AUTOWARE__OBJECT_RECOGNITION_UTILS__OBJECT_CLASSIFICATION_HPP_
#define AUTOWARE__OBJECT_RECOGNITION_UTILS__OBJECT_CLASSIFICATION_HPP_

#include "autoware_perception_msgs/msg/object_classification.hpp"

#include <string>
#include <vector>

namespace object_recognition_utils
namespace autoware::object_recognition_utils
{
using autoware_perception_msgs::msg::ObjectClassification;

Expand Down Expand Up @@ -169,6 +169,6 @@ inline std::string convertLabelToString(
return convertLabelToString(highest_prob_label);
}

} // namespace object_recognition_utils
} // namespace autoware::object_recognition_utils

#endif // OBJECT_RECOGNITION_UTILS__OBJECT_CLASSIFICATION_HPP_
#endif // AUTOWARE__OBJECT_RECOGNITION_UTILS__OBJECT_CLASSIFICATION_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// 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 AUTOWARE__OBJECT_RECOGNITION_UTILS__OBJECT_RECOGNITION_UTILS_HPP_
#define AUTOWARE__OBJECT_RECOGNITION_UTILS__OBJECT_RECOGNITION_UTILS_HPP_

#include "autoware/object_recognition_utils/conversion.hpp"
#include "autoware/object_recognition_utils/geometry.hpp"
#include "autoware/object_recognition_utils/matching.hpp"
#include "autoware/object_recognition_utils/object_classification.hpp"
#include "autoware/object_recognition_utils/predicted_path_utils.hpp"
#include "autoware/object_recognition_utils/transform.hpp"

#endif // AUTOWARE__OBJECT_RECOGNITION_UTILS__OBJECT_RECOGNITION_UTILS_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef OBJECT_RECOGNITION_UTILS__PREDICTED_PATH_UTILS_HPP_
#define OBJECT_RECOGNITION_UTILS__PREDICTED_PATH_UTILS_HPP_
#ifndef AUTOWARE__OBJECT_RECOGNITION_UTILS__PREDICTED_PATH_UTILS_HPP_
#define AUTOWARE__OBJECT_RECOGNITION_UTILS__PREDICTED_PATH_UTILS_HPP_

#include "autoware/universe_utils/geometry/geometry.hpp"

Expand All @@ -24,7 +24,7 @@

#include <vector>

namespace object_recognition_utils
namespace autoware::object_recognition_utils
{
/**
* @brief Calculate Interpolated Pose from predicted path by time
Expand Down Expand Up @@ -61,6 +61,6 @@ autoware_perception_msgs::msg::PredictedPath resamplePredictedPath(
const autoware_perception_msgs::msg::PredictedPath & path, const double sampling_time_interval,
const double sampling_horizon, const bool use_spline_for_xy = true,
const bool use_spline_for_z = false);
} // namespace object_recognition_utils
} // namespace autoware::object_recognition_utils

#endif // OBJECT_RECOGNITION_UTILS__PREDICTED_PATH_UTILS_HPP_
#endif // AUTOWARE__OBJECT_RECOGNITION_UTILS__PREDICTED_PATH_UTILS_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef OBJECT_RECOGNITION_UTILS__TRANSFORM_HPP_
#define OBJECT_RECOGNITION_UTILS__TRANSFORM_HPP_
#ifndef AUTOWARE__OBJECT_RECOGNITION_UTILS__TRANSFORM_HPP_
#define AUTOWARE__OBJECT_RECOGNITION_UTILS__TRANSFORM_HPP_

#include <pcl_ros/transforms.hpp>

Expand Down Expand Up @@ -71,7 +71,7 @@ namespace detail
}
} // namespace detail

namespace object_recognition_utils
namespace autoware::object_recognition_utils
{
template <class T>
bool transformObjects(
Expand Down Expand Up @@ -147,6 +147,6 @@ bool transformObjectsWithFeature(
}
return true;
}
} // namespace object_recognition_utils
} // namespace autoware::object_recognition_utils

#endif // OBJECT_RECOGNITION_UTILS__TRANSFORM_HPP_
#endif // AUTOWARE__OBJECT_RECOGNITION_UTILS__TRANSFORM_HPP_
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>object_recognition_utils</name>
<name>autoware_object_recognition_utils</name>
<version>0.1.0</version>
<description>The object_recognition_utils package</description>
<description>The autoware_object_recognition_utils package</description>
<maintainer email="[email protected]">Takayuki Murooka</maintainer>
<maintainer email="[email protected]">Shunsuke Miura</maintainer>
<maintainer email="[email protected]">Yoshi Ri</maintainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "object_recognition_utils/conversion.hpp"
#include "autoware/object_recognition_utils/conversion.hpp"

namespace object_recognition_utils
namespace autoware::object_recognition_utils
{
using autoware_perception_msgs::msg::DetectedObject;
using autoware_perception_msgs::msg::DetectedObjects;
Expand Down Expand Up @@ -68,4 +68,4 @@ TrackedObject toTrackedObject(const DetectedObject & detected_object)
tracked_object.shape = detected_object.shape;
return tracked_object;
}
} // namespace object_recognition_utils
} // namespace autoware::object_recognition_utils
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "object_recognition_utils/predicted_path_utils.hpp"
#include "autoware/object_recognition_utils/predicted_path_utils.hpp"

#include "autoware/interpolation/linear_interpolation.hpp"
#include "autoware/interpolation/spherical_linear_interpolation.hpp"
#include "autoware/interpolation/spline_interpolation.hpp"

#include <algorithm>

namespace object_recognition_utils
namespace autoware::object_recognition_utils
{
boost::optional<geometry_msgs::msg::Pose> calcInterpolatedPose(
const autoware_perception_msgs::msg::PredictedPath & path, const double relative_time)
Expand Down Expand Up @@ -129,4 +129,4 @@ autoware_perception_msgs::msg::PredictedPath resamplePredictedPath(
resampled_path.time_step = rclcpp::Duration::from_seconds(sampling_time_interval);
return resampled_path;
}
} // namespace object_recognition_utils
} // namespace autoware::object_recognition_utils
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "autoware/object_recognition_utils/conversion.hpp"
#include "autoware/universe_utils/geometry/geometry.hpp"
#include "object_recognition_utils/conversion.hpp"

#include <gtest/gtest.h>

Expand Down Expand Up @@ -42,8 +42,8 @@ autoware_perception_msgs::msg::ObjectClassification createObjectClassification(
// NOTE: covariance is not checked
TEST(conversion, test_toDetectedObject)
{
using autoware::object_recognition_utils::toDetectedObject;
using autoware_perception_msgs::msg::ObjectClassification;
using object_recognition_utils::toDetectedObject;

autoware_perception_msgs::msg::TrackedObject tracked_obj;
// existence probability
Expand Down Expand Up @@ -160,8 +160,8 @@ TEST(conversion, test_toDetectedObject)
// NOTE: covariance is not checked
TEST(conversion, test_toTrackedObject)
{
using autoware::object_recognition_utils::toTrackedObject;
using autoware_perception_msgs::msg::ObjectClassification;
using object_recognition_utils::toTrackedObject;

autoware_perception_msgs::msg::DetectedObject detected_obj;
// existence probability
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "object_recognition_utils/geometry.hpp"
#include "autoware/object_recognition_utils/geometry.hpp"

#include <gtest/gtest.h>

#include <string>

TEST(geometry, getPose)
{
using object_recognition_utils::getPose;
using autoware::object_recognition_utils::getPose;

const double x_ans = 1.0;
const double y_ans = 2.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "autoware/object_recognition_utils/matching.hpp"
#include "autoware/universe_utils/geometry/geometry.hpp"
#include "object_recognition_utils/matching.hpp"

#include <autoware_perception_msgs/msg/detected_object.hpp>

Expand All @@ -37,8 +37,8 @@ geometry_msgs::msg::Pose createPose(const double x, const double y, const double

TEST(matching, test_get2dIoU)
{
using autoware::object_recognition_utils::get2dIoU;
using autoware_perception_msgs::msg::DetectedObject;
using object_recognition_utils::get2dIoU;

const double quart_circle = 0.16237976320958225;

Expand Down Expand Up @@ -93,7 +93,7 @@ TEST(matching, test_get2dIoU)

TEST(object_recognition_utils, test_get2dGeneralizedIoU)
{
using object_recognition_utils::get2dGeneralizedIoU;
using autoware::object_recognition_utils::get2dGeneralizedIoU;
// TODO(Shin-kyoto):
// get2dGeneralizedIoU uses outer points of each polygon.
// But these points contain an sampling error of outer line,
Expand Down Expand Up @@ -153,8 +153,8 @@ TEST(object_recognition_utils, test_get2dGeneralizedIoU)

TEST(matching, test_get2dPrecision)
{
using autoware::object_recognition_utils::get2dPrecision;
using autoware_perception_msgs::msg::DetectedObject;
using object_recognition_utils::get2dPrecision;
const double quart_circle = 0.16237976320958225;

{ // non overlapped
Expand Down Expand Up @@ -220,8 +220,8 @@ TEST(matching, test_get2dPrecision)

TEST(matching, test_get2dRecall)
{
using autoware::object_recognition_utils::get2dRecall;
using autoware_perception_msgs::msg::DetectedObject;
using object_recognition_utils::get2dRecall;
const double quart_circle = 0.16237976320958225;

{ // non overlapped
Expand Down
Loading

0 comments on commit 95bb2c6

Please sign in to comment.