From f46bf3cd7c0d14fa1b80e81f1a8f633300aed4a9 Mon Sep 17 00:00:00 2001 From: yoshiri Date: Tue, 1 Oct 2024 11:42:24 +0900 Subject: [PATCH 1/2] feat: add covariance information in jsonl Signed-off-by: yoshiri --- .../driving_log_replayer/perception_eval_conversions.py | 7 +++---- driving_log_replayer/scripts/perception_evaluator_node.py | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/driving_log_replayer/driving_log_replayer/perception_eval_conversions.py b/driving_log_replayer/driving_log_replayer/perception_eval_conversions.py index 0752a6903..84210d954 100644 --- a/driving_log_replayer/driving_log_replayer/perception_eval_conversions.py +++ b/driving_log_replayer/driving_log_replayer/perception_eval_conversions.py @@ -369,10 +369,9 @@ def object_to_covariance_description(obj: ObjectType | None) -> dict: "pose_covariance": [], "twist_covariance": [], } - # TODO - # wait for covariance calculation implementation - pose_covariance = [] - twist_covariance = [] + + pose_covariance = obj.pose_covariance.tolist() if obj.has_pose_covariance else [] + twist_covariance = obj.twist_covariance.tolist() if obj.has_twist_covariance else [] return { "pose_covariance": pose_covariance, "twist_covariance": twist_covariance, diff --git a/driving_log_replayer/scripts/perception_evaluator_node.py b/driving_log_replayer/scripts/perception_evaluator_node.py index 0eb443180..8ed007a53 100755 --- a/driving_log_replayer/scripts/perception_evaluator_node.py +++ b/driving_log_replayer/scripts/perception_evaluator_node.py @@ -215,6 +215,8 @@ def list_dynamic_object_from_ros_msg( velocity=eval_conversions.velocity_from_ros_msg( perception_object.kinematics.twist_with_covariance.twist.linear, ), + pose_covariance=perception_object.kinematics.pose_with_covariance.covariance, + twist_covariance=perception_object.kinematics.twist_with_covariance.covariance, semantic_score=most_probable_classification.probability, semantic_label=label, uuid=uuid, From 9c72f364715a9224f6996c024791abdc48e5c469 Mon Sep 17 00:00:00 2001 From: yoshiri Date: Wed, 2 Oct 2024 00:25:55 +0900 Subject: [PATCH 2/2] fix covariance access Signed-off-by: yoshiri --- .../driving_log_replayer/perception_eval_conversions.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/driving_log_replayer/driving_log_replayer/perception_eval_conversions.py b/driving_log_replayer/driving_log_replayer/perception_eval_conversions.py index 84210d954..48f1f2fb6 100644 --- a/driving_log_replayer/driving_log_replayer/perception_eval_conversions.py +++ b/driving_log_replayer/driving_log_replayer/perception_eval_conversions.py @@ -370,8 +370,12 @@ def object_to_covariance_description(obj: ObjectType | None) -> dict: "twist_covariance": [], } - pose_covariance = obj.pose_covariance.tolist() if obj.has_pose_covariance else [] - twist_covariance = obj.twist_covariance.tolist() if obj.has_twist_covariance else [] + pose_covariance = ( + obj.state.pose_covariance.tolist() if obj.state.has_pose_covariance else [] + ) + twist_covariance = ( + obj.state.twist_covariance.tolist() if obj.state.has_twist_covariance else [] + ) return { "pose_covariance": pose_covariance, "twist_covariance": twist_covariance,