diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 256b617116432..a6cdc58f03e94 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -205,7 +205,7 @@ planning/sampling_based_planner/frenet_planner/** maxime.clement@tier4.jp
planning/sampling_based_planner/path_sampler/** maxime.clement@tier4.jp
planning/sampling_based_planner/sampler_common/** maxime.clement@tier4.jp
planning/scenario_selector/** fumiya.watanabe@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp taiki.tanaka@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp tomoya.kimura@tier4.jp
-planning/static_centerline_optimizer/** kosuke.takeuchi@tier4.jp takayuki.murooka@tier4.jp
+planning/static_centerline_generator/** kosuke.takeuchi@tier4.jp takayuki.murooka@tier4.jp
planning/surround_obstacle_checker/** satoshi.ota@tier4.jp
sensing/gnss_poser/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp koji.minoda@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp
sensing/image_diagnostics/** dai.nguyen@tier4.jp
diff --git a/build_depends.repos b/build_depends.repos
index f7b3f12484015..5a12a67dbd346 100644
--- a/build_depends.repos
+++ b/build_depends.repos
@@ -41,3 +41,8 @@ repositories:
type: git
url: https://github.com/MORAI-Autonomous/MORAI-ROS2_morai_msgs.git
version: main
+ #vehicle
+ vehicle/sample_vehicle_launch:
+ type: git
+ url: https://github.com/autowarefoundation/sample_vehicle_launch.git
+ version: main
diff --git a/common/global_parameter_loader/CMakeLists.txt b/common/global_parameter_loader/CMakeLists.txt
index e67ae1a5c06fc..eaca44c515452 100644
--- a/common/global_parameter_loader/CMakeLists.txt
+++ b/common/global_parameter_loader/CMakeLists.txt
@@ -4,6 +4,11 @@ project(global_parameter_loader)
find_package(autoware_cmake REQUIRED)
autoware_package()
+if(BUILD_TESTING)
+ file(GLOB_RECURSE test_files test/*.cpp)
+ ament_add_ros_isolated_gtest(test_global_params_launch ${test_files})
+endif()
+
ament_auto_package(
INSTALL_TO_SHARE
launch
diff --git a/common/global_parameter_loader/package.xml b/common/global_parameter_loader/package.xml
index 4c2568b9aec98..78d08e4038250 100644
--- a/common/global_parameter_loader/package.xml
+++ b/common/global_parameter_loader/package.xml
@@ -10,8 +10,10 @@
ament_cmake_auto
autoware_cmake
- vehicle_info_util
+ sample_vehicle_description
+ vehicle_info_util
+ ament_cmake_ros
ament_lint_auto
autoware_lint_common
diff --git a/common/global_parameter_loader/test/test_global_params_launch.cpp b/common/global_parameter_loader/test/test_global_params_launch.cpp
new file mode 100644
index 0000000000000..2b33a695253ff
--- /dev/null
+++ b/common/global_parameter_loader/test/test_global_params_launch.cpp
@@ -0,0 +1,44 @@
+// Copyright 2023 The Autoware Foundation
+//
+// 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
+
+#include
+#include
+#include
+
+TEST(TestLaunchFile, test_launch_file)
+{
+ // Define the path of Python launch file
+ std::string global_params_launch_path = "global_params.launch.py";
+
+ // Define the parameters you want to pass to the launch file
+ std::string use_sim_time_param = "false";
+ std::string vehicle_model_param = "sample_vehicle";
+ // Construct the command to run the Python launch script with parameters
+ std::string command = "ros2 launch global_parameter_loader " + global_params_launch_path +
+ " use_sim_time:=" + use_sim_time_param +
+ " vehicle_model:=" + vehicle_model_param;
+
+ // Use the system() function to execute the command
+ int result = std::system(command.c_str());
+ // Check the result of running the launch file
+ EXPECT_EQ(result, 0);
+}
+
+int main(int argc, char * argv[])
+{
+ testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/common/object_recognition_utils/include/object_recognition_utils/matching.hpp b/common/object_recognition_utils/include/object_recognition_utils/matching.hpp
index 5e8b6a3d49890..e9b924023f62e 100644
--- a/common/object_recognition_utils/include/object_recognition_utils/matching.hpp
+++ b/common/object_recognition_utils/include/object_recognition_utils/matching.hpp
@@ -29,6 +29,8 @@
namespace object_recognition_utils
{
using tier4_autoware_utils::Polygon2d;
+// minimum area to avoid division by zero
+static const double MIN_AREA = 1e-6;
inline double getConvexShapeArea(const Polygon2d & source_polygon, const Polygon2d & target_polygon)
{
@@ -66,10 +68,12 @@ template
double get2dIoU(const T1 source_object, const T2 target_object, const double min_union_area = 0.01)
{
const auto source_polygon = tier4_autoware_utils::toPolygon2d(source_object);
+ if (boost::geometry::area(source_polygon) < MIN_AREA) return 0.0;
const auto target_polygon = tier4_autoware_utils::toPolygon2d(target_object);
+ if (boost::geometry::area(target_polygon) < MIN_AREA) return 0.0;
const double intersection_area = getIntersectionArea(source_polygon, target_polygon);
- if (intersection_area == 0.0) return 0.0;
+ if (intersection_area < MIN_AREA) return 0.0;
const double union_area = getUnionArea(source_polygon, target_polygon);
const double iou =
@@ -81,7 +85,9 @@ template
double get2dGeneralizedIoU(const T1 & source_object, const T2 & target_object)
{
const auto source_polygon = tier4_autoware_utils::toPolygon2d(source_object);
+ if (boost::geometry::area(source_polygon) < MIN_AREA) return 0.0;
const auto target_polygon = tier4_autoware_utils::toPolygon2d(target_object);
+ if (boost::geometry::area(target_polygon) < MIN_AREA) return 0.0;
const double intersection_area = getIntersectionArea(source_polygon, target_polygon);
const double union_area = getUnionArea(source_polygon, target_polygon);
@@ -95,11 +101,13 @@ template
double get2dPrecision(const T1 source_object, const T2 target_object)
{
const auto source_polygon = tier4_autoware_utils::toPolygon2d(source_object);
+ const double source_area = boost::geometry::area(source_polygon);
+ if (source_area < MIN_AREA) return 0.0;
const auto target_polygon = tier4_autoware_utils::toPolygon2d(target_object);
+ if (boost::geometry::area(target_polygon) < MIN_AREA) return 0.0;
const double intersection_area = getIntersectionArea(source_polygon, target_polygon);
- if (intersection_area == 0.0) return 0.0;
- const double source_area = boost::geometry::area(source_polygon);
+ if (intersection_area < MIN_AREA) return 0.0;
return std::min(1.0, intersection_area / source_area);
}
@@ -108,11 +116,13 @@ template
double get2dRecall(const T1 source_object, const T2 target_object)
{
const auto source_polygon = tier4_autoware_utils::toPolygon2d(source_object);
+ if (boost::geometry::area(source_polygon) < MIN_AREA) return 0.0;
const auto target_polygon = tier4_autoware_utils::toPolygon2d(target_object);
+ const double target_area = boost::geometry::area(target_polygon);
+ if (target_area < MIN_AREA) return 0.0;
const double intersection_area = getIntersectionArea(source_polygon, target_polygon);
- if (intersection_area == 0.0) return 0.0;
- const double target_area = boost::geometry::area(target_polygon);
+ if (intersection_area < MIN_AREA) return 0.0;
return std::min(1.0, intersection_area / target_area);
}
diff --git a/common/tier4_autoware_utils/include/tier4_autoware_utils/ros/polling_subscriber.hpp b/common/tier4_autoware_utils/include/tier4_autoware_utils/ros/polling_subscriber.hpp
new file mode 100644
index 0000000000000..f8d5baaf02777
--- /dev/null
+++ b/common/tier4_autoware_utils/include/tier4_autoware_utils/ros/polling_subscriber.hpp
@@ -0,0 +1,66 @@
+// Copyright 2024 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 TIER4_AUTOWARE_UTILS__ROS__POLLING_SUBSCRIBER_HPP_
+#define TIER4_AUTOWARE_UTILS__ROS__POLLING_SUBSCRIBER_HPP_
+
+#include
+
+#include
+
+namespace tier4_autoware_utils
+{
+
+template
+class InterProcessPollingSubscriber
+{
+private:
+ typename rclcpp::Subscription::SharedPtr subscriber_;
+ std::optional data_;
+
+public:
+ explicit InterProcessPollingSubscriber(rclcpp::Node * node, const std::string & topic_name)
+ {
+ auto noexec_callback_group =
+ node->create_callback_group(rclcpp::CallbackGroupType::MutuallyExclusive, false);
+ auto noexec_subscription_options = rclcpp::SubscriptionOptions();
+ noexec_subscription_options.callback_group = noexec_callback_group;
+
+ subscriber_ = node->create_subscription(
+ topic_name, rclcpp::QoS{1},
+ [node]([[maybe_unused]] const typename T::ConstSharedPtr msg) { assert(false); },
+ noexec_subscription_options);
+ };
+ bool updateLatestData()
+ {
+ rclcpp::MessageInfo message_info;
+ T tmp;
+ // The queue size (QoS) must be 1 to get the last message data.
+ if (subscriber_->take(tmp, message_info)) {
+ data_ = tmp;
+ }
+ return data_.has_value();
+ };
+ const T & getData() const
+ {
+ if (!data_.has_value()) {
+ throw std::runtime_error("Bad_optional_access in class InterProcessPollingSubscriber");
+ }
+ return data_.value();
+ };
+};
+
+} // namespace tier4_autoware_utils
+
+#endif // TIER4_AUTOWARE_UTILS__ROS__POLLING_SUBSCRIBER_HPP_
diff --git a/control/predicted_path_checker/src/predicted_path_checker_node/predicted_path_checker_node.cpp b/control/predicted_path_checker/src/predicted_path_checker_node/predicted_path_checker_node.cpp
index 0cf2548d69746..bba069442bee7 100644
--- a/control/predicted_path_checker/src/predicted_path_checker_node/predicted_path_checker_node.cpp
+++ b/control/predicted_path_checker/src/predicted_path_checker_node/predicted_path_checker_node.cpp
@@ -537,6 +537,10 @@ void PredictedPathCheckerNode::filterObstacles(
const Pose & ego_pose, const TrajectoryPoints & traj, const double dist_threshold,
const bool use_prediction, PredictedObjects & filtered_objects)
{
+ if (traj.size() < 2) {
+ RCLCPP_ERROR(rclcpp::get_logger("predicted_path_checker"), "Trajectory size is less than 2.");
+ return;
+ }
filtered_objects.header.frame_id = object_ptr_.get()->header.frame_id;
filtered_objects.header.stamp = this->now();
diff --git a/evaluator/perception_online_evaluator/README.md b/evaluator/perception_online_evaluator/README.md
index c0e2a516cf948..7c2179239221e 100644
--- a/evaluator/perception_online_evaluator/README.md
+++ b/evaluator/perception_online_evaluator/README.md
@@ -11,6 +11,7 @@ This module allows for the evaluation of how accurately perception results are g
- Calculates lateral deviation between the predicted path and the actual traveled trajectory.
- Calculates lateral deviation between the smoothed traveled trajectory and the perceived position to evaluate the stability of lateral position recognition.
- Calculates yaw deviation between the smoothed traveled trajectory and the perceived position to evaluate the stability of yaw recognition.
+- Calculates yaw rate based on the yaw of the object received in the previous cycle to evaluate the stability of the yaw rate recognition.
## Inputs / Outputs
diff --git a/evaluator/perception_online_evaluator/include/perception_online_evaluator/utils/marker_utils.hpp b/evaluator/perception_online_evaluator/include/perception_online_evaluator/utils/marker_utils.hpp
index 3ac4c1db9efbd..0831d580248d3 100644
--- a/evaluator/perception_online_evaluator/include/perception_online_evaluator/utils/marker_utils.hpp
+++ b/evaluator/perception_online_evaluator/include/perception_online_evaluator/utils/marker_utils.hpp
@@ -63,8 +63,8 @@ MarkerArray createPoseMarkerArray(
const float & b);
MarkerArray createPosesMarkerArray(
- const std::vector poses, std::string && ns, const float & r, const float & g,
- const float & b, const float & x_scale = 0.5, const float & y_scale = 0.2,
+ const std::vector poses, std::string && ns, const int32_t & first_id, const float & r,
+ const float & g, const float & b, const float & x_scale = 0.5, const float & y_scale = 0.2,
const float & z_scale = 0.2);
std_msgs::msg::ColorRGBA createColorFromString(const std::string & str);
@@ -75,7 +75,7 @@ MarkerArray createObjectPolygonMarkerArray(
MarkerArray createDeviationLines(
const std::vector poses1, const std::vector poses2, const std::string & ns,
- const float r, const float g, const float b);
+ const int32_t & first_id, const float r, const float g, const float b);
} // namespace marker_utils
diff --git a/evaluator/perception_online_evaluator/param/perception_online_evaluator.defaults.yaml b/evaluator/perception_online_evaluator/param/perception_online_evaluator.defaults.yaml
index 976b10a2c73f9..46ea68c991090 100644
--- a/evaluator/perception_online_evaluator/param/perception_online_evaluator.defaults.yaml
+++ b/evaluator/perception_online_evaluator/param/perception_online_evaluator.defaults.yaml
@@ -11,7 +11,7 @@
prediction_time_horizons: [1.0, 2.0, 3.0, 5.0]
- stopped_velocity_threshold: 0.3
+ stopped_velocity_threshold: 1.0
target_object:
car:
diff --git a/evaluator/perception_online_evaluator/src/metrics_calculator.cpp b/evaluator/perception_online_evaluator/src/metrics_calculator.cpp
index 60e02c8f24c39..4b882bb8b2e68 100644
--- a/evaluator/perception_online_evaluator/src/metrics_calculator.cpp
+++ b/evaluator/perception_online_evaluator/src/metrics_calculator.cpp
@@ -37,20 +37,25 @@ std::optional MetricsCalculator::calculate(const Metric & metric)
return {};
}
const auto target_stamp_objects = getObjectsByStamp(target_stamp);
- const auto class_objects_map = separateObjectsByClass(target_stamp_objects);
- // filter stopped objects
+ // extract moving objects
+ const auto moving_objects = filterObjectsByVelocity(
+ target_stamp_objects, parameters_->stopped_velocity_threshold,
+ /*remove_above_threshold=*/false);
+ const auto class_moving_objects_map = separateObjectsByClass(moving_objects);
+
+ // extract stopped objects
const auto stopped_objects =
filterObjectsByVelocity(target_stamp_objects, parameters_->stopped_velocity_threshold);
const auto class_stopped_objects_map = separateObjectsByClass(stopped_objects);
switch (metric) {
case Metric::lateral_deviation:
- return calcLateralDeviationMetrics(class_objects_map);
+ return calcLateralDeviationMetrics(class_moving_objects_map);
case Metric::yaw_deviation:
- return calcYawDeviationMetrics(class_objects_map);
+ return calcYawDeviationMetrics(class_moving_objects_map);
case Metric::predicted_path_deviation:
- return calcPredictedPathDeviationMetrics(class_objects_map);
+ return calcPredictedPathDeviationMetrics(class_moving_objects_map);
case Metric::yaw_rate:
return calcYawRateMetrics(class_stopped_objects_map);
default:
@@ -372,16 +377,21 @@ MetricStatMap MetricsCalculator::calcYawRateMetrics(const ClassObjectsMap & clas
}
const auto [previous_stamp, previous_object] = previous_object_with_stamp_opt.value();
- const auto time_diff = (stamp - previous_stamp).seconds();
+ const double time_diff = (stamp - previous_stamp).seconds();
if (time_diff < 0.01) {
continue;
}
- const auto current_yaw =
+ const double current_yaw =
tf2::getYaw(object.kinematics.initial_pose_with_covariance.pose.orientation);
- const auto previous_yaw =
+ const double previous_yaw =
tf2::getYaw(previous_object.kinematics.initial_pose_with_covariance.pose.orientation);
- const auto yaw_rate =
- std::abs(tier4_autoware_utils::normalizeRadian(current_yaw - previous_yaw) / time_diff);
+ const double yaw_diff =
+ std::abs(tier4_autoware_utils::normalizeRadian(current_yaw - previous_yaw));
+ // if yaw_diff is close to PI, reversal of orientation is likely occurring, so ignore it
+ if (std::abs(M_PI - yaw_diff) < 0.1) {
+ continue;
+ }
+ const auto yaw_rate = yaw_diff / time_diff;
stat.add(yaw_rate);
}
metric_stat_map["yaw_rate_" + convertLabelToString(label)] = stat;
@@ -443,7 +453,34 @@ void MetricsCalculator::updateHistoryPath()
for (const auto & [uuid, stamp_and_objects] : object_map_) {
std::vector history_path;
- for (const auto & [stamp, object] : stamp_and_objects) {
+ for (auto it = stamp_and_objects.begin(); it != stamp_and_objects.end(); ++it) {
+ const auto & [stamp, object] = *it;
+
+ // skip if the object is stopped
+ // calculate velocity from previous object
+ if (it != stamp_and_objects.begin()) {
+ const auto & [prev_stamp, prev_object] = *std::prev(it);
+ const double time_diff = (stamp - prev_stamp).seconds();
+ if (time_diff < 0.01) {
+ continue;
+ }
+ const auto current_pose = object.kinematics.initial_pose_with_covariance.pose;
+ const auto prev_pose = prev_object.kinematics.initial_pose_with_covariance.pose;
+ const auto velocity =
+ tier4_autoware_utils::calcDistance2d(current_pose.position, prev_pose.position) /
+ time_diff;
+ if (velocity < parameters_->stopped_velocity_threshold) {
+ continue;
+ }
+ }
+ if (
+ std::hypot(
+ object.kinematics.initial_twist_with_covariance.twist.linear.x,
+ object.kinematics.initial_twist_with_covariance.twist.linear.y) <
+ parameters_->stopped_velocity_threshold) {
+ continue;
+ }
+
history_path.push_back(object.kinematics.initial_pose_with_covariance.pose);
}
@@ -507,27 +544,49 @@ std::vector MetricsCalculator::averageFilterPath(
average_pose.position = path.at(i).position;
}
+ // skip if the points are too close
+ if (
+ filtered_path.size() > 0 &&
+ calcDistance2d(filtered_path.back().position, average_pose.position) < 0.5) {
+ continue;
+ }
+
+ // skip if the difference between the current orientation and the azimuth angle is large
+ if (i > 0) {
+ const double azimuth = calcAzimuthAngle(path.at(i - 1).position, path.at(i).position);
+ const double yaw = tf2::getYaw(path.at(i).orientation);
+ if (tier4_autoware_utils::normalizeRadian(yaw - azimuth) > M_PI_2) {
+ continue;
+ }
+ }
+
// Placeholder for orientation to ensure structure integrity
average_pose.orientation = path.at(i).orientation;
filtered_path.push_back(average_pose);
}
- // Calculate yaw and convert to quaternion after averaging positions
- for (size_t i = 0; i < filtered_path.size(); ++i) {
- Pose & p = filtered_path[i];
-
- // if the current pose is too close to the previous one, use the previous orientation
- if (i > 0) {
- const Pose & p_prev = filtered_path[i - 1];
- if (calcDistance2d(p_prev.position, p.position) < 0.1) {
- p.orientation = p_prev.orientation;
+ // delete pose if the difference between the azimuth angle of the previous and next poses is large
+ if (filtered_path.size() > 2) {
+ auto it = filtered_path.begin() + 2;
+ while (it != filtered_path.end()) {
+ const double azimuth_to_prev = calcAzimuthAngle((it - 2)->position, (it - 1)->position);
+ const double azimuth_to_current = calcAzimuthAngle((it - 1)->position, it->position);
+ if (
+ std::abs(tier4_autoware_utils::normalizeRadian(azimuth_to_prev - azimuth_to_current)) >
+ M_PI_2) {
+ it = filtered_path.erase(it);
continue;
}
+ ++it;
}
+ }
+ // Calculate yaw and convert to quaternion after averaging positions
+ for (size_t i = 0; i < filtered_path.size(); ++i) {
+ Pose & p = filtered_path[i];
if (i < filtered_path.size() - 1) {
- const double yaw = calcAzimuthAngle(p.position, filtered_path[i + 1].position);
- filtered_path[i].orientation = createQuaternionFromYaw(yaw);
+ const double azimuth_to_next = calcAzimuthAngle(p.position, filtered_path[i + 1].position);
+ filtered_path[i].orientation = createQuaternionFromYaw(azimuth_to_next);
} else if (filtered_path.size() > 1) {
// For the last point, use the orientation of the second-to-last point
p.orientation = filtered_path[i - 1].orientation;
diff --git a/evaluator/perception_online_evaluator/src/perception_online_evaluator_node.cpp b/evaluator/perception_online_evaluator/src/perception_online_evaluator_node.cpp
index 8820ad16fd8d5..ceb304894ad8c 100644
--- a/evaluator/perception_online_evaluator/src/perception_online_evaluator_node.cpp
+++ b/evaluator/perception_online_evaluator/src/perception_online_evaluator_node.cpp
@@ -132,50 +132,74 @@ void PerceptionOnlineEvaluatorNode::publishDebugMarker()
tier4_autoware_utils::appendMarkerArray(added, &marker);
};
- const auto history_path_map = metrics_calculator_.getHistoryPathMap();
const auto & p = parameters_->debug_marker_parameters;
- for (const auto & [uuid, history_path] : history_path_map) {
- {
- const auto c = createColorFromString(uuid + "_raw");
- if (p.show_history_path) {
- add(createPointsMarkerArray(history_path.first, "history_path_" + uuid, 0, c.r, c.g, c.b));
+ // visualize history path
+ {
+ const auto history_path_map = metrics_calculator_.getHistoryPathMap();
+ int32_t history_path_first_id = 0;
+ int32_t smoothed_history_path_first_id = 0;
+ size_t i = 0;
+ for (const auto & [uuid, history_path] : history_path_map) {
+ {
+ const auto c = createColorFromString(uuid + "_raw");
+ if (p.show_history_path) {
+ add(createPointsMarkerArray(history_path.first, "history_path", i, c.r, c.g, c.b));
+ }
+ if (p.show_history_path_arrows) {
+ add(createPosesMarkerArray(
+ history_path.first, "history_path_arrows", history_path_first_id, c.r, c.g, c.b, 0.1,
+ 0.05, 0.05));
+ history_path_first_id += history_path.first.size();
+ }
}
- if (p.show_history_path_arrows) {
- add(createPosesMarkerArray(
- history_path.first, "history_path_arrows_" + uuid, c.r, c.g, c.b, 0.1, 0.05, 0.05));
+ {
+ const auto c = createColorFromString(uuid);
+ if (p.show_smoothed_history_path) {
+ add(createPointsMarkerArray(
+ history_path.second, "smoothed_history_path", i, c.r, c.g, c.b));
+ }
+ if (p.show_smoothed_history_path_arrows) {
+ add(createPosesMarkerArray(
+ history_path.second, "smoothed_history_path_arrows", smoothed_history_path_first_id,
+ c.r, c.g, c.b, 0.1, 0.05, 0.05));
+ smoothed_history_path_first_id += history_path.second.size();
+ }
}
+ i++;
}
- {
+ }
+
+ // visualize predicted path of past objects
+ {
+ int32_t predicted_path_first_id = 0;
+ int32_t history_path_first_id = 0;
+ int32_t deviation_lines_first_id = 0;
+ size_t i = 0;
+ const auto object_data_map = metrics_calculator_.getDebugObjectData();
+ for (const auto & [uuid, object_data] : object_data_map) {
const auto c = createColorFromString(uuid);
- if (p.show_smoothed_history_path) {
- add(createPointsMarkerArray(
- history_path.second, "smoothed_history_path_" + uuid, 0, c.r, c.g, c.b));
+ const auto predicted_path = object_data.getPredictedPath();
+ const auto history_path = object_data.getHistoryPath();
+ if (p.show_predicted_path) {
+ add(createPosesMarkerArray(
+ predicted_path, "predicted_path", predicted_path_first_id, 0, 0, 1));
+ predicted_path_first_id += predicted_path.size();
}
- if (p.show_smoothed_history_path_arrows) {
+ if (p.show_predicted_path_gt) {
add(createPosesMarkerArray(
- history_path.second, "smoothed_history_path_arrows_" + uuid, c.r, c.g, c.b, 0.1, 0.05,
- 0.05));
+ history_path, "predicted_path_gt", history_path_first_id, 1, 0, 0));
+ history_path_first_id += history_path.size();
}
- }
- }
- const auto object_data_map = metrics_calculator_.getDebugObjectData();
- for (const auto & [uuid, object_data] : object_data_map) {
- const auto c = createColorFromString(uuid);
- const auto predicted_path = object_data.getPredictedPath();
- const auto history_path = object_data.getHistoryPath();
- if (p.show_predicted_path) {
- add(createPosesMarkerArray(predicted_path, "predicted_path_" + uuid, 0, 0, 1));
- }
- if (p.show_predicted_path_gt) {
- add(createPosesMarkerArray(history_path, "predicted_path_gt_" + uuid, 1, 0, 0));
- }
- if (p.show_deviation_lines) {
- add(createDeviationLines(predicted_path, history_path, "deviation_lines_" + uuid, 1, 1, 1));
- }
- if (p.show_object_polygon) {
- add(createObjectPolygonMarkerArray(
- object_data.object, "object_polygon_" + uuid, 0, c.r, c.g, c.b));
+ if (p.show_deviation_lines) {
+ add(createDeviationLines(
+ predicted_path, history_path, "deviation_lines", deviation_lines_first_id, 1, 1, 1));
+ deviation_lines_first_id += predicted_path.size();
+ }
+ if (p.show_object_polygon) {
+ add(createObjectPolygonMarkerArray(object_data.object, "object_polygon", i, c.r, c.g, c.b));
+ }
+ i++;
}
}
@@ -190,6 +214,7 @@ rcl_interfaces::msg::SetParametersResult PerceptionOnlineEvaluatorNode::onParame
auto & p = parameters_;
updateParam(parameters, "smoothing_window_size", p->smoothing_window_size);
+ updateParam(parameters, "stopped_velocity_threshold", p->stopped_velocity_threshold);
// update metrics
{
diff --git a/evaluator/perception_online_evaluator/src/utils/marker_utils.cpp b/evaluator/perception_online_evaluator/src/utils/marker_utils.cpp
index 75af92e83dcd8..a29e1a468e983 100644
--- a/evaluator/perception_online_evaluator/src/utils/marker_utils.cpp
+++ b/evaluator/perception_online_evaluator/src/utils/marker_utils.cpp
@@ -111,14 +111,14 @@ MarkerArray createPointsMarkerArray(
MarkerArray createDeviationLines(
const std::vector poses1, const std::vector poses2, const std::string & ns,
- const float r, const float g, const float b)
+ const int32_t & first_id, const float r, const float g, const float b)
{
MarkerArray msg;
const size_t max_idx = std::min(poses1.size(), poses2.size());
for (size_t i = 0; i < max_idx; ++i) {
auto marker = createDefaultMarker(
- "map", rclcpp::Clock{RCL_ROS_TIME}.now(), ns, i, Marker::LINE_STRIP,
+ "map", rclcpp::Clock{RCL_ROS_TIME}.now(), ns, first_id + i, Marker::LINE_STRIP,
createMarkerScale(0.005, 0.0, 0.0), createMarkerColor(r, g, b, 0.5));
marker.points.push_back(poses1.at(i).position);
marker.points.push_back(poses2.at(i).position);
@@ -144,14 +144,15 @@ MarkerArray createPoseMarkerArray(
}
MarkerArray createPosesMarkerArray(
- const std::vector poses, std::string && ns, const float & r, const float & g,
- const float & b, const float & x_scale, const float & y_scale, const float & z_scale)
+ const std::vector poses, std::string && ns, const int32_t & first_id, const float & r,
+ const float & g, const float & b, const float & x_scale, const float & y_scale,
+ const float & z_scale)
{
MarkerArray msg;
for (size_t i = 0; i < poses.size(); ++i) {
Marker marker = createDefaultMarker(
- "map", rclcpp::Clock{RCL_ROS_TIME}.now(), ns, i, Marker::ARROW,
+ "map", rclcpp::Clock{RCL_ROS_TIME}.now(), ns, first_id + i, Marker::ARROW,
createMarkerScale(x_scale, y_scale, z_scale), createMarkerColor(r, g, b, 0.5));
marker.pose = poses.at(i);
msg.markers.push_back(marker);
diff --git a/evaluator/perception_online_evaluator/test/test_perception_online_evaluator_node.cpp b/evaluator/perception_online_evaluator/test/test_perception_online_evaluator_node.cpp
index 2975a1b4d6df8..dabd17b9db46a 100644
--- a/evaluator/perception_online_evaluator/test/test_perception_online_evaluator_node.cpp
+++ b/evaluator/perception_online_evaluator/test/test_perception_online_evaluator_node.cpp
@@ -115,7 +115,7 @@ class EvalTest : public ::testing::Test
PredictedObject makePredictedObject(
const std::vector> & predicted_path,
- const uint8_t label = ObjectClassification::CAR)
+ const uint8_t label = ObjectClassification::CAR, const double velocity = 2.0)
{
PredictedObject object;
object.object_id = uuid_;
@@ -133,6 +133,10 @@ class EvalTest : public ::testing::Test
object.kinematics.initial_pose_with_covariance.pose.orientation.z = 0.0;
object.kinematics.initial_pose_with_covariance.pose.orientation.w = 1.0;
+ object.kinematics.initial_twist_with_covariance.twist.linear.x = velocity;
+ object.kinematics.initial_twist_with_covariance.twist.linear.y = 0.0;
+ object.kinematics.initial_twist_with_covariance.twist.linear.z = 0.0;
+
autoware_auto_perception_msgs::msg::PredictedPath path;
for (size_t i = 0; i < predicted_path.size(); ++i) {
geometry_msgs::msg::Pose pose;
@@ -155,34 +159,35 @@ class EvalTest : public ::testing::Test
PredictedObjects makePredictedObjects(
const std::vector> & predicted_path,
- const uint8_t label = ObjectClassification::CAR)
+ const uint8_t label = ObjectClassification::CAR, const double velocity = 2.0)
{
PredictedObjects objects;
- objects.objects.push_back(makePredictedObject(predicted_path, label));
+ objects.objects.push_back(makePredictedObject(predicted_path, label, velocity));
objects.header.stamp = rclcpp::Time(0);
return objects;
}
PredictedObjects makeStraightPredictedObjects(
- const double time, const uint8_t label = ObjectClassification::CAR)
+ const double time, const uint8_t label = ObjectClassification::CAR, const double velocity = 2.0)
{
std::vector> predicted_path;
for (size_t i = 0; i <= time_horizon_ / time_step_; i++) {
- predicted_path.push_back({velocity_ * (time + i * time_step_), 0.0});
+ predicted_path.push_back({velocity * (time + i * time_step_), 0.0});
}
- auto objects = makePredictedObjects(predicted_path, label);
+ auto objects = makePredictedObjects(predicted_path, label, velocity);
objects.header.stamp = rclcpp::Time(0) + rclcpp::Duration::from_seconds(time);
return objects;
}
PredictedObjects makeDeviatedStraightPredictedObjects(
- const double time, const double deviation, const uint8_t label = ObjectClassification::CAR)
+ const double time, const double deviation, const uint8_t label = ObjectClassification::CAR,
+ const double velocity = 2.0)
{
std::vector> predicted_path;
for (size_t i = 0; i <= time_horizon_ / time_step_; i++) {
- predicted_path.push_back({velocity_ * (time + i * time_step_), deviation});
+ predicted_path.push_back({velocity * (time + i * time_step_), deviation});
}
- auto objects = makePredictedObjects(predicted_path, label);
+ auto objects = makePredictedObjects(predicted_path, label, velocity);
objects.header.stamp = rclcpp::Time(0) + rclcpp::Duration::from_seconds(time);
return objects;
}
@@ -249,7 +254,6 @@ class EvalTest : public ::testing::Test
double time_delay_ = 5.0;
double time_step_ = 0.5;
double time_horizon_ = 10.0;
- double velocity_ = 2.0;
unique_identifier_msgs::msg::UUID uuid_;
};
@@ -589,11 +593,12 @@ TEST_F(EvalTest, testYawRate_0)
setTargetMetric("yaw_rate_CAR");
for (double time = 0; time <= time_delay_; time += time_step_) {
- const auto objects = makeStraightPredictedObjects(time);
+ const auto objects = makeStraightPredictedObjects(time, ObjectClassification::CAR, 0.0);
publishObjects(objects);
}
- const auto last_objects = makeStraightPredictedObjects(time_delay_ + time_step_);
+ const auto last_objects =
+ makeStraightPredictedObjects(time_delay_ + time_step_, ObjectClassification::CAR, 0.0);
EXPECT_NEAR(publishObjectsAndGetMetric(last_objects), 0.0, epsilon);
}
@@ -605,12 +610,14 @@ TEST_F(EvalTest, testYawRate_01)
const double yaw_rate = 0.1;
for (double time = 0; time <= time_delay_; time += time_step_) {
- const auto objects = rotateObjects(makeStraightPredictedObjects(time), yaw_rate * time);
+ const auto objects = rotateObjects(
+ makeStraightPredictedObjects(time, ObjectClassification::CAR, 0.0), yaw_rate * time);
publishObjects(objects);
}
for (double time = time_delay_ + time_step_; time < time_delay_ * 2; time += time_step_) {
- const auto objects = rotateObjects(makeStraightPredictedObjects(time), yaw_rate * time);
+ const auto objects = rotateObjects(
+ makeStraightPredictedObjects(time, ObjectClassification::CAR, 0.0), yaw_rate * time);
EXPECT_NEAR(publishObjectsAndGetMetric(objects), yaw_rate, epsilon);
}
}
@@ -623,12 +630,14 @@ TEST_F(EvalTest, testYawRate_minus_01)
const double yaw_rate = 0.1;
for (double time = 0; time <= time_delay_; time += time_step_) {
- const auto objects = rotateObjects(makeStraightPredictedObjects(time), -yaw_rate * time);
+ const auto objects = rotateObjects(
+ makeStraightPredictedObjects(time, ObjectClassification::CAR, 0.0), -yaw_rate * time);
publishObjects(objects);
}
for (double time = time_delay_ + time_step_; time < time_delay_ * 2; time += time_step_) {
- const auto objects = rotateObjects(makeStraightPredictedObjects(time), -yaw_rate * time);
+ const auto objects = rotateObjects(
+ makeStraightPredictedObjects(time, ObjectClassification::CAR, 0.0), -yaw_rate * time);
EXPECT_NEAR(publishObjectsAndGetMetric(objects), yaw_rate, epsilon);
}
}
@@ -641,12 +650,14 @@ TEST_F(EvalTest, testYawRate_1)
const double yaw_rate = 1.0;
for (double time = 0; time <= time_delay_; time += time_step_) {
- const auto objects = rotateObjects(makeStraightPredictedObjects(time), yaw_rate * time);
+ const auto objects = rotateObjects(
+ makeStraightPredictedObjects(time, ObjectClassification::CAR, 0.0), yaw_rate * time);
publishObjects(objects);
}
for (double time = time_delay_ + time_step_; time < time_delay_ * 2; time += time_step_) {
- const auto objects = rotateObjects(makeStraightPredictedObjects(time), yaw_rate * time);
+ const auto objects = rotateObjects(
+ makeStraightPredictedObjects(time, ObjectClassification::CAR, 0.0), yaw_rate * time);
EXPECT_NEAR(publishObjectsAndGetMetric(objects), yaw_rate, epsilon);
}
}
@@ -659,12 +670,14 @@ TEST_F(EvalTest, testYawRate_minus_1)
const double yaw_rate = 1.0;
for (double time = 0; time <= time_delay_; time += time_step_) {
- const auto objects = rotateObjects(makeStraightPredictedObjects(time), -yaw_rate * time);
+ const auto objects = rotateObjects(
+ makeStraightPredictedObjects(time, ObjectClassification::CAR, 0.0), -yaw_rate * time);
publishObjects(objects);
}
for (double time = time_delay_ + time_step_; time < time_delay_ * 2; time += time_step_) {
- const auto objects = rotateObjects(makeStraightPredictedObjects(time), -yaw_rate * time);
+ const auto objects = rotateObjects(
+ makeStraightPredictedObjects(time, ObjectClassification::CAR, 0.0), -yaw_rate * time);
EXPECT_NEAR(publishObjectsAndGetMetric(objects), yaw_rate, epsilon);
}
}
@@ -677,12 +690,14 @@ TEST_F(EvalTest, testYawRate_5)
const double yaw_rate = 5.0;
for (double time = 0; time <= time_delay_; time += time_step_) {
- const auto objects = rotateObjects(makeStraightPredictedObjects(time), yaw_rate * time);
+ const auto objects = rotateObjects(
+ makeStraightPredictedObjects(time, ObjectClassification::CAR, 0.0), yaw_rate * time);
publishObjects(objects);
}
for (double time = time_delay_ + time_step_; time < time_delay_ * 2; time += time_step_) {
- const auto objects = rotateObjects(makeStraightPredictedObjects(time), yaw_rate * time);
+ const auto objects = rotateObjects(
+ makeStraightPredictedObjects(time, ObjectClassification::CAR, 0.0), yaw_rate * time);
EXPECT_NEAR(publishObjectsAndGetMetric(objects), yaw_rate, epsilon);
}
}
@@ -695,12 +710,14 @@ TEST_F(EvalTest, testYawRate_minus_5)
const double yaw_rate = 5.0;
for (double time = 0; time <= time_delay_; time += time_step_) {
- const auto objects = rotateObjects(makeStraightPredictedObjects(time), -yaw_rate * time);
+ const auto objects = rotateObjects(
+ makeStraightPredictedObjects(time, ObjectClassification::CAR, 0.0), -yaw_rate * time);
publishObjects(objects);
}
for (double time = time_delay_ + time_step_; time < time_delay_ * 2; time += time_step_) {
- const auto objects = rotateObjects(makeStraightPredictedObjects(time), -yaw_rate * time);
+ const auto objects = rotateObjects(
+ makeStraightPredictedObjects(time, ObjectClassification::CAR, 0.0), -yaw_rate * time);
EXPECT_NEAR(publishObjectsAndGetMetric(objects), yaw_rate, epsilon);
}
}
diff --git a/launch/tier4_localization_launch/launch/localization.launch.xml b/launch/tier4_localization_launch/launch/localization.launch.xml
index 7f2f446ae1bee..cfc09459a5cb1 100644
--- a/launch/tier4_localization_launch/launch/localization.launch.xml
+++ b/launch/tier4_localization_launch/launch/localization.launch.xml
@@ -2,6 +2,7 @@
+
diff --git a/launch/tier4_localization_launch/launch/pose_twist_estimator/pose_twist_estimator.launch.xml b/launch/tier4_localization_launch/launch/pose_twist_estimator/pose_twist_estimator.launch.xml
index 3042774d16fd3..c09443be8cab6 100644
--- a/launch/tier4_localization_launch/launch/pose_twist_estimator/pose_twist_estimator.launch.xml
+++ b/launch/tier4_localization_launch/launch/pose_twist_estimator/pose_twist_estimator.launch.xml
@@ -21,6 +21,11 @@
+
+
+
+
+
@@ -91,6 +96,8 @@
+
+
diff --git a/launch/tier4_perception_launch/launch/obstacle_segmentation/ground_segmentation/ground_segmentation.launch.py b/launch/tier4_perception_launch/launch/obstacle_segmentation/ground_segmentation/ground_segmentation.launch.py
index f502aef017979..a307b192d7caa 100644
--- a/launch/tier4_perception_launch/launch/obstacle_segmentation/ground_segmentation/ground_segmentation.launch.py
+++ b/launch/tier4_perception_launch/launch/obstacle_segmentation/ground_segmentation/ground_segmentation.launch.py
@@ -281,7 +281,7 @@ def create_single_frame_obstacle_segmentation_components(self, input_topic, outp
use_additional = bool(additional_lidars)
relay_topic = "all_lidars/pointcloud"
common_pipeline_output = (
- "single_frame/pointcloud" if use_additional or use_ransac else output_topic
+ "common/pointcloud" if use_additional or use_ransac else output_topic
)
components = self.create_common_pipeline(
diff --git a/launch/tier4_simulator_launch/launch/simulator.launch.xml b/launch/tier4_simulator_launch/launch/simulator.launch.xml
index 4af7b3abaa2e6..76fb66e4ebfdf 100644
--- a/launch/tier4_simulator_launch/launch/simulator.launch.xml
+++ b/launch/tier4_simulator_launch/launch/simulator.launch.xml
@@ -127,6 +127,8 @@
+
+
diff --git a/localization/ndt_scan_matcher/src/map_update_module.cpp b/localization/ndt_scan_matcher/src/map_update_module.cpp
index f29d6261fc02b..ca56a93cec859 100644
--- a/localization/ndt_scan_matcher/src/map_update_module.cpp
+++ b/localization/ndt_scan_matcher/src/map_update_module.cpp
@@ -48,7 +48,8 @@ MapUpdateModule::MapUpdateModule(
bool MapUpdateModule::should_update_map(const geometry_msgs::msg::Point & position)
{
if (last_update_position_ == std::nullopt) {
- return false;
+ need_rebuild_ = true;
+ return true;
}
const double dx = position.x - last_update_position_.value().x;
diff --git a/localization/pose_initializer/config/pose_initializer.param.yaml b/localization/pose_initializer/config/pose_initializer.param.yaml
index 88acbfb52611d..90ec78257e6cb 100644
--- a/localization/pose_initializer/config/pose_initializer.param.yaml
+++ b/localization/pose_initializer/config/pose_initializer.param.yaml
@@ -1,5 +1,9 @@
/**:
ros__parameters:
+ user_defined_initial_pose:
+ enable: $(var user_defined_initial_pose/enable)
+ pose: $(var user_defined_initial_pose/pose)
+
gnss_pose_timeout: 3.0 # [sec]
stop_check_duration: 3.0 # [sec]
ekf_enabled: $(var ekf_enabled)
diff --git a/localization/pose_initializer/schema/pose_initializer.schema.json b/localization/pose_initializer/schema/pose_initializer.schema.json
index ced4dc78b93b1..d5b92c45d3038 100644
--- a/localization/pose_initializer/schema/pose_initializer.schema.json
+++ b/localization/pose_initializer/schema/pose_initializer.schema.json
@@ -6,6 +6,23 @@
"pose_initializer": {
"type": "object",
"properties": {
+ "user_defined_initial_pose": {
+ "type": "object",
+ "properties": {
+ "enable": {
+ "type": "string",
+ "description": "If true, user_defined_initial_pose.pose is set as the initial position. [boolean]",
+ "default": "false"
+ },
+ "pose": {
+ "type": "string",
+ "description": "initial pose (x, y, z, quat_x, quat_y, quat_z, quat_w). [array]",
+ "default": "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0]"
+ }
+ },
+ "required": ["enable", "pose"],
+ "additionalProperties": false
+ },
"gnss_pose_timeout": {
"type": "number",
"description": "The duration that the GNSS pose is valid. [sec]",
@@ -55,6 +72,7 @@
}
},
"required": [
+ "user_defined_initial_pose",
"gnss_pose_timeout",
"stop_check_duration",
"ekf_enabled",
diff --git a/localization/pose_initializer/src/pose_initializer/ekf_localization_trigger_module.cpp b/localization/pose_initializer/src/pose_initializer/ekf_localization_trigger_module.cpp
index ac9796b687637..9ba424f8e857f 100644
--- a/localization/pose_initializer/src/pose_initializer/ekf_localization_trigger_module.cpp
+++ b/localization/pose_initializer/src/pose_initializer/ekf_localization_trigger_module.cpp
@@ -23,13 +23,20 @@
using ServiceException = component_interface_utils::ServiceException;
using Initialize = localization_interface::Initialize;
-EkfLocalizationTriggerModule::EkfLocalizationTriggerModule(rclcpp::Node * node)
-: logger_(node->get_logger())
+EkfLocalizationTriggerModule::EkfLocalizationTriggerModule(rclcpp::Node * node) : node_(node)
{
- client_ekf_trigger_ = node->create_client("ekf_trigger_node");
+ client_ekf_trigger_ = node_->create_client("ekf_trigger_node");
}
-void EkfLocalizationTriggerModule::send_request(bool flag) const
+void EkfLocalizationTriggerModule::wait_for_service()
+{
+ while (!client_ekf_trigger_->wait_for_service(std::chrono::seconds(1))) {
+ RCLCPP_INFO(node_->get_logger(), "EKF triggering service is not available, waiting...");
+ }
+ RCLCPP_INFO(node_->get_logger(), "EKF triggering service is available!");
+}
+
+void EkfLocalizationTriggerModule::send_request(bool flag, bool need_spin) const
{
const auto req = std::make_shared();
std::string command_name;
@@ -46,10 +53,14 @@ void EkfLocalizationTriggerModule::send_request(bool flag) const
auto future_ekf = client_ekf_trigger_->async_send_request(req);
+ if (need_spin) {
+ rclcpp::spin_until_future_complete(node_->get_node_base_interface(), future_ekf);
+ }
+
if (future_ekf.get()->success) {
- RCLCPP_INFO(logger_, "EKF %s succeeded", command_name.c_str());
+ RCLCPP_INFO(node_->get_logger(), "EKF %s succeeded", command_name.c_str());
} else {
- RCLCPP_INFO(logger_, "EKF %s failed", command_name.c_str());
+ RCLCPP_INFO(node_->get_logger(), "EKF %s failed", command_name.c_str());
throw ServiceException(
Initialize::Service::Response::ERROR_ESTIMATION, "EKF " + command_name + " failed");
}
diff --git a/localization/pose_initializer/src/pose_initializer/ekf_localization_trigger_module.hpp b/localization/pose_initializer/src/pose_initializer/ekf_localization_trigger_module.hpp
index d1b8eb986105f..901e4ec4414b5 100644
--- a/localization/pose_initializer/src/pose_initializer/ekf_localization_trigger_module.hpp
+++ b/localization/pose_initializer/src/pose_initializer/ekf_localization_trigger_module.hpp
@@ -26,10 +26,11 @@ class EkfLocalizationTriggerModule
public:
explicit EkfLocalizationTriggerModule(rclcpp::Node * node);
- void send_request(bool flag) const;
+ void wait_for_service();
+ void send_request(bool flag, bool need_spin = false) const;
private:
- rclcpp::Logger logger_;
+ rclcpp::Node * node_;
rclcpp::Client::SharedPtr client_ekf_trigger_;
};
diff --git a/localization/pose_initializer/src/pose_initializer/ndt_localization_trigger_module.cpp b/localization/pose_initializer/src/pose_initializer/ndt_localization_trigger_module.cpp
index e1285f5c31c83..436b1e2df3b21 100644
--- a/localization/pose_initializer/src/pose_initializer/ndt_localization_trigger_module.cpp
+++ b/localization/pose_initializer/src/pose_initializer/ndt_localization_trigger_module.cpp
@@ -23,13 +23,20 @@
using ServiceException = component_interface_utils::ServiceException;
using Initialize = localization_interface::Initialize;
-NdtLocalizationTriggerModule::NdtLocalizationTriggerModule(rclcpp::Node * node)
-: logger_(node->get_logger())
+NdtLocalizationTriggerModule::NdtLocalizationTriggerModule(rclcpp::Node * node) : node_(node)
{
- client_ndt_trigger_ = node->create_client("ndt_trigger_node");
+ client_ndt_trigger_ = node_->create_client("ndt_trigger_node");
}
-void NdtLocalizationTriggerModule::send_request(bool flag) const
+void NdtLocalizationTriggerModule::wait_for_service()
+{
+ while (!client_ndt_trigger_->wait_for_service(std::chrono::seconds(1))) {
+ RCLCPP_INFO(node_->get_logger(), "NDT triggering service is not available, waiting...");
+ }
+ RCLCPP_INFO(node_->get_logger(), "NDT triggering service is available!");
+}
+
+void NdtLocalizationTriggerModule::send_request(bool flag, bool need_spin) const
{
const auto req = std::make_shared();
std::string command_name;
@@ -46,10 +53,14 @@ void NdtLocalizationTriggerModule::send_request(bool flag) const
auto future_ndt = client_ndt_trigger_->async_send_request(req);
+ if (need_spin) {
+ rclcpp::spin_until_future_complete(node_->get_node_base_interface(), future_ndt);
+ }
+
if (future_ndt.get()->success) {
- RCLCPP_INFO(logger_, "NDT %s succeeded", command_name.c_str());
+ RCLCPP_INFO(node_->get_logger(), "NDT %s succeeded", command_name.c_str());
} else {
- RCLCPP_INFO(logger_, "NDT %s failed", command_name.c_str());
+ RCLCPP_INFO(node_->get_logger(), "NDT %s failed", command_name.c_str());
throw ServiceException(
Initialize::Service::Response::ERROR_ESTIMATION, "NDT " + command_name + " failed");
}
diff --git a/localization/pose_initializer/src/pose_initializer/ndt_localization_trigger_module.hpp b/localization/pose_initializer/src/pose_initializer/ndt_localization_trigger_module.hpp
index 91e37c9bb90e9..1c820557fb8ff 100644
--- a/localization/pose_initializer/src/pose_initializer/ndt_localization_trigger_module.hpp
+++ b/localization/pose_initializer/src/pose_initializer/ndt_localization_trigger_module.hpp
@@ -26,10 +26,11 @@ class NdtLocalizationTriggerModule
public:
explicit NdtLocalizationTriggerModule(rclcpp::Node * node);
- void send_request(bool flag) const;
+ void wait_for_service();
+ void send_request(bool flag, bool need_spin = false) const;
private:
- rclcpp::Logger logger_;
+ rclcpp::Node * node_;
rclcpp::Client::SharedPtr client_ndt_trigger_;
};
diff --git a/localization/pose_initializer/src/pose_initializer/pose_initializer_core.cpp b/localization/pose_initializer/src/pose_initializer/pose_initializer_core.cpp
index 4585414c20b0d..bc86b5476dcca 100644
--- a/localization/pose_initializer/src/pose_initializer/pose_initializer_core.cpp
+++ b/localization/pose_initializer/src/pose_initializer/pose_initializer_core.cpp
@@ -57,6 +57,31 @@ PoseInitializer::PoseInitializer() : Node("pose_initializer")
logger_configure_ = std::make_unique(this);
change_state(State::Message::UNINITIALIZED);
+
+ if (declare_parameter("user_defined_initial_pose.enable")) {
+ const auto initial_pose_array =
+ declare_parameter>("user_defined_initial_pose.pose");
+ if (initial_pose_array.size() != 7) {
+ throw std::invalid_argument(
+ "Could not set user defined initial pose. The size of initial_pose is " +
+ std::to_string(initial_pose_array.size()) + ". It must be 7.");
+ } else if (
+ std::abs(initial_pose_array[3]) < 1e-6 && std::abs(initial_pose_array[4]) < 1e-6 &&
+ std::abs(initial_pose_array[5]) < 1e-6 && std::abs(initial_pose_array[6]) < 1e-6) {
+ throw std::invalid_argument("Input quaternion is invalid. All elements are close to zero.");
+ } else {
+ geometry_msgs::msg::Pose initial_pose;
+ initial_pose.position.x = initial_pose_array[0];
+ initial_pose.position.y = initial_pose_array[1];
+ initial_pose.position.z = initial_pose_array[2];
+ initial_pose.orientation.x = initial_pose_array[3];
+ initial_pose.orientation.y = initial_pose_array[4];
+ initial_pose.orientation.z = initial_pose_array[5];
+ initial_pose.orientation.w = initial_pose_array[6];
+
+ set_user_defined_initial_pose(initial_pose);
+ }
+ }
}
PoseInitializer::~PoseInitializer()
@@ -71,6 +96,47 @@ void PoseInitializer::change_state(State::Message::_state_type state)
pub_state_->publish(state_);
}
+// To execute in the constructor, you need to call ros spin.
+// Conversely, ros spin should not be called elsewhere
+void PoseInitializer::change_node_trigger(bool flag, bool need_spin)
+{
+ try {
+ if (ekf_localization_trigger_) {
+ ekf_localization_trigger_->wait_for_service();
+ ekf_localization_trigger_->send_request(flag, need_spin);
+ }
+ if (ndt_localization_trigger_) {
+ ndt_localization_trigger_->wait_for_service();
+ ndt_localization_trigger_->send_request(flag, need_spin);
+ }
+ } catch (const ServiceException & error) {
+ throw;
+ }
+}
+
+void PoseInitializer::set_user_defined_initial_pose(const geometry_msgs::msg::Pose initial_pose)
+{
+ try {
+ change_state(State::Message::INITIALIZING);
+ change_node_trigger(false, true);
+
+ PoseWithCovarianceStamped pose;
+ pose.header.frame_id = "map";
+ pose.header.stamp = now();
+ pose.pose.pose = initial_pose;
+ pose.pose.covariance = output_pose_covariance_;
+ pub_reset_->publish(pose);
+
+ change_node_trigger(true, true);
+ change_state(State::Message::INITIALIZED);
+
+ RCLCPP_INFO(get_logger(), "Set user defined initial pose");
+ } catch (const ServiceException & error) {
+ change_state(State::Message::UNINITIALIZED);
+ RCLCPP_WARN(get_logger(), "Could not set user defined initial pose");
+ }
+}
+
void PoseInitializer::on_initialize(
const Initialize::Service::Request::SharedPtr req,
const Initialize::Service::Response::SharedPtr res)
@@ -82,12 +148,8 @@ void PoseInitializer::on_initialize(
}
try {
change_state(State::Message::INITIALIZING);
- if (ekf_localization_trigger_) {
- ekf_localization_trigger_->send_request(false);
- }
- if (ndt_localization_trigger_) {
- ndt_localization_trigger_->send_request(false);
- }
+ change_node_trigger(false, false);
+
auto pose = req->pose.empty() ? get_gnss_pose() : req->pose.front();
if (ndt_) {
pose = ndt_->align_pose(pose);
@@ -98,12 +160,8 @@ void PoseInitializer::on_initialize(
}
pose.pose.covariance = output_pose_covariance_;
pub_reset_->publish(pose);
- if (ekf_localization_trigger_) {
- ekf_localization_trigger_->send_request(true);
- }
- if (ndt_localization_trigger_) {
- ndt_localization_trigger_->send_request(true);
- }
+
+ change_node_trigger(true, false);
res->status.success = true;
change_state(State::Message::INITIALIZED);
} catch (const ServiceException & error) {
diff --git a/localization/pose_initializer/src/pose_initializer/pose_initializer_core.hpp b/localization/pose_initializer/src/pose_initializer/pose_initializer_core.hpp
index 014c8e9bf6e04..623cfe50307f5 100644
--- a/localization/pose_initializer/src/pose_initializer/pose_initializer_core.hpp
+++ b/localization/pose_initializer/src/pose_initializer/pose_initializer_core.hpp
@@ -58,6 +58,9 @@ class PoseInitializer : public rclcpp::Node
std::unique_ptr ndt_localization_trigger_;
std::unique_ptr logger_configure_;
double stop_check_duration_;
+
+ void change_node_trigger(bool flag, bool need_spin = false);
+ void set_user_defined_initial_pose(const geometry_msgs::msg::Pose initial_pose);
void change_state(State::Message::_state_type state);
void on_initialize(
const Initialize::Service::Request::SharedPtr req,
diff --git a/map/map_projection_loader/test/test_node_load_local_cartesian_utm_from_yaml.test.py b/map/map_projection_loader/test/test_node_load_local_cartesian_utm_from_yaml.test.py
index ec13df010c8c3..b8540550ce9da 100644
--- a/map/map_projection_loader/test/test_node_load_local_cartesian_utm_from_yaml.test.py
+++ b/map/map_projection_loader/test/test_node_load_local_cartesian_utm_from_yaml.test.py
@@ -61,7 +61,7 @@ def generate_test_description():
LaunchDescription(
[
map_projection_loader_node,
- # Start test after 1s - gives time for the static_centerline_optimizer to finish initialization
+ # Start test after 1s - gives time for the static_centerline_generator to finish initialization
launch.actions.TimerAction(
period=1.0, actions=[launch_testing.actions.ReadyToTest()]
),
diff --git a/map/map_projection_loader/test/test_node_load_local_from_yaml.test.py b/map/map_projection_loader/test/test_node_load_local_from_yaml.test.py
index ccec68486b79c..c7697038cc253 100644
--- a/map/map_projection_loader/test/test_node_load_local_from_yaml.test.py
+++ b/map/map_projection_loader/test/test_node_load_local_from_yaml.test.py
@@ -61,7 +61,7 @@ def generate_test_description():
LaunchDescription(
[
map_projection_loader_node,
- # Start test after 1s - gives time for the static_centerline_optimizer to finish initialization
+ # Start test after 1s - gives time for the static_centerline_generator to finish initialization
launch.actions.TimerAction(
period=1.0, actions=[launch_testing.actions.ReadyToTest()]
),
diff --git a/map/map_projection_loader/test/test_node_load_mgrs_from_yaml.test.py b/map/map_projection_loader/test/test_node_load_mgrs_from_yaml.test.py
index 200504d0ea18f..f75beddc6827c 100644
--- a/map/map_projection_loader/test/test_node_load_mgrs_from_yaml.test.py
+++ b/map/map_projection_loader/test/test_node_load_mgrs_from_yaml.test.py
@@ -61,7 +61,7 @@ def generate_test_description():
LaunchDescription(
[
map_projection_loader_node,
- # Start test after 1s - gives time for the static_centerline_optimizer to finish initialization
+ # Start test after 1s - gives time for the static_centerline_generator to finish initialization
launch.actions.TimerAction(
period=1.0, actions=[launch_testing.actions.ReadyToTest()]
),
diff --git a/map/map_projection_loader/test/test_node_load_transverse_mercator_from_yaml.test.py b/map/map_projection_loader/test/test_node_load_transverse_mercator_from_yaml.test.py
index 7883ae6aa3c99..765f3cde04679 100644
--- a/map/map_projection_loader/test/test_node_load_transverse_mercator_from_yaml.test.py
+++ b/map/map_projection_loader/test/test_node_load_transverse_mercator_from_yaml.test.py
@@ -61,7 +61,7 @@ def generate_test_description():
LaunchDescription(
[
map_projection_loader_node,
- # Start test after 1s - gives time for the static_centerline_optimizer to finish initialization
+ # Start test after 1s - gives time for the static_centerline_generator to finish initialization
launch.actions.TimerAction(
period=1.0, actions=[launch_testing.actions.ReadyToTest()]
),
diff --git a/perception/detected_object_validation/src/obstacle_pointcloud_based_validator.cpp b/perception/detected_object_validation/src/obstacle_pointcloud_based_validator.cpp
index e39de639a6121..db2e6ec3a7901 100644
--- a/perception/detected_object_validation/src/obstacle_pointcloud_based_validator.cpp
+++ b/perception/detected_object_validation/src/obstacle_pointcloud_based_validator.cpp
@@ -327,15 +327,19 @@ void ObstaclePointCloudBasedValidator::onObjectsAndObstaclePointCloud(
// objects_pub_->publish(*input_objects);
return;
}
+ bool validation_is_ready = true;
if (!validator_->setKdtreeInputCloud(input_obstacle_pointcloud)) {
- RCLCPP_WARN_THROTTLE(this->get_logger(), *this->get_clock(), 5, "cannot receive pointcloud");
- return;
+ RCLCPP_WARN_THROTTLE(
+ this->get_logger(), *this->get_clock(), 5,
+ "obstacle pointcloud is empty! Can not validate objects.");
+ validation_is_ready = false;
}
for (size_t i = 0; i < transformed_objects.objects.size(); ++i) {
const auto & transformed_object = transformed_objects.objects.at(i);
const auto & object = input_objects->objects.at(i);
- const auto validated = validator_->validate_object(transformed_object);
+ const auto validated =
+ validation_is_ready ? validator_->validate_object(transformed_object) : false;
if (debugger_) {
debugger_->addNeighborPointcloud(validator_->getDebugNeighborPointCloud());
debugger_->addPointcloudWithinPolygon(validator_->getDebugPointCloudWithinObject());
diff --git a/perception/ground_segmentation/config/ground_segmentation.param.yaml b/perception/ground_segmentation/config/ground_segmentation.param.yaml
index 756882391183e..594ef1fe974b2 100644
--- a/perception/ground_segmentation/config/ground_segmentation.param.yaml
+++ b/perception/ground_segmentation/config/ground_segmentation.param.yaml
@@ -33,3 +33,4 @@
center_pcl_shift: 0.0
radial_divider_angle_deg: 1.0
use_recheck_ground_cluster: true
+ use_lowest_point: true
diff --git a/perception/ground_segmentation/config/scan_ground_filter.param.yaml b/perception/ground_segmentation/config/scan_ground_filter.param.yaml
index bc02a1ab7e6e7..35d494a620b19 100644
--- a/perception/ground_segmentation/config/scan_ground_filter.param.yaml
+++ b/perception/ground_segmentation/config/scan_ground_filter.param.yaml
@@ -15,3 +15,4 @@
center_pcl_shift: 0.0
radial_divider_angle_deg: 1.0
use_recheck_ground_cluster: true
+ use_lowest_point: true
diff --git a/perception/ground_segmentation/docs/scan-ground-filter.md b/perception/ground_segmentation/docs/scan-ground-filter.md
index 21df6fa6ea1b9..d4eb9c6f3addf 100644
--- a/perception/ground_segmentation/docs/scan-ground-filter.md
+++ b/perception/ground_segmentation/docs/scan-ground-filter.md
@@ -50,6 +50,7 @@ This implementation inherits `pointcloud_preprocessor::Filter` class, please ref
| `low_priority_region_x` | float | -20.0 | The non-zero x threshold in back side from which small objects detection is low priority [m] |
| `elevation_grid_mode` | bool | true | Elevation grid scan mode option |
| `use_recheck_ground_cluster` | bool | true | Enable recheck ground cluster |
+| `use_lowest_point` | bool | true | to select lowest point for reference in recheck ground cluster, otherwise select middle point |
## Assumptions / Known limits
diff --git a/perception/ground_segmentation/include/ground_segmentation/scan_ground_filter_nodelet.hpp b/perception/ground_segmentation/include/ground_segmentation/scan_ground_filter_nodelet.hpp
index d017d06929702..d97bbaa2118e5 100644
--- a/perception/ground_segmentation/include/ground_segmentation/scan_ground_filter_nodelet.hpp
+++ b/perception/ground_segmentation/include/ground_segmentation/scan_ground_filter_nodelet.hpp
@@ -194,6 +194,8 @@ class ScanGroundFilterComponent : public pointcloud_preprocessor::Filter
split_height_distance_; // useful for close points
bool use_virtual_ground_point_;
bool use_recheck_ground_cluster_; // to enable recheck ground cluster
+ bool use_lowest_point_; // to select lowest point for reference in recheck ground cluster,
+ // otherwise select middle point
size_t radial_dividers_num_;
VehicleInfo vehicle_info_;
@@ -258,7 +260,7 @@ class ScanGroundFilterComponent : public pointcloud_preprocessor::Filter
* @param non_ground_indices Output non-ground PointCloud indices
*/
void recheckGroundCluster(
- PointsCentroid & gnd_cluster, const float non_ground_threshold,
+ PointsCentroid & gnd_cluster, const float non_ground_threshold, const bool use_lowest_point,
pcl::PointIndices & non_ground_indices);
/*!
* Returns the resulting complementary PointCloud, one with the points kept
diff --git a/perception/ground_segmentation/src/scan_ground_filter_nodelet.cpp b/perception/ground_segmentation/src/scan_ground_filter_nodelet.cpp
index 7a0333d95075b..34573b564fa36 100644
--- a/perception/ground_segmentation/src/scan_ground_filter_nodelet.cpp
+++ b/perception/ground_segmentation/src/scan_ground_filter_nodelet.cpp
@@ -57,6 +57,7 @@ ScanGroundFilterComponent::ScanGroundFilterComponent(const rclcpp::NodeOptions &
split_height_distance_ = declare_parameter("split_height_distance");
use_virtual_ground_point_ = declare_parameter("use_virtual_ground_point");
use_recheck_ground_cluster_ = declare_parameter("use_recheck_ground_cluster");
+ use_lowest_point_ = declare_parameter("use_lowest_point");
radial_dividers_num_ = std::ceil(2.0 * M_PI / radial_divider_angle_rad_);
vehicle_info_ = VehicleInfoUtil(*this).getVehicleInfo();
@@ -316,14 +317,15 @@ void ScanGroundFilterComponent::checkBreakGndGrid(
}
void ScanGroundFilterComponent::recheckGroundCluster(
- PointsCentroid & gnd_cluster, const float non_ground_threshold,
+ PointsCentroid & gnd_cluster, const float non_ground_threshold, const bool use_lowest_point,
pcl::PointIndices & non_ground_indices)
{
- const float min_gnd_height = gnd_cluster.getMinHeight();
+ float reference_height =
+ use_lowest_point ? gnd_cluster.getMinHeight() : gnd_cluster.getAverageHeight();
const pcl::PointIndices & gnd_indices = gnd_cluster.getIndicesRef();
const std::vector & height_list = gnd_cluster.getHeightListRef();
for (size_t i = 0; i < height_list.size(); ++i) {
- if (height_list.at(i) >= min_gnd_height + non_ground_threshold) {
+ if (height_list.at(i) >= reference_height + non_ground_threshold) {
non_ground_indices.indices.push_back(gnd_indices.indices.at(i));
}
}
@@ -403,7 +405,8 @@ void ScanGroundFilterComponent::classifyPointCloudGridScan(
if (p->grid_id > prev_p->grid_id && ground_cluster.getAverageRadius() > 0.0) {
// check if the prev grid have ground point cloud
if (use_recheck_ground_cluster_) {
- recheckGroundCluster(ground_cluster, non_ground_height_threshold_, out_no_ground_indices);
+ recheckGroundCluster(
+ ground_cluster, non_ground_height_threshold_, use_lowest_point_, out_no_ground_indices);
}
curr_gnd_grid.radius = ground_cluster.getAverageRadius();
curr_gnd_grid.avg_height = ground_cluster.getAverageHeight();
diff --git a/perception/ground_segmentation/test/test_scan_ground_filter.cpp b/perception/ground_segmentation/test/test_scan_ground_filter.cpp
index 444a38ea44754..e48bd36d8c54e 100644
--- a/perception/ground_segmentation/test/test_scan_ground_filter.cpp
+++ b/perception/ground_segmentation/test/test_scan_ground_filter.cpp
@@ -83,6 +83,7 @@ class ScanGroundFilterTest : public ::testing::Test
rclcpp::Parameter("radial_divider_angle_deg", radial_divider_angle_deg_));
parameters.emplace_back(
rclcpp::Parameter("use_recheck_ground_cluster", use_recheck_ground_cluster_));
+ parameters.emplace_back(rclcpp::Parameter("use_lowest_point", use_lowest_point_));
options.parameter_overrides(parameters);
@@ -157,6 +158,7 @@ class ScanGroundFilterTest : public ::testing::Test
center_pcl_shift_ = params["center_pcl_shift"].as();
radial_divider_angle_deg_ = params["radial_divider_angle_deg"].as();
use_recheck_ground_cluster_ = params["use_recheck_ground_cluster"].as();
+ use_lowest_point_ = params["use_lowest_point"].as();
}
float global_slope_max_angle_deg_ = 0.0;
@@ -174,6 +176,7 @@ class ScanGroundFilterTest : public ::testing::Test
float center_pcl_shift_;
float radial_divider_angle_deg_;
bool use_recheck_ground_cluster_;
+ bool use_lowest_point_;
};
TEST_F(ScanGroundFilterTest, TestCase1)
diff --git a/perception/map_based_prediction/src/map_based_prediction_node.cpp b/perception/map_based_prediction/src/map_based_prediction_node.cpp
index e12b7c54c3a9f..56dc1c2293583 100644
--- a/perception/map_based_prediction/src/map_based_prediction_node.cpp
+++ b/perception/map_based_prediction/src/map_based_prediction_node.cpp
@@ -1360,7 +1360,7 @@ void MapBasedPredictionNode::removeOldObjectsHistory(
const double latest_object_time = rclcpp::Time(object_data.back().header.stamp).seconds();
// Delete Old Objects
- if (current_time - latest_object_time > 2.0) {
+ if (current_time - latest_object_time > object_buffer_time_length_) {
invalid_object_id.push_back(object_id);
continue;
}
@@ -1368,7 +1368,7 @@ void MapBasedPredictionNode::removeOldObjectsHistory(
// Delete old information
while (!object_data.empty()) {
const double post_object_time = rclcpp::Time(object_data.front().header.stamp).seconds();
- if (current_time - post_object_time > 2.0) {
+ if (current_time - post_object_time > object_buffer_time_length_) {
// Delete Old Position
object_data.pop_front();
} else {
diff --git a/perception/multi_object_tracker/CMakeLists.txt b/perception/multi_object_tracker/CMakeLists.txt
index fe90be8c583c2..41d150ef0ba1b 100644
--- a/perception/multi_object_tracker/CMakeLists.txt
+++ b/perception/multi_object_tracker/CMakeLists.txt
@@ -22,6 +22,8 @@ include_directories(
# Generate exe file
set(MULTI_OBJECT_TRACKER_SRC
src/multi_object_tracker_core.cpp
+ src/debugger.cpp
+ src/processor/processor.cpp
src/data_association/data_association.cpp
src/data_association/mu_successive_shortest_path/mu_successive_shortest_path_wrapper.cpp
src/tracker/motion_model/motion_model_base.cpp
@@ -46,12 +48,14 @@ ament_auto_add_library(multi_object_tracker_node SHARED
target_link_libraries(multi_object_tracker_node
Eigen3::Eigen
- glog::glog
)
-rclcpp_components_register_node(multi_object_tracker_node
- PLUGIN "MultiObjectTracker"
- EXECUTABLE multi_object_tracker
+ament_auto_add_executable(${PROJECT_NAME}
+ src/multi_object_tracker_node.cpp
+)
+
+target_link_libraries(${PROJECT_NAME}
+ multi_object_tracker_node glog
)
ament_auto_package(INSTALL_TO_SHARE
diff --git a/perception/multi_object_tracker/include/multi_object_tracker/debugger.hpp b/perception/multi_object_tracker/include/multi_object_tracker/debugger.hpp
new file mode 100644
index 0000000000000..90291ae6fec18
--- /dev/null
+++ b/perception/multi_object_tracker/include/multi_object_tracker/debugger.hpp
@@ -0,0 +1,75 @@
+// Copyright 2024 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 MULTI_OBJECT_TRACKER__DEBUGGER_HPP_
+#define MULTI_OBJECT_TRACKER__DEBUGGER_HPP_
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+
+/**
+ * @brief Debugger class for multi object tracker
+ * @details This class is used to publish debug information of multi object tracker
+ */
+class TrackerDebugger
+{
+public:
+ explicit TrackerDebugger(rclcpp::Node & node);
+ void publishTentativeObjects(
+ const autoware_auto_perception_msgs::msg::TrackedObjects & tentative_objects) const;
+ void startMeasurementTime(
+ const rclcpp::Time & now, const rclcpp::Time & measurement_header_stamp);
+ void endMeasurementTime(const rclcpp::Time & now);
+ void startPublishTime(const rclcpp::Time & now);
+ void endPublishTime(const rclcpp::Time & now, const rclcpp::Time & object_time);
+
+ void setupDiagnostics();
+ void checkDelay(diagnostic_updater::DiagnosticStatusWrapper & stat);
+ struct DEBUG_SETTINGS
+ {
+ bool publish_processing_time;
+ bool publish_tentative_objects;
+ double diagnostics_warn_delay;
+ double diagnostics_error_delay;
+ } debug_settings_;
+ double pipeline_latency_ms_ = 0.0;
+ diagnostic_updater::Updater diagnostic_updater_;
+ bool shouldPublishTentativeObjects() const { return debug_settings_.publish_tentative_objects; }
+
+private:
+ void loadParameters();
+ bool is_initialized_ = false;
+ rclcpp::Node & node_;
+ rclcpp::Publisher::SharedPtr
+ debug_tentative_objects_pub_;
+ std::unique_ptr processing_time_publisher_;
+ rclcpp::Time last_input_stamp_;
+ rclcpp::Time stamp_process_start_;
+ rclcpp::Time stamp_process_end_;
+ rclcpp::Time stamp_publish_start_;
+ rclcpp::Time stamp_publish_output_;
+};
+
+#endif // MULTI_OBJECT_TRACKER__DEBUGGER_HPP_
diff --git a/perception/multi_object_tracker/include/multi_object_tracker/multi_object_tracker_core.hpp b/perception/multi_object_tracker/include/multi_object_tracker/multi_object_tracker_core.hpp
index ca59f994a3b0e..f788dd3895216 100644
--- a/perception/multi_object_tracker/include/multi_object_tracker/multi_object_tracker_core.hpp
+++ b/perception/multi_object_tracker/include/multi_object_tracker/multi_object_tracker_core.hpp
@@ -20,12 +20,11 @@
#define MULTI_OBJECT_TRACKER__MULTI_OBJECT_TRACKER_CORE_HPP_
#include "multi_object_tracker/data_association/data_association.hpp"
+#include "multi_object_tracker/debugger.hpp"
+#include "multi_object_tracker/processor/processor.hpp"
#include "multi_object_tracker/tracker/model/tracker_base.hpp"
#include
-#include
-#include
-#include
#include
#include
@@ -41,9 +40,6 @@
#include
#endif
-#include
-#include
-
#include
#include
@@ -51,82 +47,44 @@
#include