Skip to content

Commit

Permalink
fix: access invalid field
Browse files Browse the repository at this point in the history
Signed-off-by: Hayato Mizushima <[email protected]>
  • Loading branch information
hayato-m126 committed Nov 25, 2024
1 parent 8e14c79 commit c94cfd1
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions driving_log_replayer_v2/scripts/perception_evaluator_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,14 @@ def list_dynamic_object_from_ros_msg(
unix_time=unix_time,
frame_id=self.__frame_id,
position=eval_conversions.position_from_ros_msg(
perception_object.kinematics.pose_with_covariance.pose.position,
perception_object.kinematics.pose_with_covariance.pose.position
if isinstance(perception_object, DetectedObject | TrackedObject)
else perception_object.kinematics.initial_pose_with_covariance.pose.position
),
orientation=eval_conversions.orientation_from_ros_msg(
perception_object.kinematics.pose_with_covariance.pose.orientation,
perception_object.kinematics.pose_with_covariance.pose.orientation
if isinstance(perception_object, DetectedObject | TrackedObject)
else perception_object.kinematics.initial_pose_with_covariance.pose.orientation
),
shape=Shape(
shape_type=shape_type,
Expand All @@ -226,10 +230,16 @@ def list_dynamic_object_from_ros_msg(
),
),
velocity=eval_conversions.velocity_from_ros_msg(
perception_object.kinematics.twist_with_covariance.twist.linear,
perception_object.kinematics.twist_with_covariance.twist.linear
if isinstance(perception_object, DetectedObject | TrackedObject)
else perception_object.kinematics.initial_twist_with_covariance.twist.linear
),
pose_covariance=perception_object.kinematics.pose_with_covariance.covariance,
twist_covariance=perception_object.kinematics.twist_with_covariance.covariance,
pose_covariance=perception_object.kinematics.pose_with_covariance.covariance
if isinstance(perception_object, DetectedObject | TrackedObject)
else perception_object.kinematics.initial_pose_with_covariance.covariance,
twist_covariance=perception_object.kinematics.twist_with_covariance.covariance
if isinstance(perception_object, DetectedObject | TrackedObject)
else perception_object.kinematics.initial_twist_with_covariance.covariance,
semantic_score=most_probable_classification.probability,
semantic_label=label,
uuid=uuid,
Expand Down

0 comments on commit c94cfd1

Please sign in to comment.