Skip to content

Commit

Permalink
chore: remove unnecessary dependencies and rework package structure
Browse files Browse the repository at this point in the history
Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
  • Loading branch information
technolojin committed Jun 28, 2024
1 parent bcad7b9 commit fe90cd6
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 52 deletions.
14 changes: 7 additions & 7 deletions perception/detection_by_tracker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ include_directories(

# Generate exe file
set(DETECTION_BY_TRACKER_SRC
src/detection_by_tracker_core.cpp
src/utils.cpp
src/detection_by_tracker_node.cpp
src/utils/utils.cpp
)

ament_auto_add_library(detection_by_tracker_node SHARED
ament_auto_add_library(${PROJECT_NAME} SHARED
${DETECTION_BY_TRACKER_SRC}
)

target_link_libraries(detection_by_tracker_node
target_link_libraries(${PROJECT_NAME}
Eigen3::Eigen
${PCL_LIBRARIES}
)

rclcpp_components_register_node(detection_by_tracker_node
PLUGIN "DetectionByTracker"
EXECUTABLE detection_by_tracker
rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "autoware::detection_by_tracker::DetectionByTracker"
EXECUTABLE detection_by_tracker_node
)

ament_auto_package(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<arg name="input/initial_objects" default="/perception/object_recognition/detection/clustering/objects_with_feature"/>
<arg name="output" default="objects"/>
<arg name="detection_by_tracker_param_path" default="$(find-pkg-share detection_by_tracker)/config/detection_by_tracker.param.yaml"/>
<node pkg="detection_by_tracker" exec="detection_by_tracker" name="detection_by_tracker_node" output="screen">
<node pkg="detection_by_tracker" exec="detection_by_tracker_node" name="detection_by_tracker_node" output="screen">
<remap from="~/input/tracked_objects" to="$(var input/tracked_objects)"/>
<remap from="~/input/initial_objects" to="$(var input/initial_objects)"/>
<remap from="~/output" to="$(var output)"/>
Expand Down
2 changes: 0 additions & 2 deletions perception/detection_by_tracker/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
<depend>autoware_universe_utils</depend>
<depend>eigen</depend>
<depend>euclidean_cluster</depend>
<depend>libpcl-all-dev</depend>
<depend>object_recognition_utils</depend>
<depend>pcl_conversions</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>shape_estimation</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef DETECTION_BY_TRACKER__DEBUGGER_HPP_
#define DETECTION_BY_TRACKER__DEBUGGER_HPP_
#ifndef DEBUGGER__DEBUGGER_HPP_
#define DEBUGGER__DEBUGGER_HPP_

#include "autoware/universe_utils/ros/debug_publisher.hpp"
#include "autoware/universe_utils/system/stop_watch.hpp"
#include "euclidean_cluster/euclidean_cluster.hpp"
#include "euclidean_cluster/utils.hpp"
#include "euclidean_cluster/voxel_grid_based_euclidean_cluster.hpp"
#include "shape_estimation/shape_estimator.hpp"

#include <autoware/universe_utils/ros/debug_publisher.hpp>
#include <autoware/universe_utils/system/stop_watch.hpp>
#include <euclidean_cluster/euclidean_cluster.hpp>
#include <euclidean_cluster/utils.hpp>
#include <euclidean_cluster/voxel_grid_based_euclidean_cluster.hpp>
#include <rclcpp/rclcpp.hpp>
#include <shape_estimation/shape_estimator.hpp>

#include <autoware_perception_msgs/msg/detected_objects.hpp>
#include <autoware_perception_msgs/msg/tracked_objects.hpp>
#include "autoware_perception_msgs/msg/detected_objects.hpp"
#include "autoware_perception_msgs/msg/tracked_objects.hpp"
#include "tier4_perception_msgs/msg/detected_objects_with_feature.hpp"
#include <geometry_msgs/msg/pose_stamped.hpp>
#include <sensor_msgs/msg/point_cloud2.hpp>
#include <tier4_perception_msgs/msg/detected_objects_with_feature.hpp>

#include <tf2/LinearMath/Transform.h>
#include <tf2/convert.h>
Expand All @@ -46,6 +47,8 @@
#include <memory>
#include <vector>

namespace autoware::detection_by_tracker
{
class Debugger
{
public:
Expand Down Expand Up @@ -117,5 +120,6 @@ class Debugger
return objects;
}
};
} // namespace autoware::detection_by_tracker

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

#include "detection_by_tracker/detection_by_tracker_core.hpp"
#define EIGEN_MPL2_ONLY

#include "detection_by_tracker_node.hpp"

#include "autoware/universe_utils/geometry/geometry.hpp"
#include "autoware/universe_utils/math/unit_conversion.hpp"
#include "object_recognition_utils/object_recognition_utils.hpp"

#include <autoware/universe_utils/geometry/geometry.hpp>
#include <autoware/universe_utils/math/unit_conversion.hpp>
#include <Eigen/Core>
#include <Eigen/Geometry>

#include <chrono>
#include <memory>
#include <optional>
#include <string>
#include <vector>

#define EIGEN_MPL2_ONLY
#include <Eigen/Core>
#include <Eigen/Geometry>

using Label = autoware_perception_msgs::msg::ObjectClassification;
namespace
{
Expand Down Expand Up @@ -80,6 +80,9 @@ boost::optional<ReferenceShapeSizeInfo> getReferenceShapeSizeInfo(
}
} // namespace

namespace autoware::detection_by_tracker
{

void TrackerHandler::onTrackedObjects(
const autoware_perception_msgs::msg::TrackedObjects::ConstSharedPtr msg)
{
Expand Down Expand Up @@ -466,5 +469,7 @@ void DetectionByTracker::mergeOverSegmentedObjects(
}
}

} // namespace autoware::detection_by_tracker

#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(DetectionByTracker)
RCLCPP_COMPONENTS_REGISTER_NODE(autoware::detection_by_tracker::DetectionByTracker)
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef DETECTION_BY_TRACKER__DETECTION_BY_TRACKER_CORE_HPP_
#define DETECTION_BY_TRACKER__DETECTION_BY_TRACKER_CORE_HPP_
#ifndef DETECTION_BY_TRACKER_NODE_HPP_
#define DETECTION_BY_TRACKER_NODE_HPP_

#include "detection_by_tracker/debugger.hpp"
#include "detection_by_tracker/utils.hpp"
#include "autoware/universe_utils/ros/published_time_publisher.hpp"
#include "debugger/debugger.hpp"
#include "euclidean_cluster/euclidean_cluster.hpp"
#include "euclidean_cluster/utils.hpp"
#include "euclidean_cluster/voxel_grid_based_euclidean_cluster.hpp"
#include "shape_estimation/shape_estimator.hpp"
#include "utils/utils.hpp"

#include <autoware/universe_utils/ros/published_time_publisher.hpp>
#include <euclidean_cluster/euclidean_cluster.hpp>
#include <euclidean_cluster/utils.hpp>
#include <euclidean_cluster/voxel_grid_based_euclidean_cluster.hpp>
#include <rclcpp/rclcpp.hpp>
#include <shape_estimation/shape_estimator.hpp>

#include <autoware_perception_msgs/msg/detected_objects.hpp>
#include <autoware_perception_msgs/msg/tracked_objects.hpp>
#include "autoware_perception_msgs/msg/detected_objects.hpp"
#include "autoware_perception_msgs/msg/tracked_objects.hpp"
#include "tier4_perception_msgs/msg/detected_objects_with_feature.hpp"
#include <geometry_msgs/msg/pose_stamped.hpp>
#include <sensor_msgs/msg/point_cloud2.hpp>
#include <tier4_perception_msgs/msg/detected_objects_with_feature.hpp>

#include <tf2/LinearMath/Transform.h>
#include <tf2/convert.h>
Expand All @@ -48,6 +48,10 @@
#include <map>
#include <memory>
#include <vector>

namespace autoware::detection_by_tracker
{

class TrackerHandler
{
private:
Expand Down Expand Up @@ -82,7 +86,7 @@ class DetectionByTracker : public rclcpp::Node
std::map<uint8_t, int> max_search_distance_for_merger_;
std::map<uint8_t, int> max_search_distance_for_divider_;

detection_by_tracker::utils::TrackerIgnoreLabel tracker_ignore_;
utils::TrackerIgnoreLabel tracker_ignore_;

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

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

#endif // DETECTION_BY_TRACKER__DETECTION_BY_TRACKER_CORE_HPP_
} // namespace autoware::detection_by_tracker

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

#include "detection_by_tracker/utils.hpp"
#include "utils.hpp"

#include <autoware_perception_msgs/msg/object_classification.hpp>

namespace detection_by_tracker
namespace autoware::detection_by_tracker
{
namespace utils
{
Expand All @@ -30,4 +30,4 @@ bool TrackerIgnoreLabel::isIgnore(const uint8_t label) const
(label == Label::BICYCLE && BICYCLE) || (label == Label::PEDESTRIAN && PEDESTRIAN);
}
} // namespace utils
} // namespace detection_by_tracker
} // namespace autoware::detection_by_tracker
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 DETECTION_BY_TRACKER__UTILS_HPP_
#define DETECTION_BY_TRACKER__UTILS_HPP_
#ifndef UTILS__UTILS_HPP_
#define UTILS__UTILS_HPP_

#include <cstdint>

namespace detection_by_tracker
namespace autoware::detection_by_tracker
{
namespace utils
{
Expand All @@ -34,6 +34,6 @@ struct TrackerIgnoreLabel
bool isIgnore(const uint8_t label) const;
}; // struct TrackerIgnoreLabel
} // namespace utils
} // namespace detection_by_tracker
} // namespace autoware::detection_by_tracker

#endif // DETECTION_BY_TRACKER__UTILS_HPP_
#endif // UTILS__UTILS_HPP_

0 comments on commit fe90cd6

Please sign in to comment.