diff --git a/launch/tier4_perception_launch/launch/perception.launch.xml b/launch/tier4_perception_launch/launch/perception.launch.xml index 9f325466ed107..ffa6291257b87 100644 --- a/launch/tier4_perception_launch/launch/perception.launch.xml +++ b/launch/tier4_perception_launch/launch/perception.launch.xml @@ -287,7 +287,7 @@ - + diff --git a/launch/tier4_simulator_launch/launch/simulator.launch.xml b/launch/tier4_simulator_launch/launch/simulator.launch.xml index a879340bc4d0c..f77611f664116 100644 --- a/launch/tier4_simulator_launch/launch/simulator.launch.xml +++ b/launch/tier4_simulator_launch/launch/simulator.launch.xml @@ -47,7 +47,7 @@ - + @@ -111,7 +111,7 @@ - + diff --git a/launch/tier4_simulator_launch/package.xml b/launch/tier4_simulator_launch/package.xml index f12209f4ab3ef..030c7ab143255 100644 --- a/launch/tier4_simulator_launch/package.xml +++ b/launch/tier4_simulator_launch/package.xml @@ -14,9 +14,9 @@ ament_cmake_auto autoware_cmake + autoware_dummy_perception_publisher autoware_fault_injection autoware_simple_planning_simulator - dummy_perception_publisher ament_lint_auto autoware_lint_common diff --git a/simulator/dummy_perception_publisher/CHANGELOG.rst b/simulator/autoware_dummy_perception_publisher/CHANGELOG.rst similarity index 99% rename from simulator/dummy_perception_publisher/CHANGELOG.rst rename to simulator/autoware_dummy_perception_publisher/CHANGELOG.rst index 50b2396ae0311..ada832a084f22 100644 --- a/simulator/dummy_perception_publisher/CHANGELOG.rst +++ b/simulator/autoware_dummy_perception_publisher/CHANGELOG.rst @@ -1,6 +1,6 @@ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Changelog for package dummy_perception_publisher -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package autoware_dummy_perception_publisher +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 0.40.0 (2024-12-12) ------------------- diff --git a/simulator/dummy_perception_publisher/CMakeLists.txt b/simulator/autoware_dummy_perception_publisher/CMakeLists.txt similarity index 70% rename from simulator/dummy_perception_publisher/CMakeLists.txt rename to simulator/autoware_dummy_perception_publisher/CMakeLists.txt index 0acf4694d03a6..9ac146b182a9a 100644 --- a/simulator/dummy_perception_publisher/CMakeLists.txt +++ b/simulator/autoware_dummy_perception_publisher/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.14) -project(dummy_perception_publisher) +project(autoware_dummy_perception_publisher) find_package(autoware_cmake REQUIRED) autoware_package() @@ -23,19 +23,19 @@ ament_auto_add_library(signed_distance_function SHARED src/signed_distance_function.cpp ) -ament_auto_add_executable(dummy_perception_publisher_node +ament_auto_add_executable(${PROJECT_NAME}_node src/main.cpp src/node.cpp src/pointcloud_creator.cpp ) -target_link_libraries(dummy_perception_publisher_node +target_link_libraries(${PROJECT_NAME}_node signed_distance_function ) -ament_target_dependencies(dummy_perception_publisher_node ${${PROJECT_NAME}_DEPENDENCIES}) +ament_target_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_DEPENDENCIES}) -target_include_directories(dummy_perception_publisher_node +target_include_directories(${PROJECT_NAME}_node PUBLIC $ $) @@ -43,14 +43,14 @@ target_include_directories(dummy_perception_publisher_node # PCL dependencies - `ament_target_dependencies` doesn't respect the # components/modules selected above and only links in `common` ,so we need # to do this manually. -target_compile_definitions(dummy_perception_publisher_node PRIVATE ${PCL_DEFINITIONS}) -target_include_directories(dummy_perception_publisher_node PRIVATE ${PCL_INCLUDE_DIRS}) +target_compile_definitions(${PROJECT_NAME}_node PRIVATE ${PCL_DEFINITIONS}) +target_include_directories(${PROJECT_NAME}_node PRIVATE ${PCL_INCLUDE_DIRS}) # Unfortunately, this one can't be PRIVATE because only the plain or only the # keyword (PRIVATE) signature of target_link_libraries can be used for one # target, not both. The plain signature is already used inside # `ament_target_dependencies` and possibly rosidl_target_interfaces. -target_link_libraries(dummy_perception_publisher_node ${PCL_LIBRARIES}) -target_link_directories(dummy_perception_publisher_node PRIVATE ${PCL_LIBRARY_DIRS}) +target_link_libraries(${PROJECT_NAME}_node ${PCL_LIBRARIES}) +target_link_directories(${PROJECT_NAME}_node PRIVATE ${PCL_LIBRARY_DIRS}) ament_auto_add_executable(empty_objects_publisher diff --git a/simulator/dummy_perception_publisher/README.md b/simulator/autoware_dummy_perception_publisher/README.md similarity index 100% rename from simulator/dummy_perception_publisher/README.md rename to simulator/autoware_dummy_perception_publisher/README.md diff --git a/simulator/dummy_perception_publisher/include/dummy_perception_publisher/node.hpp b/simulator/autoware_dummy_perception_publisher/include/autoware/dummy_perception_publisher/node.hpp similarity index 94% rename from simulator/dummy_perception_publisher/include/dummy_perception_publisher/node.hpp rename to simulator/autoware_dummy_perception_publisher/include/autoware/dummy_perception_publisher/node.hpp index cf46ecddf516f..413ba4d82b836 100644 --- a/simulator/dummy_perception_publisher/include/dummy_perception_publisher/node.hpp +++ b/simulator/autoware_dummy_perception_publisher/include/autoware/dummy_perception_publisher/node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef DUMMY_PERCEPTION_PUBLISHER__NODE_HPP_ -#define DUMMY_PERCEPTION_PUBLISHER__NODE_HPP_ +#ifndef AUTOWARE__DUMMY_PERCEPTION_PUBLISHER__NODE_HPP_ +#define AUTOWARE__DUMMY_PERCEPTION_PUBLISHER__NODE_HPP_ #include @@ -41,6 +41,8 @@ #include #include +namespace autoware::dummy_perception_publisher +{ struct ObjectInfo { ObjectInfo( @@ -139,4 +141,6 @@ class DummyPerceptionPublisherNode : public rclcpp::Node ~DummyPerceptionPublisherNode() {} }; -#endif // DUMMY_PERCEPTION_PUBLISHER__NODE_HPP_ +} // namespace autoware::dummy_perception_publisher + +#endif // AUTOWARE__DUMMY_PERCEPTION_PUBLISHER__NODE_HPP_ diff --git a/simulator/dummy_perception_publisher/include/dummy_perception_publisher/signed_distance_function.hpp b/simulator/autoware_dummy_perception_publisher/include/autoware/dummy_perception_publisher/signed_distance_function.hpp similarity index 85% rename from simulator/dummy_perception_publisher/include/dummy_perception_publisher/signed_distance_function.hpp rename to simulator/autoware_dummy_perception_publisher/include/autoware/dummy_perception_publisher/signed_distance_function.hpp index abf24cb8dd4e6..349cbe42ec0bc 100644 --- a/simulator/dummy_perception_publisher/include/dummy_perception_publisher/signed_distance_function.hpp +++ b/simulator/autoware_dummy_perception_publisher/include/autoware/dummy_perception_publisher/signed_distance_function.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef DUMMY_PERCEPTION_PUBLISHER__SIGNED_DISTANCE_FUNCTION_HPP_ -#define DUMMY_PERCEPTION_PUBLISHER__SIGNED_DISTANCE_FUNCTION_HPP_ +#ifndef AUTOWARE__DUMMY_PERCEPTION_PUBLISHER__SIGNED_DISTANCE_FUNCTION_HPP_ +#define AUTOWARE__DUMMY_PERCEPTION_PUBLISHER__SIGNED_DISTANCE_FUNCTION_HPP_ #include @@ -23,7 +23,7 @@ #include #include -namespace signed_distance_function +namespace autoware::dummy_perception_publisher { class AbstractSignedDistanceFunction @@ -69,6 +69,6 @@ class CompositeSDF : public AbstractSignedDistanceFunction std::vector> sdf_ptrs_; }; -} // namespace signed_distance_function +} // namespace autoware::dummy_perception_publisher -#endif // DUMMY_PERCEPTION_PUBLISHER__SIGNED_DISTANCE_FUNCTION_HPP_ +#endif // AUTOWARE__DUMMY_PERCEPTION_PUBLISHER__SIGNED_DISTANCE_FUNCTION_HPP_ diff --git a/simulator/dummy_perception_publisher/launch/dummy_perception_publisher.launch.xml b/simulator/autoware_dummy_perception_publisher/launch/dummy_perception_publisher.launch.xml similarity index 90% rename from simulator/dummy_perception_publisher/launch/dummy_perception_publisher.launch.xml rename to simulator/autoware_dummy_perception_publisher/launch/dummy_perception_publisher.launch.xml index 41025f74cbe50..ed9c38f7dc9b5 100644 --- a/simulator/dummy_perception_publisher/launch/dummy_perception_publisher.launch.xml +++ b/simulator/autoware_dummy_perception_publisher/launch/dummy_perception_publisher.launch.xml @@ -9,7 +9,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/simulator/dummy_perception_publisher/package.xml b/simulator/autoware_dummy_perception_publisher/package.xml similarity index 85% rename from simulator/dummy_perception_publisher/package.xml rename to simulator/autoware_dummy_perception_publisher/package.xml index 4f78acd6c07f2..6c75a9b3c0277 100644 --- a/simulator/dummy_perception_publisher/package.xml +++ b/simulator/autoware_dummy_perception_publisher/package.xml @@ -1,10 +1,11 @@ - dummy_perception_publisher + autoware_dummy_perception_publisher 0.40.0 - The dummy_perception_publisher package + The autoware_dummy_perception_publisher package Yukihiro Saito + Junya Sasaki Apache License 2.0 ament_cmake_auto diff --git a/simulator/dummy_perception_publisher/src/empty_objects_publisher.cpp b/simulator/autoware_dummy_perception_publisher/src/empty_objects_publisher.cpp similarity index 89% rename from simulator/dummy_perception_publisher/src/empty_objects_publisher.cpp rename to simulator/autoware_dummy_perception_publisher/src/empty_objects_publisher.cpp index 2d1ea626fb1ac..2a2a1d89ffcb8 100644 --- a/simulator/dummy_perception_publisher/src/empty_objects_publisher.cpp +++ b/simulator/autoware_dummy_perception_publisher/src/empty_objects_publisher.cpp @@ -19,6 +19,9 @@ #include #include +namespace autoware::dummy_perception_publisher +{ + class EmptyObjectsPublisher : public rclcpp::Node { public: @@ -45,10 +48,12 @@ class EmptyObjectsPublisher : public rclcpp::Node } }; +} // namespace autoware::dummy_perception_publisher + int main(int argc, char ** argv) { rclcpp::init(argc, argv); - rclcpp::spin(std::make_shared()); + rclcpp::spin(std::make_shared()); rclcpp::shutdown(); return 0; } diff --git a/simulator/dummy_perception_publisher/src/main.cpp b/simulator/autoware_dummy_perception_publisher/src/main.cpp similarity index 81% rename from simulator/dummy_perception_publisher/src/main.cpp rename to simulator/autoware_dummy_perception_publisher/src/main.cpp index 5e627f2cbc8ed..224074f15f3c5 100644 --- a/simulator/dummy_perception_publisher/src/main.cpp +++ b/simulator/autoware_dummy_perception_publisher/src/main.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "dummy_perception_publisher/node.hpp" +#include "autoware/dummy_perception_publisher/node.hpp" #include @@ -21,7 +21,8 @@ int main(int argc, char ** argv) { rclcpp::init(argc, argv); - rclcpp::spin(std::make_shared()); + rclcpp::spin( + std::make_shared()); rclcpp::shutdown(); return 0; diff --git a/simulator/dummy_perception_publisher/src/node.cpp b/simulator/autoware_dummy_perception_publisher/src/node.cpp similarity index 99% rename from simulator/dummy_perception_publisher/src/node.cpp rename to simulator/autoware_dummy_perception_publisher/src/node.cpp index d72b16d303cec..22797e252813c 100644 --- a/simulator/dummy_perception_publisher/src/node.cpp +++ b/simulator/autoware_dummy_perception_publisher/src/node.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "dummy_perception_publisher/node.hpp" +#include "autoware/dummy_perception_publisher/node.hpp" #include "autoware/universe_utils/geometry/geometry.hpp" @@ -35,6 +35,9 @@ #include #include +namespace autoware::dummy_perception_publisher +{ + using autoware_perception_msgs::msg::TrackedObject; using autoware_perception_msgs::msg::TrackedObjects; @@ -428,3 +431,5 @@ void DummyPerceptionPublisherNode::objectCallback( } } } + +} // namespace autoware::dummy_perception_publisher diff --git a/simulator/dummy_perception_publisher/src/pointcloud_creator.cpp b/simulator/autoware_dummy_perception_publisher/src/pointcloud_creator.cpp similarity index 96% rename from simulator/dummy_perception_publisher/src/pointcloud_creator.cpp rename to simulator/autoware_dummy_perception_publisher/src/pointcloud_creator.cpp index 977336f63eee3..a2f84841e4ff2 100644 --- a/simulator/dummy_perception_publisher/src/pointcloud_creator.cpp +++ b/simulator/autoware_dummy_perception_publisher/src/pointcloud_creator.cpp @@ -1,4 +1,4 @@ -// Copyright 2020 Tier IV, Inc. +// Copyright 2025 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. @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "dummy_perception_publisher/node.hpp" -#include "dummy_perception_publisher/signed_distance_function.hpp" +#include "autoware/dummy_perception_publisher/node.hpp" +#include "autoware/dummy_perception_publisher/signed_distance_function.hpp" #include @@ -26,7 +26,7 @@ #include #include -namespace +namespace autoware::dummy_perception_publisher { static constexpr double epsilon = 0.001; @@ -45,8 +45,6 @@ pcl::PointXYZ getPointWrtBaseLink( return pcl::PointXYZ(p_wrt_base.x(), p_wrt_base.y(), p_wrt_base.z()); } -} // namespace - void ObjectCentricPointCloudCreator::create_object_pointcloud( const ObjectInfo & obj_info, const tf2::Transform & tf_base_link2map, std::mt19937 & random_generator, pcl::PointCloud::Ptr pointcloud) const @@ -200,13 +198,13 @@ std::vector::Ptr> EgoCentricPointCloudCreator::cr const std::vector & obj_infos, const tf2::Transform & tf_base_link2map, std::mt19937 & random_generator, pcl::PointCloud::Ptr & merged_pointcloud) const { - std::vector> sdf_ptrs; + std::vector> sdf_ptrs; for (const auto & obj_info : obj_infos) { - const auto sdf_ptr = std::make_shared( + const auto sdf_ptr = std::make_shared( obj_info.length, obj_info.width, tf_base_link2map * obj_info.tf_map2moved_object); sdf_ptrs.push_back(sdf_ptr); } - const auto composite_sdf = signed_distance_function::CompositeSDF(sdf_ptrs); + const auto composite_sdf = CompositeSDF(sdf_ptrs); std::vector::Ptr> pointclouds(obj_infos.size()); for (size_t i = 0; i < obj_infos.size(); ++i) { @@ -261,3 +259,5 @@ std::vector::Ptr> EgoCentricPointCloudCreator::cr } return pointclouds; } + +} // namespace autoware::dummy_perception_publisher diff --git a/simulator/dummy_perception_publisher/src/signed_distance_function.cpp b/simulator/autoware_dummy_perception_publisher/src/signed_distance_function.cpp similarity index 94% rename from simulator/dummy_perception_publisher/src/signed_distance_function.cpp rename to simulator/autoware_dummy_perception_publisher/src/signed_distance_function.cpp index 01bef1851b25e..c6a720e33fefa 100644 --- a/simulator/dummy_perception_publisher/src/signed_distance_function.cpp +++ b/simulator/autoware_dummy_perception_publisher/src/signed_distance_function.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "dummy_perception_publisher/signed_distance_function.hpp" +#include "autoware/dummy_perception_publisher/signed_distance_function.hpp" #include @@ -20,7 +20,7 @@ #include #include -namespace signed_distance_function +namespace autoware::dummy_perception_publisher { double AbstractSignedDistanceFunction::getSphereTracingDist( @@ -89,4 +89,4 @@ size_t CompositeSDF::nearest_sdf_index(double x, double y) const return idx_min; } -} // namespace signed_distance_function +} // namespace autoware::dummy_perception_publisher diff --git a/simulator/dummy_perception_publisher/test/src/test_signed_distance_function.cpp b/simulator/autoware_dummy_perception_publisher/test/src/test_signed_distance_function.cpp similarity index 82% rename from simulator/dummy_perception_publisher/test/src/test_signed_distance_function.cpp rename to simulator/autoware_dummy_perception_publisher/test/src/test_signed_distance_function.cpp index 5b8dcee549ea7..e7bb667a1dec2 100644 --- a/simulator/dummy_perception_publisher/test/src/test_signed_distance_function.cpp +++ b/simulator/autoware_dummy_perception_publisher/test/src/test_signed_distance_function.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "dummy_perception_publisher/signed_distance_function.hpp" +#include "autoware/dummy_perception_publisher/signed_distance_function.hpp" #include #include @@ -23,7 +23,8 @@ #include #include -namespace sdf = signed_distance_function; +namespace autoware::dummy_perception_publisher +{ TEST(SignedDistanceFunctionTest, BoxSDF) { @@ -33,7 +34,7 @@ TEST(SignedDistanceFunctionTest, BoxSDF) // test with identity transform const auto q = tf2::Quaternion(tf2::Vector3(0, 0, 1.0), 0.0); const auto tf_global2local = tf2::Transform(q); - const auto func = sdf::BoxSDF(1., 2., tf_global2local); + const auto func = BoxSDF(1., 2., tf_global2local); ASSERT_NEAR(func(0.0, 0.0), -0.5, eps); ASSERT_NEAR(func(0.0, 1.0), 0.0, eps); ASSERT_NEAR(func(0.0, 1.5), 0.5, eps); @@ -50,7 +51,7 @@ TEST(SignedDistanceFunctionTest, BoxSDF) // test with rotation (90 deg) and translation const auto q = tf2::Quaternion(tf2::Vector3(0, 0, 1.0), M_PI * 0.5); const auto tf_global2local = tf2::Transform(q, tf2::Vector3(1.0, 1.0, 0.0)); - const auto func = sdf::BoxSDF(1., 2., tf_global2local); + const auto func = BoxSDF(1., 2., tf_global2local); ASSERT_NEAR(func(1.0, 1.0), -0.5, eps); ASSERT_NEAR(func(0.0, 0.0), 0.5, eps); @@ -63,11 +64,11 @@ TEST(SignedDistanceFunctionTest, CompositeSDF) const double eps = 1e-5; const auto q_identity = tf2::Quaternion(tf2::Vector3(0, 0, 1.0), 0.0); const auto f1 = - std::make_shared(1., 1., tf2::Transform(q_identity, tf2::Vector3(0, 0, 0))); + std::make_shared(1., 1., tf2::Transform(q_identity, tf2::Vector3(0, 0, 0))); const auto f2 = - std::make_shared(1., 1., tf2::Transform(q_identity, tf2::Vector3(0, 2.0, 0))); + std::make_shared(1., 1., tf2::Transform(q_identity, tf2::Vector3(0, 2.0, 0))); const auto func = - sdf::CompositeSDF(std::vector>{f1, f2}); + CompositeSDF(std::vector>{f1, f2}); ASSERT_NEAR(func(0.0, 0.9), 0.4, eps); ASSERT_NEAR(func(0.0, 1.1), 0.4, eps); ASSERT_NEAR(func(0.0, 0.1), -0.4, eps); @@ -77,6 +78,8 @@ TEST(SignedDistanceFunctionTest, CompositeSDF) // ASSERT_NEAR(func.getSphereTracingDist(0.0, 1.0, M_PI * -0.5, eps), 0.5, eps); } +} // namespace autoware::dummy_perception_publisher + int main(int argc, char ** argv) { testing::InitGoogleTest(&argc, argv);