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

feat(autoware_utils): update readme as deprecated #51

Merged
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
21 changes: 0 additions & 21 deletions autoware_utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,4 @@ project(autoware_utils)

find_package(autoware_cmake REQUIRED)
autoware_package()

file(GLOB_RECURSE src_files
src/*.cpp
src/geometry/*.cpp
src/math/*.cpp
src/ros/*.cpp
src/system/*.cpp
)

ament_auto_add_library(autoware_utils SHARED
${src_files}
)

if(BUILD_TESTING)
file(GLOB_RECURSE test_files test/**/*.cpp)
ament_add_ros_isolated_gtest(test_autoware_utils ${test_files})
target_link_libraries(test_autoware_utils
autoware_utils
)
endif()

ament_auto_package()
16 changes: 13 additions & 3 deletions autoware_utils/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# autoware_utils Library
# autoware_utils

## Overview
This package is deprecated and kept for compatibility. Use separate packages for each feature instead.

The **autoware_utils** library is a comprehensive toolkit designed to facilitate the development of autonomous driving applications. This library provides essential utilities for geometry, mathematics, ROS (Robot Operating System) expansions, diagnostics, and more. It is extensively used in the Autoware project to handle common tasks such as geometric calculations, data normalization, message conversions, performance monitoring, and point cloud transformations.
- [autoware_utils_debug](../autoware_utils_debug/README.md)
- [autoware_utils_diagnostics](../autoware_utils_diagnostics/README.md)
- [autoware_utils_geometry](../autoware_utils_geometry/README.md)
- [autoware_utils_logging](../autoware_utils_logging/README.md)
- [autoware_utils_math](../autoware_utils_math/README.md)
- [autoware_utils_pcl](../autoware_utils_pcl/README.md)
- [autoware_utils_rclcpp](../autoware_utils_rclcpp/README.md)
- [autoware_utils_system](../autoware_utils_system/README.md)
- [autoware_utils_tf](../autoware_utils_tf/README.md)
- [autoware_utils_uuid](../autoware_utils_uuid/README.md)
- [autoware_utils_visualization](../autoware_utils_visualization/README.md)
11 changes: 0 additions & 11 deletions autoware_utils/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,7 @@
<depend>autoware_utils_tf</depend>
<depend>autoware_utils_uuid</depend>
<depend>autoware_utils_visualization</depend>
<depend>autoware_vehicle_msgs</depend>
<depend>builtin_interfaces</depend>
<depend>diagnostic_msgs</depend>
<depend>geometry_msgs</depend>
<depend>libboost-system-dev</depend>
<depend>rclcpp</depend>
<depend>tf2</depend>
<depend>tf2_eigen</depend>
<depend>tf2_geometry_msgs</depend>
<depend>unique_identifier_msgs</depend>

<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>

Expand Down
15 changes: 0 additions & 15 deletions autoware_utils/src/autoware_utils.cpp

This file was deleted.

83 changes: 0 additions & 83 deletions autoware_utils/test/src/math/test_normalization.cpp

This file was deleted.

65 changes: 0 additions & 65 deletions autoware_utils/test/src/math/test_unit_conversion.cpp

This file was deleted.

28 changes: 0 additions & 28 deletions autoware_utils/test/src/test_autoware_utils.cpp

This file was deleted.

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

#include "autoware_utils/math/constants.hpp"
#include "autoware_utils_math/constants.hpp"

#include <gtest/gtest.h>

TEST(constants, pi) // NOLINT for gtest
{
using autoware_utils::pi;
using autoware_utils_math::pi;

EXPECT_DOUBLE_EQ(pi, 3.14159265358979323846);
}

TEST(constants, gravity) // NOLINT for gtest
{
using autoware_utils::gravity;
using autoware_utils_math::gravity;

EXPECT_DOUBLE_EQ(gravity, 9.80665);
}
68 changes: 67 additions & 1 deletion autoware_utils_math/test/cases/normalization.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2025 The Autoware Contributors
// Copyright 2020 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.
Expand Down Expand Up @@ -52,3 +52,69 @@ TEST(TestNormalization, Radian)
}
}
}

TEST(normalization, normalize_degree) // NOLINT for gtest
{
using autoware_utils_math::normalize_degree;

// -180 <= deg < 180
{
constexpr double eps = 0.1;
constexpr double v_min = -180;
constexpr double v_mid = 0;
constexpr double v_max = 180;

EXPECT_DOUBLE_EQ(normalize_degree(v_min - eps), v_max - eps);
EXPECT_DOUBLE_EQ(normalize_degree(v_min), v_min);
EXPECT_DOUBLE_EQ(normalize_degree(v_mid), v_mid);
EXPECT_DOUBLE_EQ(normalize_degree(v_max - eps), v_max - eps);
EXPECT_DOUBLE_EQ(normalize_degree(v_max), v_min);
}

// 0 <= deg < 360
{
constexpr double eps = 0.1;
constexpr double v_min = 0;
constexpr double v_mid = 180;
constexpr double v_max = 360;

EXPECT_DOUBLE_EQ(normalize_degree(v_min - eps, 0), v_max - eps);
EXPECT_DOUBLE_EQ(normalize_degree(v_min, 0), v_min);
EXPECT_DOUBLE_EQ(normalize_degree(v_mid, 0), v_mid);
EXPECT_DOUBLE_EQ(normalize_degree(v_max - eps, 0), v_max - eps);
EXPECT_DOUBLE_EQ(normalize_degree(v_max, 0), v_min);
}
}

TEST(normalization, normalize_radian) // NOLINT for gtest
{
using autoware_utils_math::normalize_radian;

// -M_PI <= deg < M_PI
{
constexpr double eps = 0.1;
constexpr double v_min = -M_PI;
constexpr double v_mid = 0;
constexpr double v_max = M_PI;

EXPECT_DOUBLE_EQ(normalize_radian(v_min - eps), v_max - eps);
EXPECT_DOUBLE_EQ(normalize_radian(v_min), v_min);
EXPECT_DOUBLE_EQ(normalize_radian(v_mid), v_mid);
EXPECT_DOUBLE_EQ(normalize_radian(v_max - eps), v_max - eps);
EXPECT_DOUBLE_EQ(normalize_radian(v_max), v_min);
}

// 0 <= deg < 2 * M_PI
{
constexpr double eps = 0.1;
constexpr double v_min = 0;
constexpr double v_mid = M_PI;
constexpr double v_max = 2 * M_PI;

EXPECT_DOUBLE_EQ(normalize_radian(v_min - eps, 0), v_max - eps);
EXPECT_DOUBLE_EQ(normalize_radian(v_min, 0), v_min);
EXPECT_DOUBLE_EQ(normalize_radian(v_mid, 0), v_mid);
EXPECT_DOUBLE_EQ(normalize_radian(v_max - eps, 0), v_max - eps);
EXPECT_DOUBLE_EQ(normalize_radian(v_max, 0), v_min);
}
}
Loading
Loading