Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(object_recognition_utils): add autoware prefix to object_recognition_utils #8946

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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 @@ -143,6 +143,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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// 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>

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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

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

#include <gtest/gtest.h>

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 "autoware/object_recognition_utils/predicted_path_utils.hpp"
#include "autoware/universe_utils/geometry/geometry.hpp"
#include "autoware/universe_utils/math/unit_conversion.hpp"
#include "object_recognition_utils/predicted_path_utils.hpp"

#include <gtest/gtest.h>

Expand Down

This file was deleted.

Loading