From 73ee7b277cb1fd5826d01a101846cb7292af0414 Mon Sep 17 00:00:00 2001 From: Shunsuke Miura <37187849+miursh@users.noreply.github.com> Date: Tue, 10 Dec 2024 23:58:07 +0900 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Kotaro Uetake <60615504+ktro2828@users.noreply.github.com> --- .../rosbag2/rosbag2_to_non_annotated_t4_converter.py | 3 --- perception_dataset/utils/rosbag2.py | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/perception_dataset/rosbag2/rosbag2_to_non_annotated_t4_converter.py b/perception_dataset/rosbag2/rosbag2_to_non_annotated_t4_converter.py index 29df6c0c..67ff9478 100644 --- a/perception_dataset/rosbag2/rosbag2_to_non_annotated_t4_converter.py +++ b/perception_dataset/rosbag2/rosbag2_to_non_annotated_t4_converter.py @@ -351,9 +351,6 @@ def _convert(self) -> None: if self._with_vehicle_status: self._convert_vehicle_state() - if self._with_vehicle_status: - self._convert_vehicle_state() - def _calc_start_timestamp(self) -> float: if self._start_timestamp < sys.float_info.epsilon: start_timestamp = self._bag_reader.start_timestamp + self._skip_timestamp diff --git a/perception_dataset/utils/rosbag2.py b/perception_dataset/utils/rosbag2.py index 1e8ed149..a98fc8fc 100644 --- a/perception_dataset/utils/rosbag2.py +++ b/perception_dataset/utils/rosbag2.py @@ -169,8 +169,7 @@ def pointcloud_msg_to_numpy(pointcloud_msg: PointCloud2) -> NDArray: points = point_cloud2_to_array(pointcloud_msg) # Extract the x, y, z coordinates and additional fields if available - xyz = points["xyz"] - points_arr = xyz + points_arr = points["xyz"] if "intensity" in points.keys(): intensity = points["intensity"].astype(np.float32) points_arr = np.hstack((points_arr, intensity))