Skip to content

Commit b3db29e

Browse files
committed
chore: remove unnecessary dependencies and rework package structure
Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
1 parent 9b50ae2 commit b3db29e

File tree

8 files changed

+65
-52
lines changed

8 files changed

+65
-52
lines changed

perception/detection_by_tracker/CMakeLists.txt

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@ include_directories(
2626

2727
# Generate exe file
2828
set(DETECTION_BY_TRACKER_SRC
29-
src/detection_by_tracker_core.cpp
30-
src/utils.cpp
29+
src/detection_by_tracker_node.cpp
30+
src/utils/utils.cpp
3131
)
3232

33-
ament_auto_add_library(detection_by_tracker_node SHARED
33+
ament_auto_add_library(${PROJECT_NAME} SHARED
3434
${DETECTION_BY_TRACKER_SRC}
3535
)
3636

37-
target_link_libraries(detection_by_tracker_node
37+
target_link_libraries(${PROJECT_NAME}
3838
Eigen3::Eigen
3939
${PCL_LIBRARIES}
4040
)
4141

42-
rclcpp_components_register_node(detection_by_tracker_node
43-
PLUGIN "DetectionByTracker"
44-
EXECUTABLE detection_by_tracker
42+
rclcpp_components_register_node(${PROJECT_NAME}
43+
PLUGIN "autoware::detection_by_tracker::DetectionByTracker"
44+
EXECUTABLE detection_by_tracker_node
4545
)
4646

4747
ament_auto_package(

perception/detection_by_tracker/launch/detection_by_tracker.launch.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<arg name="input/initial_objects" default="/perception/object_recognition/detection/clustering/objects_with_feature"/>
55
<arg name="output" default="objects"/>
66
<arg name="detection_by_tracker_param_path" default="$(find-pkg-share detection_by_tracker)/config/detection_by_tracker.param.yaml"/>
7-
<node pkg="detection_by_tracker" exec="detection_by_tracker" name="detection_by_tracker_node" output="screen">
7+
<node pkg="detection_by_tracker" exec="detection_by_tracker_node" name="detection_by_tracker_node" output="screen">
88
<remap from="~/input/tracked_objects" to="$(var input/tracked_objects)"/>
99
<remap from="~/input/initial_objects" to="$(var input/initial_objects)"/>
1010
<remap from="~/output" to="$(var output)"/>

perception/detection_by_tracker/package.xml

-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
<depend>autoware_universe_utils</depend>
1717
<depend>eigen</depend>
1818
<depend>euclidean_cluster</depend>
19-
<depend>libpcl-all-dev</depend>
2019
<depend>object_recognition_utils</depend>
21-
<depend>pcl_conversions</depend>
2220
<depend>rclcpp</depend>
2321
<depend>rclcpp_components</depend>
2422
<depend>shape_estimation</depend>

perception/detection_by_tracker/include/detection_by_tracker/debugger.hpp perception/detection_by_tracker/src/debugger/debugger.hpp

+16-12
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,23 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef DETECTION_BY_TRACKER__DEBUGGER_HPP_
16-
#define DETECTION_BY_TRACKER__DEBUGGER_HPP_
15+
#ifndef DEBUGGER__DEBUGGER_HPP_
16+
#define DEBUGGER__DEBUGGER_HPP_
17+
18+
#include "autoware/universe_utils/ros/debug_publisher.hpp"
19+
#include "autoware/universe_utils/system/stop_watch.hpp"
20+
#include "euclidean_cluster/euclidean_cluster.hpp"
21+
#include "euclidean_cluster/utils.hpp"
22+
#include "euclidean_cluster/voxel_grid_based_euclidean_cluster.hpp"
23+
#include "shape_estimation/shape_estimator.hpp"
1724

18-
#include <autoware/universe_utils/ros/debug_publisher.hpp>
19-
#include <autoware/universe_utils/system/stop_watch.hpp>
20-
#include <euclidean_cluster/euclidean_cluster.hpp>
21-
#include <euclidean_cluster/utils.hpp>
22-
#include <euclidean_cluster/voxel_grid_based_euclidean_cluster.hpp>
2325
#include <rclcpp/rclcpp.hpp>
24-
#include <shape_estimation/shape_estimator.hpp>
2526

26-
#include <autoware_perception_msgs/msg/detected_objects.hpp>
27-
#include <autoware_perception_msgs/msg/tracked_objects.hpp>
27+
#include "autoware_perception_msgs/msg/detected_objects.hpp"
28+
#include "autoware_perception_msgs/msg/tracked_objects.hpp"
29+
#include "tier4_perception_msgs/msg/detected_objects_with_feature.hpp"
2830
#include <geometry_msgs/msg/pose_stamped.hpp>
2931
#include <sensor_msgs/msg/point_cloud2.hpp>
30-
#include <tier4_perception_msgs/msg/detected_objects_with_feature.hpp>
3132

3233
#include <tf2/LinearMath/Transform.h>
3334
#include <tf2/convert.h>
@@ -46,6 +47,8 @@
4647
#include <memory>
4748
#include <vector>
4849

50+
namespace autoware::detection_by_tracker
51+
{
4952
class Debugger
5053
{
5154
public:
@@ -117,5 +120,6 @@ class Debugger
117120
return objects;
118121
}
119122
};
123+
} // namespace autoware::detection_by_tracker
120124

121-
#endif // DETECTION_BY_TRACKER__DEBUGGER_HPP_
125+
#endif // DEBUGGER__DEBUGGER_HPP_

perception/detection_by_tracker/src/detection_by_tracker_core.cpp perception/detection_by_tracker/src/detection_by_tracker_node.cpp

+13-8
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "detection_by_tracker/detection_by_tracker_core.hpp"
15+
#define EIGEN_MPL2_ONLY
16+
17+
#include "detection_by_tracker_node.hpp"
1618

19+
#include "autoware/universe_utils/geometry/geometry.hpp"
20+
#include "autoware/universe_utils/math/unit_conversion.hpp"
1721
#include "object_recognition_utils/object_recognition_utils.hpp"
1822

19-
#include <autoware/universe_utils/geometry/geometry.hpp>
20-
#include <autoware/universe_utils/math/unit_conversion.hpp>
23+
#include <Eigen/Core>
24+
#include <Eigen/Geometry>
2125

2226
#include <chrono>
2327
#include <memory>
2428
#include <optional>
2529
#include <string>
2630
#include <vector>
2731

28-
#define EIGEN_MPL2_ONLY
29-
#include <Eigen/Core>
30-
#include <Eigen/Geometry>
31-
3232
using Label = autoware_perception_msgs::msg::ObjectClassification;
3333
namespace
3434
{
@@ -80,6 +80,9 @@ boost::optional<ReferenceShapeSizeInfo> getReferenceShapeSizeInfo(
8080
}
8181
} // namespace
8282

83+
namespace autoware::detection_by_tracker
84+
{
85+
8386
void TrackerHandler::onTrackedObjects(
8487
const autoware_perception_msgs::msg::TrackedObjects::ConstSharedPtr msg)
8588
{
@@ -466,5 +469,7 @@ void DetectionByTracker::mergeOverSegmentedObjects(
466469
}
467470
}
468471

472+
} // namespace autoware::detection_by_tracker
473+
469474
#include <rclcpp_components/register_node_macro.hpp>
470-
RCLCPP_COMPONENTS_REGISTER_NODE(DetectionByTracker)
475+
RCLCPP_COMPONENTS_REGISTER_NODE(autoware::detection_by_tracker::DetectionByTracker)

perception/detection_by_tracker/include/detection_by_tracker/detection_by_tracker_core.hpp perception/detection_by_tracker/src/detection_by_tracker_node.hpp

+20-14
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef DETECTION_BY_TRACKER__DETECTION_BY_TRACKER_CORE_HPP_
16-
#define DETECTION_BY_TRACKER__DETECTION_BY_TRACKER_CORE_HPP_
15+
#ifndef DETECTION_BY_TRACKER_NODE_HPP_
16+
#define DETECTION_BY_TRACKER_NODE_HPP_
1717

18-
#include "detection_by_tracker/debugger.hpp"
19-
#include "detection_by_tracker/utils.hpp"
18+
#include "autoware/universe_utils/ros/published_time_publisher.hpp"
19+
#include "debugger/debugger.hpp"
20+
#include "euclidean_cluster/euclidean_cluster.hpp"
21+
#include "euclidean_cluster/utils.hpp"
22+
#include "euclidean_cluster/voxel_grid_based_euclidean_cluster.hpp"
23+
#include "shape_estimation/shape_estimator.hpp"
24+
#include "utils/utils.hpp"
2025

21-
#include <autoware/universe_utils/ros/published_time_publisher.hpp>
22-
#include <euclidean_cluster/euclidean_cluster.hpp>
23-
#include <euclidean_cluster/utils.hpp>
24-
#include <euclidean_cluster/voxel_grid_based_euclidean_cluster.hpp>
2526
#include <rclcpp/rclcpp.hpp>
26-
#include <shape_estimation/shape_estimator.hpp>
2727

28-
#include <autoware_perception_msgs/msg/detected_objects.hpp>
29-
#include <autoware_perception_msgs/msg/tracked_objects.hpp>
28+
#include "autoware_perception_msgs/msg/detected_objects.hpp"
29+
#include "autoware_perception_msgs/msg/tracked_objects.hpp"
30+
#include "tier4_perception_msgs/msg/detected_objects_with_feature.hpp"
3031
#include <geometry_msgs/msg/pose_stamped.hpp>
3132
#include <sensor_msgs/msg/point_cloud2.hpp>
32-
#include <tier4_perception_msgs/msg/detected_objects_with_feature.hpp>
3333

3434
#include <tf2/LinearMath/Transform.h>
3535
#include <tf2/convert.h>
@@ -48,6 +48,10 @@
4848
#include <map>
4949
#include <memory>
5050
#include <vector>
51+
52+
namespace autoware::detection_by_tracker
53+
{
54+
5155
class TrackerHandler
5256
{
5357
private:
@@ -82,7 +86,7 @@ class DetectionByTracker : public rclcpp::Node
8286
std::map<uint8_t, int> max_search_distance_for_merger_;
8387
std::map<uint8_t, int> max_search_distance_for_divider_;
8488

85-
detection_by_tracker::utils::TrackerIgnoreLabel tracker_ignore_;
89+
utils::TrackerIgnoreLabel tracker_ignore_;
8690

8791
std::unique_ptr<autoware::universe_utils::PublishedTimePublisher> published_time_publisher_;
8892

@@ -109,4 +113,6 @@ class DetectionByTracker : public rclcpp::Node
109113
tier4_perception_msgs::msg::DetectedObjectsWithFeature & out_objects);
110114
};
111115

112-
#endif // DETECTION_BY_TRACKER__DETECTION_BY_TRACKER_CORE_HPP_
116+
} // namespace autoware::detection_by_tracker
117+
118+
#endif // DETECTION_BY_TRACKER_NODE_HPP_

perception/detection_by_tracker/src/utils.cpp perception/detection_by_tracker/src/utils/utils.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "detection_by_tracker/utils.hpp"
15+
#include "utils.hpp"
1616

1717
#include <autoware_perception_msgs/msg/object_classification.hpp>
1818

19-
namespace detection_by_tracker
19+
namespace autoware::detection_by_tracker
2020
{
2121
namespace utils
2222
{
@@ -30,4 +30,4 @@ bool TrackerIgnoreLabel::isIgnore(const uint8_t label) const
3030
(label == Label::BICYCLE && BICYCLE) || (label == Label::PEDESTRIAN && PEDESTRIAN);
3131
}
3232
} // namespace utils
33-
} // namespace detection_by_tracker
33+
} // namespace autoware::detection_by_tracker

perception/detection_by_tracker/include/detection_by_tracker/utils.hpp perception/detection_by_tracker/src/utils/utils.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef DETECTION_BY_TRACKER__UTILS_HPP_
16-
#define DETECTION_BY_TRACKER__UTILS_HPP_
15+
#ifndef UTILS__UTILS_HPP_
16+
#define UTILS__UTILS_HPP_
1717

1818
#include <cstdint>
1919

20-
namespace detection_by_tracker
20+
namespace autoware::detection_by_tracker
2121
{
2222
namespace utils
2323
{
@@ -34,6 +34,6 @@ struct TrackerIgnoreLabel
3434
bool isIgnore(const uint8_t label) const;
3535
}; // struct TrackerIgnoreLabel
3636
} // namespace utils
37-
} // namespace detection_by_tracker
37+
} // namespace autoware::detection_by_tracker
3838

39-
#endif // DETECTION_BY_TRACKER__UTILS_HPP_
39+
#endif // UTILS__UTILS_HPP_

0 commit comments

Comments
 (0)