forked from autowarefoundation/autoware.universe
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(detection_by_tracker): add debug and modify existence_probability (
autowarefoundation#475) * add debugger Signed-off-by: Yukihiro Saito <[email protected]> * change iou Signed-off-by: Yukihiro Saito <[email protected]>
- Loading branch information
1 parent
5dbea48
commit 84d3790
Showing
3 changed files
with
121 additions
and
12 deletions.
There are no files selected for viewing
101 changes: 101 additions & 0 deletions
101
perception/detection_by_tracker/include/detection_by_tracker/debugger.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
// 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 DETECTION_BY_TRACKER__DEBUGGER_HPP_ | ||
#define DETECTION_BY_TRACKER__DEBUGGER_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 <tier4_autoware_utils/tier4_autoware_utils.hpp> | ||
|
||
#include <autoware_auto_perception_msgs/msg/detected_objects.hpp> | ||
#include <autoware_auto_perception_msgs/msg/tracked_objects.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> | ||
#include <tf2/transform_datatypes.h> | ||
#include <tf2_geometry_msgs/tf2_geometry_msgs.h> | ||
#include <tf2_ros/buffer.h> | ||
#include <tf2_ros/transform_listener.h> | ||
|
||
#include <deque> | ||
#include <memory> | ||
#include <vector> | ||
|
||
class Debugger | ||
{ | ||
public: | ||
explicit Debugger(rclcpp::Node * node) | ||
{ | ||
initial_objects_pub_ = | ||
node->create_publisher<autoware_auto_perception_msgs::msg::DetectedObjects>( | ||
"debug/initial_objects", 1); | ||
tracked_objects_pub_ = | ||
node->create_publisher<autoware_auto_perception_msgs::msg::DetectedObjects>( | ||
"debug/tracked_objects", 1); | ||
merged_objects_pub_ = | ||
node->create_publisher<autoware_auto_perception_msgs::msg::DetectedObjects>( | ||
"debug/merged_objects", 1); | ||
divided_objects_pub_ = | ||
node->create_publisher<autoware_auto_perception_msgs::msg::DetectedObjects>( | ||
"debug/divided_objects", 1); | ||
} | ||
|
||
~Debugger() {} | ||
void publishInitialObjects(const tier4_perception_msgs::msg::DetectedObjectsWithFeature & input) | ||
{ | ||
initial_objects_pub_->publish(removeFeature(input)); | ||
} | ||
void publishTrackedObjects(const autoware_auto_perception_msgs::msg::DetectedObjects & input) | ||
{ | ||
tracked_objects_pub_->publish(input); | ||
} | ||
void publishMergedObjects(const tier4_perception_msgs::msg::DetectedObjectsWithFeature & input) | ||
{ | ||
merged_objects_pub_->publish(removeFeature(input)); | ||
} | ||
void publishDividedObjects(const tier4_perception_msgs::msg::DetectedObjectsWithFeature & input) | ||
{ | ||
divided_objects_pub_->publish(removeFeature(input)); | ||
} | ||
|
||
private: | ||
rclcpp::Publisher<autoware_auto_perception_msgs::msg::DetectedObjects>::SharedPtr | ||
initial_objects_pub_; | ||
rclcpp::Publisher<autoware_auto_perception_msgs::msg::DetectedObjects>::SharedPtr | ||
tracked_objects_pub_; | ||
rclcpp::Publisher<autoware_auto_perception_msgs::msg::DetectedObjects>::SharedPtr | ||
merged_objects_pub_; | ||
rclcpp::Publisher<autoware_auto_perception_msgs::msg::DetectedObjects>::SharedPtr | ||
divided_objects_pub_; | ||
|
||
autoware_auto_perception_msgs::msg::DetectedObjects removeFeature( | ||
const tier4_perception_msgs::msg::DetectedObjectsWithFeature & input) | ||
{ | ||
autoware_auto_perception_msgs::msg::DetectedObjects objects; | ||
objects.header = input.header; | ||
for (const auto & feature_object : input.feature_objects) { | ||
objects.objects.push_back(feature_object.object); | ||
} | ||
return objects; | ||
} | ||
}; | ||
|
||
#endif // DETECTION_BY_TRACKER__DEBUGGER_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters