Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace debug msgs #9797

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions common/autoware_goal_distance_calculator/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ This node publishes deviation of self-pose from goal pose.

### Output

| Name | Type | Description |
| ------------------------ | --------------------------------------- | ------------------------------------------------------------- |
| `deviation/lateral` | `tier4_debug_msgs::msg::Float64Stamped` | publish lateral deviation of self-pose from goal pose[m] |
| `deviation/longitudinal` | `tier4_debug_msgs::msg::Float64Stamped` | publish longitudinal deviation of self-pose from goal pose[m] |
| `deviation/yaw` | `tier4_debug_msgs::msg::Float64Stamped` | publish yaw deviation of self-pose from goal pose[rad] |
| `deviation/yaw_deg` | `tier4_debug_msgs::msg::Float64Stamped` | publish yaw deviation of self-pose from goal pose[deg] |
| Name | Type | Description |
| ------------------------ | --------------------------------------------------- | ------------------------------------------------------------- |
| `deviation/lateral` | `autoware_internal_debug_msgs::msg::Float64Stamped` | publish lateral deviation of self-pose from goal pose[m] |
| `deviation/longitudinal` | `autoware_internal_debug_msgs::msg::Float64Stamped` | publish longitudinal deviation of self-pose from goal pose[m] |
| `deviation/yaw` | `autoware_internal_debug_msgs::msg::Float64Stamped` | publish yaw deviation of self-pose from goal pose[rad] |
| `deviation/yaw_deg` | `autoware_internal_debug_msgs::msg::Float64Stamped` | publish yaw deviation of self-pose from goal pose[deg] |

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#include <autoware/universe_utils/ros/self_pose_listener.hpp>
#include <rclcpp/rclcpp.hpp>

#include <autoware_internal_debug_msgs/msg/float64_stamped.hpp>
#include <autoware_planning_msgs/msg/lanelet_route.hpp>
#include <geometry_msgs/msg/pose_stamped.hpp>
#include <tier4_debug_msgs/msg/float64_stamped.hpp>

#include <tf2_ros/transform_listener.h>

Expand Down
2 changes: 1 addition & 1 deletion common/autoware_goal_distance_calculator/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>autoware_internal_debug_msgs</depend>
<depend>autoware_planning_msgs</depend>
<depend>autoware_universe_utils</depend>
<depend>geometry_msgs</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>tier4_debug_msgs</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <rclcpp/rclcpp.hpp>
#include <rclcpp/timer.hpp>

#include <tier4_debug_msgs/msg/float64_stamped.hpp>
#include <autoware_internal_debug_msgs/msg/float64_stamped.hpp>

#include <chrono>
#include <functional>
Expand Down Expand Up @@ -100,12 +100,13 @@ void GoalDistanceCalculatorNode::onTimer()
using autoware::universe_utils::rad2deg;
const auto & deviation = output.goal_deviation;

debug_publisher_.publish<tier4_debug_msgs::msg::Float64Stamped>(
debug_publisher_.publish<autoware_internal_debug_msgs::msg::Float64Stamped>(
"deviation/lateral", deviation.lateral);
debug_publisher_.publish<tier4_debug_msgs::msg::Float64Stamped>(
debug_publisher_.publish<autoware_internal_debug_msgs::msg::Float64Stamped>(
"deviation/longitudinal", deviation.longitudinal);
debug_publisher_.publish<tier4_debug_msgs::msg::Float64Stamped>("deviation/yaw", deviation.yaw);
debug_publisher_.publish<tier4_debug_msgs::msg::Float64Stamped>(
debug_publisher_.publish<autoware_internal_debug_msgs::msg::Float64Stamped>(
"deviation/yaw", deviation.yaw);
debug_publisher_.publish<autoware_internal_debug_msgs::msg::Float64Stamped>(
"deviation/yaw_deg", rad2deg(deviation.yaw));
RCLCPP_INFO_THROTTLE(
this->get_logger(), *this->get_clock(), 1000,
Expand Down
6 changes: 3 additions & 3 deletions common/autoware_path_distance_calculator/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Note that the distance means the arc-length along the path, not the Euclidean di

### Output

| Name | Type | Description |
| ------------ | --------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `~/distance` | `tier4_debug_msgs::msg::Float64Stamped` | Publish a distance from the closest path point from the self-position to the end point of the path[m] |
| Name | Type | Description |
| ------------ | --------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `~/distance` | `autoware_internal_debug_msgs::msg::Float64Stamped` | Publish a distance from the closest path point from the self-position to the end point of the path[m] |

## Parameters

Expand Down
2 changes: 1 addition & 1 deletion common/autoware_path_distance_calculator/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>autoware_internal_debug_msgs</depend>
<depend>autoware_motion_utils</depend>
<depend>autoware_planning_msgs</depend>
<depend>autoware_universe_utils</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>tier4_debug_msgs</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ namespace autoware::path_distance_calculator
PathDistanceCalculator::PathDistanceCalculator(const rclcpp::NodeOptions & options)
: Node("path_distance_calculator", options), self_pose_listener_(this)
{
pub_dist_ =
create_publisher<tier4_debug_msgs::msg::Float64Stamped>("~/output/distance", rclcpp::QoS(1));
pub_dist_ = create_publisher<autoware_internal_debug_msgs::msg::Float64Stamped>(
"~/output/distance", rclcpp::QoS(1));

using std::chrono_literals::operator""s;
timer_ = rclcpp::create_timer(this, get_clock(), 1s, [this]() {
Expand All @@ -50,7 +50,7 @@ PathDistanceCalculator::PathDistanceCalculator(const rclcpp::NodeOptions & optio
const double distance = autoware::motion_utils::calcSignedArcLength(
path->points, pose->pose.position, path->points.size() - 1);

tier4_debug_msgs::msg::Float64Stamped msg;
autoware_internal_debug_msgs::msg::Float64Stamped msg;
msg.stamp = pose->header.stamp;
msg.data = distance;
pub_dist_->publish(msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#include <autoware/universe_utils/ros/self_pose_listener.hpp>
#include <rclcpp/rclcpp.hpp>

#include <autoware_internal_debug_msgs/msg/float64_stamped.hpp>
#include <autoware_planning_msgs/msg/path.hpp>
#include <tier4_debug_msgs/msg/float64_stamped.hpp>

namespace autoware::path_distance_calculator
{
Expand All @@ -33,7 +33,7 @@ class PathDistanceCalculator : public rclcpp::Node
private:
autoware::universe_utils::InterProcessPollingSubscriber<autoware_planning_msgs::msg::Path>
sub_path_{this, "~/input/path"};
rclcpp::Publisher<tier4_debug_msgs::msg::Float64Stamped>::SharedPtr pub_dist_;
rclcpp::Publisher<autoware_internal_debug_msgs::msg::Float64Stamped>::SharedPtr pub_dist_;
rclcpp::TimerBase::SharedPtr timer_;
autoware::universe_utils::SelfPoseListener self_pose_listener_;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

#include <rclcpp/publisher.hpp>

#include <autoware_internal_debug_msgs/msg/processing_time_node.hpp>
#include <autoware_internal_debug_msgs/msg/processing_time_tree.hpp>
#include <std_msgs/msg/string.hpp>
#include <tier4_debug_msgs/msg/processing_time_node.hpp>
#include <tier4_debug_msgs/msg/processing_time_tree.hpp>

#include <memory>
#include <ostream>
Expand Down Expand Up @@ -61,9 +61,10 @@ class ProcessingTimeNode : public std::enable_shared_from_this<ProcessingTimeNod
/**
* @brief Construct a ProcessingTimeTree message from the node and its children
*
* @return tier4_debug_msgs::msg::ProcessingTimeTree Constructed ProcessingTimeTree message
* @return autoware_internal_debug_msgs::msg::ProcessingTimeTree Constructed ProcessingTimeTree
* message
*/
tier4_debug_msgs::msg::ProcessingTimeTree to_msg() const;
autoware_internal_debug_msgs::msg::ProcessingTimeTree to_msg() const;

/**
* @brief Get the parent node
Expand Down Expand Up @@ -111,7 +112,8 @@ class ProcessingTimeNode : public std::enable_shared_from_this<ProcessingTimeNod
};

using ProcessingTimeDetail =
tier4_debug_msgs::msg::ProcessingTimeTree; //!< Alias for the ProcessingTimeTree message
autoware_internal_debug_msgs::msg::ProcessingTimeTree; //!< Alias for the ProcessingTimeTree
//!< message

/**
* @brief Class for tracking and reporting the processing time of various functions
Expand Down
2 changes: 1 addition & 1 deletion common/autoware_universe_utils/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>autoware_internal_debug_msgs</depend>
<depend>autoware_internal_debug_msgs</depend>
<depend>autoware_internal_msgs</depend>
<depend>autoware_perception_msgs</depend>
Expand All @@ -27,7 +28,6 @@
<depend>tf2</depend>
<depend>tf2_eigen</depend>
<depend>tf2_geometry_msgs</depend>
<depend>tier4_debug_msgs</depend>
<depend>tier4_planning_msgs</depend>
<depend>unique_identifier_msgs</depend>
<depend>visualization_msgs</depend>
Expand Down
12 changes: 7 additions & 5 deletions common/autoware_universe_utils/src/system/time_keeper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,17 @@ std::string ProcessingTimeNode::to_string() const
return oss.str();
}

tier4_debug_msgs::msg::ProcessingTimeTree ProcessingTimeNode::to_msg() const
autoware_internal_debug_msgs::msg::ProcessingTimeTree ProcessingTimeNode::to_msg() const
{
tier4_debug_msgs::msg::ProcessingTimeTree time_tree_msg;
autoware_debug_msgs::msg::ProcessingTimeTree time_tree_msg;

std::function<void(const ProcessingTimeNode &, tier4_debug_msgs::msg::ProcessingTimeTree &, int)>
std::function<void(
const ProcessingTimeNode &, autoware_internal_debug_msgs::msg::ProcessingTimeTree &, int)>
construct_msg = [&](
const ProcessingTimeNode & node,
tier4_debug_msgs::msg::ProcessingTimeTree & tree_msg, int parent_id) {
tier4_debug_msgs::msg::ProcessingTimeNode time_node_msg;
autoware_internal_debug_msgs::msg::ProcessingTimeTree & tree_msg,
int parent_id) {
autoware_internal_debug_msgs::msg::ProcessingTimeNode time_node_msg;
time_node_msg.name = node.name_;
time_node_msg.processing_time = node.processing_time_;
time_node_msg.id = static_cast<int>(tree_msg.nodes.size() + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<test_depend>autoware_test_utils</test_depend>

<depend>autoware_control_msgs</depend>
<depend>autoware_internal_debug_msgs</depend>
<depend>autoware_motion_utils</depend>
<depend>autoware_planning_msgs</depend>
<depend>autoware_pointcloud_preprocessor</depend>
Expand All @@ -43,7 +44,6 @@
<depend>tf2_eigen</depend>
<depend>tf2_geometry_msgs</depend>
<depend>tf2_ros</depend>
<depend>tier4_debug_msgs</depend>
<depend>tier4_metric_msgs</depend>
<depend>visualization_msgs</depend>

Expand Down
5 changes: 3 additions & 2 deletions control/autoware_autonomous_emergency_braking/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ AEB::AEB(const rclcpp::NodeOptions & node_options)
debug_marker_publisher_ = this->create_publisher<MarkerArray>("~/debug/markers", 1);
virtual_wall_publisher_ = this->create_publisher<MarkerArray>("~/virtual_wall", 1);
debug_rss_distance_publisher_ =
this->create_publisher<tier4_debug_msgs::msg::Float32Stamped>("~/debug/rss_distance", 1);
this->create_publisher<autoware_internal_debug_msgs::msg::Float32Stamped>(
"~/debug/rss_distance", 1);
metrics_pub_ = this->create_publisher<MetricArray>("~/metrics", 1);
}
// Diagnostics
Expand Down Expand Up @@ -647,7 +648,7 @@ bool AEB::hasCollision(const double current_v, const ObjectData & closest_object
return ego_stopping_distance + obj_braking_distance + longitudinal_offset_margin_;
});

tier4_debug_msgs::msg::Float32Stamped rss_distance_msg;
autoware_internal_debug_msgs::msg::Float32Stamped rss_distance_msg;
rss_distance_msg.stamp = get_clock()->now();
rss_distance_msg.data = rss_dist;
debug_rss_distance_publisher_->publish(rss_distance_msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
#include <autoware_control_validator/msg/control_validator_status.hpp>
#include <rclcpp/rclcpp.hpp>

#include <autoware_internal_debug_msgs/msg/float64_stamped.hpp>
#include <autoware_planning_msgs/msg/trajectory.hpp>
#include <diagnostic_msgs/msg/diagnostic_array.hpp>
#include <nav_msgs/msg/odometry.hpp>
#include <tier4_debug_msgs/msg/float64_stamped.hpp>

#include <cstdint>
#include <memory>
Expand Down Expand Up @@ -139,7 +139,8 @@ class ControlValidator : public rclcpp::Node
universe_utils::InterProcessPollingSubscriber<Trajectory>::SharedPtr sub_reference_traj_;
rclcpp::Publisher<ControlValidatorStatus>::SharedPtr pub_status_;
rclcpp::Publisher<visualization_msgs::msg::MarkerArray>::SharedPtr pub_markers_;
rclcpp::Publisher<tier4_debug_msgs::msg::Float64Stamped>::SharedPtr pub_processing_time_;
rclcpp::Publisher<autoware_internal_debug_msgs::msg::Float64Stamped>::SharedPtr
pub_processing_time_;

// system parameters
int64_t diag_error_count_threshold_ = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
#include <rclcpp/rclcpp.hpp>

#include <autoware_adapi_v1_msgs/msg/operation_mode_state.hpp>
#include <autoware_internal_debug_msgs/msg/float64_stamped.hpp>
#include <autoware_map_msgs/msg/lanelet_map_bin.hpp>
#include <autoware_planning_msgs/msg/lanelet_route.hpp>
#include <autoware_planning_msgs/msg/trajectory.hpp>
#include <autoware_vehicle_msgs/msg/control_mode_report.hpp>
#include <geometry_msgs/msg/pose_stamped.hpp>
#include <geometry_msgs/msg/pose_with_covariance_stamped.hpp>
#include <nav_msgs/msg/odometry.hpp>
#include <tier4_debug_msgs/msg/float64_stamped.hpp>
#include <visualization_msgs/msg/marker_array.hpp>

#include <lanelet2_core/LaneletMap.h>
Expand Down Expand Up @@ -115,7 +115,8 @@ class LaneDepartureCheckerNode : public rclcpp::Node
autoware::universe_utils::DebugPublisher debug_publisher_{this, "~/debug"};
autoware::universe_utils::ProcessingTimePublisher processing_diag_publisher_{
this, "~/debug/processing_time_ms_diag"};
rclcpp::Publisher<tier4_debug_msgs::msg::Float64Stamped>::SharedPtr processing_time_publisher_;
rclcpp::Publisher<autoware_internal_debug_msgs::msg::Float64Stamped>::SharedPtr
processing_time_publisher_;

// Timer
rclcpp::TimerBase::SharedPtr timer_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@

// Publisher
processing_time_publisher_ =
this->create_publisher<tier4_debug_msgs::msg::Float64Stamped>("~/debug/processing_time_ms", 1);
this->create_publisher<autoware_internal_debug_msgs::msg::Float64Stamped>(
"~/debug/processing_time_ms", 1);
// Nothing

// Diagnostic Updater
Expand Down Expand Up @@ -342,26 +343,27 @@

{
const auto & deviation = output_.trajectory_deviation;
debug_publisher_.publish<tier4_debug_msgs::msg::Float64Stamped>(
debug_publisher_.publish<autoware_internal_debug_msgs::msg::Float64Stamped>(
"deviation/lateral", deviation.lateral);
debug_publisher_.publish<tier4_debug_msgs::msg::Float64Stamped>("deviation/yaw", deviation.yaw);
debug_publisher_.publish<tier4_debug_msgs::msg::Float64Stamped>(
debug_publisher_.publish<autoware_internal_debug_msgs::msg::Float64Stamped>(
"deviation/yaw", deviation.yaw);
debug_publisher_.publish<autoware_internal_debug_msgs::msg::Float64Stamped>(
"deviation/yaw_deg", rad2deg(deviation.yaw));
}
processing_time_map["Node: publishTrajectoryDeviation"] = stop_watch.toc(true);

debug_publisher_.publish<visualization_msgs::msg::MarkerArray>(
std::string("marker_array"), createMarkerArray());
processing_time_map["Node: publishDebugMarker"] = stop_watch.toc(true);

// Merge processing_time_map
for (const auto & m : output_.processing_time_map) {
processing_time_map["Core: " + m.first] = m.second;
}

processing_time_map["Total"] = stop_watch.toc("Total");
processing_diag_publisher_.publish(processing_time_map);
tier4_debug_msgs::msg::Float64Stamped processing_time_msg;
autoware_internal_debug_msgs::msg::Float64Stamped processing_time_msg;

Check warning on line 366 in control/autoware_lane_departure_checker/src/lane_departure_checker_node/lane_departure_checker_node.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Method

LaneDepartureCheckerNode::onTimer already has high cyclomatic complexity, and now it increases in Lines of Code from 86 to 87. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
processing_time_msg.stamp = get_clock()->now();
processing_time_msg.data = processing_time_map["Total"];
processing_time_publisher_->publish(processing_time_msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#include "rclcpp/rclcpp.hpp"

#include "autoware_control_msgs/msg/lateral.hpp"
#include "autoware_internal_debug_msgs/msg/float32_multi_array_stamped.hpp"
#include "autoware_planning_msgs/msg/trajectory.hpp"
#include "autoware_vehicle_msgs/msg/steering_report.hpp"
#include "geometry_msgs/msg/pose.hpp"
#include "nav_msgs/msg/odometry.hpp"
#include "tier4_debug_msgs/msg/float32_multi_array_stamped.hpp"

#include <deque>
#include <memory>
Expand All @@ -41,11 +41,11 @@ namespace autoware::motion::control::mpc_lateral_controller

using autoware::motion::control::trajectory_follower::LateralHorizon;
using autoware_control_msgs::msg::Lateral;
using autoware_internal_debug_msgs::msg::Float32MultiArrayStamped;
using autoware_planning_msgs::msg::Trajectory;
using autoware_vehicle_msgs::msg::SteeringReport;
using geometry_msgs::msg::Pose;
using nav_msgs::msg::Odometry;
using tier4_debug_msgs::msg::Float32MultiArrayStamped;

using Eigen::MatrixXd;
using Eigen::VectorXd;
Expand Down
2 changes: 1 addition & 1 deletion control/autoware_mpc_lateral_controller/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>autoware_control_msgs</depend>
<depend>autoware_internal_debug_msgs</depend>
<depend>autoware_interpolation</depend>
<depend>autoware_motion_utils</depend>
<depend>autoware_osqp_interface</depend>
Expand All @@ -36,7 +37,6 @@
<depend>std_msgs</depend>
<depend>tf2</depend>
<depend>tf2_ros</depend>
<depend>tier4_debug_msgs</depend>

<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
Expand Down
Loading