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

fix(lareral_deviation_monitor): update metrics msgs #157

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ common/tier4_screen_capture_rviz_plugin/** [email protected] satoshi.ota
common/tier4_simulated_clock_rviz_plugin/** [email protected]
common/tier4_string_viewer_rviz_plugin/** [email protected]
common/tier4_target_object_type_rviz_plugin/** [email protected]
control/control_debug_tools/** [email protected] [email protected]
control/control_debug_tools/** [email protected] [email protected] [email protected] [email protected]
control/stop_accel_evaluator/** [email protected]
control/vehicle_cmd_analyzer/** [email protected]
control_data_collecting_tool/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
Expand Down
2 changes: 2 additions & 0 deletions control/control_debug_tools/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<description>The control_debug_tools package</description>
<maintainer email="[email protected]">Zhe Shen</maintainer>
<maintainer email="[email protected]">Takayuki Murooka</maintainer>
<maintainer email="[email protected]">Kosuke Takeuchi</maintainer>
<maintainer email="[email protected]">Temkei Kem</maintainer>
<license>Apache License 2.0</license>

<author email="[email protected]">Zhe Shen</author>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

from autoware_control_msgs.msg import Control
from autoware_vehicle_msgs.msg import SteeringReport
from diagnostic_msgs.msg import DiagnosticArray
import matplotlib.pyplot as plt
import rclpy
from rclpy.node import Node
from termcolor import colored
from tier4_metric_msgs.msg import MetricArray


class SteeringAndLateralDeviationMonitor(Node):
Expand All @@ -38,7 +38,7 @@ def __init__(self, plot=False):
)

self.create_subscription(
DiagnosticArray, "/control/control_evaluator/metrics", self.metrics_callback, 10
MetricArray, "/control/control_evaluator/metrics", self.metrics_callback, 10
)

self.control_steering_angle = None
Expand Down Expand Up @@ -77,14 +77,11 @@ def steering_status_callback(self, msg):
self.update_steering_diff()
self.update_max_values()

def metrics_callback(self, msg):
for status in msg.status:
if status.name == "lateral_deviation":
for value in status.values:
if value.key == "metric_value":
self.lateral_deviation = float(value.value)
self.update_max_values()
break
def metrics_callback(self, msgs):
for msg in msgs.metric_array:
if msg.name == "lateral_deviation":
self.lateral_deviation = float(msg.value)
self.update_max_values()

def update_steering_diff(self):
if self.control_steering_angle is not None and self.vehicle_steering_angle is not None:
Expand Down
Loading