From 7d24dd4a2ee7e148e20c43803a636ec963453ef9 Mon Sep 17 00:00:00 2001 From: liu cui Date: Mon, 6 Jan 2025 11:13:37 +0800 Subject: [PATCH 1/6] feat: port autoware_point_types from universe Signed-off-by: liu cui --- common/autoware_point_types/CHANGELOG.rst | 150 ++++++++++++++ common/autoware_point_types/CMakeLists.txt | 25 +++ common/autoware_point_types/README.md | 1 + .../include/autoware/point_types/types.hpp | 188 ++++++++++++++++++ common/autoware_point_types/package.xml | 34 ++++ .../test/test_point_types.cpp | 66 ++++++ 6 files changed, 464 insertions(+) create mode 100644 common/autoware_point_types/CHANGELOG.rst create mode 100644 common/autoware_point_types/CMakeLists.txt create mode 100644 common/autoware_point_types/README.md create mode 100644 common/autoware_point_types/include/autoware/point_types/types.hpp create mode 100644 common/autoware_point_types/package.xml create mode 100644 common/autoware_point_types/test/test_point_types.cpp diff --git a/common/autoware_point_types/CHANGELOG.rst b/common/autoware_point_types/CHANGELOG.rst new file mode 100644 index 0000000000..5e26002677 --- /dev/null +++ b/common/autoware_point_types/CHANGELOG.rst @@ -0,0 +1,150 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package autoware_point_types +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +0.40.0 (2024-12-12) +------------------- +* Revert "chore(package.xml): bump version to 0.39.0 (`#9587 `_)" + This reverts commit c9f0f2688c57b0f657f5c1f28f036a970682e7f5. +* fix: fix ticket links in CHANGELOG.rst (`#9588 `_) +* chore(package.xml): bump version to 0.39.0 (`#9587 `_) + * chore(package.xml): bump version to 0.39.0 + * fix: fix ticket links in CHANGELOG.rst + * fix: remove unnecessary diff + --------- + Co-authored-by: Yutaka Kondo +* fix: fix ticket links in CHANGELOG.rst (`#9588 `_) +* 0.39.0 +* update changelog +* fix: fix ticket links to point to https://github.com/autowarefoundation/autoware.universe (`#9304 `_) +* fix: fix ticket links to point to https://github.com/autowarefoundation/autoware.universe (`#9304 `_) +* chore(package.xml): bump version to 0.38.0 (`#9266 `_) (`#9284 `_) + * unify package.xml version to 0.37.0 + * remove system_monitor/CHANGELOG.rst + * add changelog + * 0.38.0 + --------- +* Contributors: Esteve Fernandez, Fumiya Watanabe, Ryohsuke Mitsudome, Yutaka Kondo + +0.39.0 (2024-11-25) +------------------- +* fix: fix ticket links to point to https://github.com/autowarefoundation/autoware.universe (`#9304 `_) +* fix: fix ticket links to point to https://github.com/autowarefoundation/autoware.universe (`#9304 `_) +* chore(package.xml): bump version to 0.38.0 (`#9266 `_) (`#9284 `_) + * unify package.xml version to 0.37.0 + * remove system_monitor/CHANGELOG.rst + * add changelog + * 0.38.0 + --------- +* Contributors: Esteve Fernandez, Yutaka Kondo + +0.38.0 (2024-11-08) +------------------- +* unify package.xml version to 0.37.0 +* refactor(autoware_point_types): prefix namespace with autoware::point_types (`#9169 `_) +* feat: migrating pointcloud types (`#6996 `_) + * feat: changed most of sensing to the new type + * chore: started applying changes to the perception stack + * feat: confirmed operation until centerpoint + * feat: reverted to the original implementation of pointpainting + * chore: forgot to push a header + * feat: also implemented the changes for the subsample filters that were out of scope before + * fix: some point type changes were missing from the latest merge from main + * chore: removed unused code, added comments, and brought back a removed publish + * chore: replaced pointcloud_raw for pointcloud_raw_ex to avoid extra processing time in the drivers + * feat: added memory layout checks + * chore: updated documentation regarding the point types + * chore: added hyperlinks to the point definitions. will be valid only once the PR is merged + * fix: fixed compilation due to moving the utilities files to the base library + * chore: separated the utilities functions due to a dependency issue + * chore: forgot that perception also uses the filter class + * feature: adapted the undistortion tests to the new point type + --------- + Co-authored-by: kminoda <44218668+kminoda@users.noreply.github.com> + Co-authored-by: badai nguyen <94814556+badai-nguyen@users.noreply.github.com> +* chore: updated maintainers for the autoware_point_types package (`#7797 `_) +* docs(common): adding .pages file (`#7148 `_) + * docs(common): adding .pages file + * fix naming + * fix naming + * fix naming + * include main page plus explanation to autoware tools + * style(pre-commit): autofix + --------- + Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> +* Contributors: Esteve Fernandez, Kenzo Lobos Tsunekawa, Yutaka Kondo, Zulfaqar Azmi + +0.26.0 (2024-04-03) +------------------- +* build: mark autoware_cmake as (`#3616 `_) + * build: mark autoware_cmake as + with , autoware_cmake is automatically exported with ament_target_dependencies() (unecessary) + * style(pre-commit): autofix + * chore: fix pre-commit errors + --------- + Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> + Co-authored-by: Kenji Miyake +* feat: isolate gtests in all packages (`#693 `_) +* chore: upgrade cmake_minimum_required to 3.14 (`#856 `_) +* refactor: use autoware cmake (`#849 `_) + * remove autoware_auto_cmake + * add build_depend of autoware_cmake + * use autoware_cmake in CMakeLists.txt + * fix bugs + * fix cmake lint errors +* feat: add blockage diagnostics (`#461 `_) + * feat!: add blockage diagnostic + * fix: typo + * docs: add documentation + * ci(pre-commit): autofix + * fix: typo + * ci(pre-commit): autofix + * fix: typo + * chore: add adjustable param + * ci(pre-commit): autofix + * feat!: add blockage diagnostic + * fix: typo + * docs: add documentation + * ci(pre-commit): autofix + * fix: typo + * ci(pre-commit): autofix + * fix: typo + * chore: add adjustable param + * ci(pre-commit): autofix + * chore: rearrange header file + * chore: fix typo + * chore: rearrange header + * fix: revert accident change + * chore: fix typo + * docs: add limits + * chore: check overflow + Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> +* ci: check include guard (`#438 `_) + * ci: check include guard + * apply pre-commit + * Update .pre-commit-config.yaml + Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> + * fix: pre-commit + Co-authored-by: Kenji Miyake + Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> +* feat: add point_types for wrapper (`#784 `_) (`#215 `_) + * add point_types + * Revert "add point_types" + This reverts commit 5810000cd1cbd876bc22372e2bb74ccaca06187b. + * create autoware_point_types pkg + * add include + * add cmath + * fix author + * fix bug + * define epsilon as argument + * add test + * remove unnamed namespace + * update test + * fix test name + * use std::max + * change comparison method + * remove unnencessary line + * fix test + * fix comparison method name + Co-authored-by: Taichi Higashide +* Contributors: Daisuke Nishimatsu, Kenji Miyake, Maxime CLEMENT, Takagi, Isamu, Vincent Richard, badai nguyen diff --git a/common/autoware_point_types/CMakeLists.txt b/common/autoware_point_types/CMakeLists.txt new file mode 100644 index 0000000000..c149f79dab --- /dev/null +++ b/common/autoware_point_types/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.14) +project(autoware_point_types) + +find_package(autoware_cmake REQUIRED) +autoware_package() + +include_directories( + include + SYSTEM + ${PCL_INCLUDE_DIRS} +) + +if(BUILD_TESTING) + ament_add_ros_isolated_gtest(test_autoware_point_types + test/test_point_types.cpp + ) + target_include_directories(test_autoware_point_types + PRIVATE include + ) + ament_target_dependencies(test_autoware_point_types + point_cloud_msg_wrapper + ) +endif() + +ament_auto_package() diff --git a/common/autoware_point_types/README.md b/common/autoware_point_types/README.md new file mode 100644 index 0000000000..92f19d2bc3 --- /dev/null +++ b/common/autoware_point_types/README.md @@ -0,0 +1 @@ +# Autoware Point Types diff --git a/common/autoware_point_types/include/autoware/point_types/types.hpp b/common/autoware_point_types/include/autoware/point_types/types.hpp new file mode 100644 index 0000000000..0fde62222e --- /dev/null +++ b/common/autoware_point_types/include/autoware/point_types/types.hpp @@ -0,0 +1,188 @@ +// Copyright 2021 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__POINT_TYPES__TYPES_HPP_ +#define AUTOWARE__POINT_TYPES__TYPES_HPP_ + +#include + +#include + +#include +#include + +namespace autoware::point_types +{ +template +bool float_eq(const T a, const T b, const T eps = 10e-6) +{ + return std::fabs(a - b) < eps; +} + +struct PointXYZI +{ + float x{0.0F}; + float y{0.0F}; + float z{0.0F}; + float intensity{0.0F}; + friend bool operator==(const PointXYZI & p1, const PointXYZI & p2) noexcept + { + return float_eq(p1.x, p2.x) && float_eq(p1.y, p2.y) && + float_eq(p1.z, p2.z) && float_eq(p1.intensity, p2.intensity); + } +}; + +enum ReturnType : uint8_t { + INVALID = 0, + SINGLE_STRONGEST, + SINGLE_LAST, + DUAL_STRONGEST_FIRST, + DUAL_STRONGEST_LAST, + DUAL_WEAK_FIRST, + DUAL_WEAK_LAST, + DUAL_ONLY, +}; + +struct PointXYZIRC +{ + float x{0.0F}; + float y{0.0F}; + float z{0.0F}; + std::uint8_t intensity{0U}; + std::uint8_t return_type{0U}; + std::uint16_t channel{0U}; + + friend bool operator==(const PointXYZIRC & p1, const PointXYZIRC & p2) noexcept + { + return float_eq(p1.x, p2.x) && float_eq(p1.y, p2.y) && + float_eq(p1.z, p2.z) && p1.intensity == p2.intensity && + p1.return_type == p2.return_type && p1.channel == p2.channel; + } +}; + +struct PointXYZIRADRT +{ + float x{0.0F}; + float y{0.0F}; + float z{0.0F}; + float intensity{0.0F}; + uint16_t ring{0U}; + float azimuth{0.0F}; + float distance{0.0F}; + uint8_t return_type{0U}; + double time_stamp{0.0}; + friend bool operator==(const PointXYZIRADRT & p1, const PointXYZIRADRT & p2) noexcept + { + return float_eq(p1.x, p2.x) && float_eq(p1.y, p2.y) && + float_eq(p1.z, p2.z) && float_eq(p1.intensity, p2.intensity) && + p1.ring == p2.ring && float_eq(p1.azimuth, p2.azimuth) && + float_eq(p1.distance, p2.distance) && p1.return_type == p2.return_type && + float_eq(p1.time_stamp, p2.time_stamp); + } +}; + +struct PointXYZIRCAEDT +{ + float x{0.0F}; + float y{0.0F}; + float z{0.0F}; + std::uint8_t intensity{0U}; + std::uint8_t return_type{0U}; + std::uint16_t channel{0U}; + float azimuth{0.0F}; + float elevation{0.0F}; + float distance{0.0F}; + std::uint32_t time_stamp{0U}; + + friend bool operator==(const PointXYZIRCAEDT & p1, const PointXYZIRCAEDT & p2) noexcept + { + return float_eq(p1.x, p2.x) && float_eq(p1.y, p2.y) && + float_eq(p1.z, p2.z) && p1.intensity == p2.intensity && + p1.return_type == p2.return_type && p1.channel == p2.channel && + float_eq(p1.azimuth, p2.azimuth) && float_eq(p1.distance, p2.distance) && + p1.time_stamp == p2.time_stamp; + } +}; + +enum class PointXYZIIndex { X, Y, Z, Intensity }; +enum class PointXYZIRCIndex { X, Y, Z, Intensity, ReturnType, Channel }; +enum class PointXYZIRADRTIndex { + X, + Y, + Z, + Intensity, + Ring, + Azimuth, + Distance, + ReturnType, + TimeStamp +}; +enum class PointXYZIRCAEDTIndex { + X, + Y, + Z, + Intensity, + ReturnType, + Channel, + Azimuth, + Elevation, + Distance, + TimeStamp +}; + +LIDAR_UTILS__DEFINE_FIELD_GENERATOR_FOR_MEMBER(azimuth); +LIDAR_UTILS__DEFINE_FIELD_GENERATOR_FOR_MEMBER(elevation); +LIDAR_UTILS__DEFINE_FIELD_GENERATOR_FOR_MEMBER(distance); +LIDAR_UTILS__DEFINE_FIELD_GENERATOR_FOR_MEMBER(return_type); +LIDAR_UTILS__DEFINE_FIELD_GENERATOR_FOR_MEMBER(time_stamp); + +LIDAR_UTILS__DEFINE_FIELD_GENERATOR_FOR_MEMBER(channel); + +using PointXYZIRCGenerator = std::tuple< + point_cloud_msg_wrapper::field_x_generator, point_cloud_msg_wrapper::field_y_generator, + point_cloud_msg_wrapper::field_z_generator, point_cloud_msg_wrapper::field_intensity_generator, + field_return_type_generator, field_channel_generator>; + +using PointXYZIRADRTGenerator = std::tuple< + point_cloud_msg_wrapper::field_x_generator, point_cloud_msg_wrapper::field_y_generator, + point_cloud_msg_wrapper::field_z_generator, point_cloud_msg_wrapper::field_intensity_generator, + point_cloud_msg_wrapper::field_ring_generator, field_azimuth_generator, field_distance_generator, + field_return_type_generator, field_time_stamp_generator>; + +using PointXYZIRCAEDTGenerator = std::tuple< + point_cloud_msg_wrapper::field_x_generator, point_cloud_msg_wrapper::field_y_generator, + point_cloud_msg_wrapper::field_z_generator, point_cloud_msg_wrapper::field_intensity_generator, + field_return_type_generator, field_channel_generator, field_azimuth_generator, + field_elevation_generator, field_distance_generator, field_time_stamp_generator>; + +} // namespace autoware::point_types + +POINT_CLOUD_REGISTER_POINT_STRUCT( + autoware::point_types::PointXYZIRC, + (float, x, x)(float, y, y)(float, z, z)(std::uint8_t, intensity, intensity)( + std::uint8_t, return_type, return_type)(std::uint16_t, channel, channel)) + +POINT_CLOUD_REGISTER_POINT_STRUCT( + autoware::point_types::PointXYZIRADRT, + (float, x, x)(float, y, y)(float, z, z)(float, intensity, intensity)(std::uint16_t, ring, ring)( + float, azimuth, azimuth)(float, distance, distance)(std::uint8_t, return_type, return_type)( + double, time_stamp, time_stamp)) + +POINT_CLOUD_REGISTER_POINT_STRUCT( + autoware::point_types::PointXYZIRCAEDT, + (float, x, x)(float, y, y)(float, z, z)(std::uint8_t, intensity, intensity)( + std::uint8_t, return_type, + return_type)(std::uint16_t, channel, channel)(float, azimuth, azimuth)( + float, elevation, elevation)(float, distance, distance)(std::uint32_t, time_stamp, time_stamp)) +#endif // AUTOWARE__POINT_TYPES__TYPES_HPP_ diff --git a/common/autoware_point_types/package.xml b/common/autoware_point_types/package.xml new file mode 100644 index 0000000000..e35e6a63de --- /dev/null +++ b/common/autoware_point_types/package.xml @@ -0,0 +1,34 @@ + + + + autoware_point_types + 0.40.0 + The point types definition to use point_cloud_msg_wrapper + David Wong + Max Schmeller + Apache License 2.0 + + ament_cmake_core + ament_cmake_export_dependencies + ament_cmake_test + autoware_cmake + + ament_cmake_core + ament_cmake_test + + ament_cmake_copyright + ament_cmake_cppcheck + ament_cmake_lint_cmake + ament_cmake_xmllint + pcl_ros + point_cloud_msg_wrapper + + ament_cmake_ros + ament_lint_auto + autoware_lint_common + point_cloud_msg_wrapper + + + ament_cmake + + diff --git a/common/autoware_point_types/test/test_point_types.cpp b/common/autoware_point_types/test/test_point_types.cpp new file mode 100644 index 0000000000..08696a9948 --- /dev/null +++ b/common/autoware_point_types/test/test_point_types.cpp @@ -0,0 +1,66 @@ +// Copyright 2021 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. + +#include "autoware/point_types/types.hpp" + +#include + +#include + +TEST(PointEquality, PointXYZI) +{ + using autoware::point_types::PointXYZI; + + PointXYZI pt0{0, 1, 2, 3}; + PointXYZI pt1{0, 1, 2, 3}; + EXPECT_EQ(pt0, pt1); +} + +TEST(PointEquality, PointXYZIRADRT) +{ + using autoware::point_types::PointXYZIRADRT; + + PointXYZIRADRT pt0{0, 1, 2, 3, 4, 5, 6, 7, 8}; + PointXYZIRADRT pt1{0, 1, 2, 3, 4, 5, 6, 7, 8}; + EXPECT_EQ(pt0, pt1); +} + +TEST(PointEquality, PointXYZIRCAEDT) +{ + using autoware::point_types::PointXYZIRCAEDT; + + PointXYZIRCAEDT pt0{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + PointXYZIRCAEDT pt1{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + EXPECT_EQ(pt0, pt1); +} + +TEST(PointEquality, FloatEq) +{ + // test template + EXPECT_TRUE(autoware::point_types::float_eq(1, 1)); + EXPECT_TRUE(autoware::point_types::float_eq(1, 1)); + + // test floating point error + EXPECT_TRUE(autoware::point_types::float_eq(1, 1 + std::numeric_limits::epsilon())); + + // test difference of sign + EXPECT_FALSE(autoware::point_types::float_eq(2, -2)); + EXPECT_FALSE(autoware::point_types::float_eq(-2, 2)); + + // small value difference + EXPECT_FALSE(autoware::point_types::float_eq(2, 2 + 10e-6)); + + // expect same value if epsilon is larger than difference + EXPECT_TRUE(autoware::point_types::float_eq(2, 2 + 10e-6, 10e-5)); +} From 1e9d30a17caeb51dbe391f313bb00fff20eb5d76 Mon Sep 17 00:00:00 2001 From: liu cui Date: Mon, 6 Jan 2025 11:26:12 +0800 Subject: [PATCH 2/6] chore: remove change log and reset version to 0.0.0 Signed-off-by: liu cui --- common/autoware_point_types/CHANGELOG.rst | 150 ---------------------- common/autoware_point_types/package.xml | 2 +- 2 files changed, 1 insertion(+), 151 deletions(-) delete mode 100644 common/autoware_point_types/CHANGELOG.rst diff --git a/common/autoware_point_types/CHANGELOG.rst b/common/autoware_point_types/CHANGELOG.rst deleted file mode 100644 index 5e26002677..0000000000 --- a/common/autoware_point_types/CHANGELOG.rst +++ /dev/null @@ -1,150 +0,0 @@ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Changelog for package autoware_point_types -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -0.40.0 (2024-12-12) -------------------- -* Revert "chore(package.xml): bump version to 0.39.0 (`#9587 `_)" - This reverts commit c9f0f2688c57b0f657f5c1f28f036a970682e7f5. -* fix: fix ticket links in CHANGELOG.rst (`#9588 `_) -* chore(package.xml): bump version to 0.39.0 (`#9587 `_) - * chore(package.xml): bump version to 0.39.0 - * fix: fix ticket links in CHANGELOG.rst - * fix: remove unnecessary diff - --------- - Co-authored-by: Yutaka Kondo -* fix: fix ticket links in CHANGELOG.rst (`#9588 `_) -* 0.39.0 -* update changelog -* fix: fix ticket links to point to https://github.com/autowarefoundation/autoware.universe (`#9304 `_) -* fix: fix ticket links to point to https://github.com/autowarefoundation/autoware.universe (`#9304 `_) -* chore(package.xml): bump version to 0.38.0 (`#9266 `_) (`#9284 `_) - * unify package.xml version to 0.37.0 - * remove system_monitor/CHANGELOG.rst - * add changelog - * 0.38.0 - --------- -* Contributors: Esteve Fernandez, Fumiya Watanabe, Ryohsuke Mitsudome, Yutaka Kondo - -0.39.0 (2024-11-25) -------------------- -* fix: fix ticket links to point to https://github.com/autowarefoundation/autoware.universe (`#9304 `_) -* fix: fix ticket links to point to https://github.com/autowarefoundation/autoware.universe (`#9304 `_) -* chore(package.xml): bump version to 0.38.0 (`#9266 `_) (`#9284 `_) - * unify package.xml version to 0.37.0 - * remove system_monitor/CHANGELOG.rst - * add changelog - * 0.38.0 - --------- -* Contributors: Esteve Fernandez, Yutaka Kondo - -0.38.0 (2024-11-08) -------------------- -* unify package.xml version to 0.37.0 -* refactor(autoware_point_types): prefix namespace with autoware::point_types (`#9169 `_) -* feat: migrating pointcloud types (`#6996 `_) - * feat: changed most of sensing to the new type - * chore: started applying changes to the perception stack - * feat: confirmed operation until centerpoint - * feat: reverted to the original implementation of pointpainting - * chore: forgot to push a header - * feat: also implemented the changes for the subsample filters that were out of scope before - * fix: some point type changes were missing from the latest merge from main - * chore: removed unused code, added comments, and brought back a removed publish - * chore: replaced pointcloud_raw for pointcloud_raw_ex to avoid extra processing time in the drivers - * feat: added memory layout checks - * chore: updated documentation regarding the point types - * chore: added hyperlinks to the point definitions. will be valid only once the PR is merged - * fix: fixed compilation due to moving the utilities files to the base library - * chore: separated the utilities functions due to a dependency issue - * chore: forgot that perception also uses the filter class - * feature: adapted the undistortion tests to the new point type - --------- - Co-authored-by: kminoda <44218668+kminoda@users.noreply.github.com> - Co-authored-by: badai nguyen <94814556+badai-nguyen@users.noreply.github.com> -* chore: updated maintainers for the autoware_point_types package (`#7797 `_) -* docs(common): adding .pages file (`#7148 `_) - * docs(common): adding .pages file - * fix naming - * fix naming - * fix naming - * include main page plus explanation to autoware tools - * style(pre-commit): autofix - --------- - Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> -* Contributors: Esteve Fernandez, Kenzo Lobos Tsunekawa, Yutaka Kondo, Zulfaqar Azmi - -0.26.0 (2024-04-03) -------------------- -* build: mark autoware_cmake as (`#3616 `_) - * build: mark autoware_cmake as - with , autoware_cmake is automatically exported with ament_target_dependencies() (unecessary) - * style(pre-commit): autofix - * chore: fix pre-commit errors - --------- - Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> - Co-authored-by: Kenji Miyake -* feat: isolate gtests in all packages (`#693 `_) -* chore: upgrade cmake_minimum_required to 3.14 (`#856 `_) -* refactor: use autoware cmake (`#849 `_) - * remove autoware_auto_cmake - * add build_depend of autoware_cmake - * use autoware_cmake in CMakeLists.txt - * fix bugs - * fix cmake lint errors -* feat: add blockage diagnostics (`#461 `_) - * feat!: add blockage diagnostic - * fix: typo - * docs: add documentation - * ci(pre-commit): autofix - * fix: typo - * ci(pre-commit): autofix - * fix: typo - * chore: add adjustable param - * ci(pre-commit): autofix - * feat!: add blockage diagnostic - * fix: typo - * docs: add documentation - * ci(pre-commit): autofix - * fix: typo - * ci(pre-commit): autofix - * fix: typo - * chore: add adjustable param - * ci(pre-commit): autofix - * chore: rearrange header file - * chore: fix typo - * chore: rearrange header - * fix: revert accident change - * chore: fix typo - * docs: add limits - * chore: check overflow - Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> -* ci: check include guard (`#438 `_) - * ci: check include guard - * apply pre-commit - * Update .pre-commit-config.yaml - Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> - * fix: pre-commit - Co-authored-by: Kenji Miyake - Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> -* feat: add point_types for wrapper (`#784 `_) (`#215 `_) - * add point_types - * Revert "add point_types" - This reverts commit 5810000cd1cbd876bc22372e2bb74ccaca06187b. - * create autoware_point_types pkg - * add include - * add cmath - * fix author - * fix bug - * define epsilon as argument - * add test - * remove unnamed namespace - * update test - * fix test name - * use std::max - * change comparison method - * remove unnencessary line - * fix test - * fix comparison method name - Co-authored-by: Taichi Higashide -* Contributors: Daisuke Nishimatsu, Kenji Miyake, Maxime CLEMENT, Takagi, Isamu, Vincent Richard, badai nguyen diff --git a/common/autoware_point_types/package.xml b/common/autoware_point_types/package.xml index e35e6a63de..dd7dd58752 100644 --- a/common/autoware_point_types/package.xml +++ b/common/autoware_point_types/package.xml @@ -2,7 +2,7 @@ autoware_point_types - 0.40.0 + 0.0.0 The point types definition to use point_cloud_msg_wrapper David Wong Max Schmeller From 87478d5ab7a89f3a5a5b1f996aba0d87adfc0e90 Mon Sep 17 00:00:00 2001 From: liu cui Date: Mon, 6 Jan 2025 11:39:59 +0800 Subject: [PATCH 3/6] add myself as maintainer Signed-off-by: liu cui --- common/autoware_point_types/package.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/common/autoware_point_types/package.xml b/common/autoware_point_types/package.xml index dd7dd58752..73db182947 100644 --- a/common/autoware_point_types/package.xml +++ b/common/autoware_point_types/package.xml @@ -6,6 +6,7 @@ The point types definition to use point_cloud_msg_wrapper David Wong Max Schmeller + Cynthia Liu Apache License 2.0 ament_cmake_core From ee8dad1fe46d288e4a0dc6f8fa8e8362cfca2d0f Mon Sep 17 00:00:00 2001 From: liu cui Date: Mon, 6 Jan 2025 16:57:44 +0800 Subject: [PATCH 4/6] docs: finish README.md Signed-off-by: liu cui --- common/autoware_point_types/README.md | 67 +++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/common/autoware_point_types/README.md b/common/autoware_point_types/README.md index 92f19d2bc3..039e294a46 100644 --- a/common/autoware_point_types/README.md +++ b/common/autoware_point_types/README.md @@ -1 +1,68 @@ # Autoware Point Types + +## Overview + +This package provides a variety of structures to represent different types of point cloud data, mainly used for point cloud processing and analysis. + +## Design + +### Point cloud data type definition + +`autoware_point_types` defines multiple structures (such as PointXYZI, PointXYZIRC, PointXYZIRADRT, PointXYZIRCAEDT), each structure contains different attributes to adapt to different application scenarios. + +- `autoware::point_types::PointXYZI`: Point type with intensity information. +- `autoware::point_types::PointXYZIRC`: Extended PointXYZI, adds return_type and channel information. +- `autoware::point_types::PointXYZIRADRT`: Extended PointXYZI, adds ring, azimuth, distance, return_type and time_stamp information. +- `autoware::point_types::PointXYZIRCAEDT`: Similar to PointXYZIRADRT, but adds elevation information and uses `std::uint32_t` as the data type for time_stamp. + +### Operator overload + +Each structure overloads the `==` operator, allowing users to easily compare whether two points are equal, which is very useful for deduplication and matching of point cloud data. + +### Field generators + +The field generator is implemented using macro definitions and std::tuple, which simplifies the serialization and deserialization process of point cloud messages and improves the reusability and readability of the code. + +### Registration mechanism + +Register custom point cloud structures into the PCL library through the macro `POINT_CLOUD_REGISTER_POINT_STRUCT`, so that these structures can be directly integrated with other functions of the PCL library. + +## Usage + +1. Create a point cloud object of PointXYZIRC type + +```cpp +#include "autoware/point_types/types.hpp" + +int main(){ + pcl::PointCloud::Ptr cloud(new pcl::PointCloud()); + + for (int i = 0; i < 5; ++i) { + autoware::point_types::PointXYZIRC point; + point.x = static_cast(i * 0.1); + point.y = static_cast(i * 0.2); + point.z = static_cast(i * 0.3); + point.intensity = static_cast(i * 10); + point.return_type = autoware::point_types::ReturnType::SINGLE_STRONGEST; + point.channel = static_cast(i); + + cloud->points.push_back(point); + } + cloud->width = cloud->points.size(); + cloud->height = 1; + + return 0; +} +``` + +2. Convert ROS message to point cloud of PointXYZIRC type + +```cpp +ExampleNode::points_callback(const PointCloud2::ConstSharedPtr & points_msg_ptr) +{ + pcl::PointCloud::Ptr points_ptr( + new pcl::PointCloud); + + pcl::fromROSMsg(*points_msg_ptr, *points_ptr); +} +``` \ No newline at end of file From 548bf1bc83e71fcebbfcbdde5aab1a984d78b2a2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 08:59:51 +0000 Subject: [PATCH 5/6] style(pre-commit): autofix --- common/autoware_point_types/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/autoware_point_types/README.md b/common/autoware_point_types/README.md index 039e294a46..9a5375205d 100644 --- a/common/autoware_point_types/README.md +++ b/common/autoware_point_types/README.md @@ -65,4 +65,4 @@ ExampleNode::points_callback(const PointCloud2::ConstSharedPtr & points_msg_ptr) pcl::fromROSMsg(*points_msg_ptr, *points_ptr); } -``` \ No newline at end of file +``` From cf969578702315dcca598f32ca498a7d12748294 Mon Sep 17 00:00:00 2001 From: liu cui Date: Mon, 6 Jan 2025 17:26:03 +0800 Subject: [PATCH 6/6] fix: fix pre-commit.ci error Signed-off-by: liu cui --- common/autoware_point_types/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/autoware_point_types/README.md b/common/autoware_point_types/README.md index 9a5375205d..5a14d68f4e 100644 --- a/common/autoware_point_types/README.md +++ b/common/autoware_point_types/README.md @@ -29,7 +29,7 @@ Register custom point cloud structures into the PCL library through the macro `P ## Usage -1. Create a point cloud object of PointXYZIRC type +- Create a point cloud object of PointXYZIRC type ```cpp #include "autoware/point_types/types.hpp" @@ -55,7 +55,7 @@ int main(){ } ``` -2. Convert ROS message to point cloud of PointXYZIRC type +- Convert ROS message to point cloud of PointXYZIRC type ```cpp ExampleNode::points_callback(const PointCloud2::ConstSharedPtr & points_msg_ptr)