From e0ec85a737c79da84291c82f3ada387ae6d699b8 Mon Sep 17 00:00:00 2001 From: Zhengyu Peng Date: Mon, 17 Feb 2025 16:39:43 -0500 Subject: [PATCH] fix data type error for lidar simulation --- src/radarsimpy/simulator_lidar.pyx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/radarsimpy/simulator_lidar.pyx b/src/radarsimpy/simulator_lidar.pyx index 12fbcfe..9657101 100644 --- a/src/radarsimpy/simulator_lidar.pyx +++ b/src/radarsimpy/simulator_lidar.pyx @@ -122,14 +122,12 @@ cpdef sim_lidar(lidar, targets, frame_time=0): # Target parameters origin_mv = np.array(targets[idx_c].get("origin", (0, 0, 0)), dtype=np_float) - location_mv = np.array(targets[idx_c].get("location", (0, 0, 0)), dtype=np_float) + \ - frame_time*np.array(targets[idx_c].get("speed", (0, 0, 0)), dtype=np_float) + temp_location = np.array(targets[idx_c].get("location", (0, 0, 0))) + frame_time*np.array(targets[idx_c].get("speed", (0, 0, 0))) + location_mv = temp_location.astype(np_float) speed_mv = np.array(targets[idx_c].get("speed", (0, 0, 0)), dtype=np_float) - rotation_mv = np.radians( - np.array(targets[idx_c].get("rotation", (0, 0, 0)), dtype=np_float) + \ - frame_time*np.array(targets[idx_c].get("rotation_rate", (0, 0, 0)), dtype=np_float) - ) + temp_rotation = np.array(targets[idx_c].get("rotation", (0, 0, 0))) + frame_time*np.array(targets[idx_c].get("rotation_rate", (0, 0, 0))) + rotation_mv = np.radians(temp_rotation.astype(np_float)) rotation_rate_mv = np.radians( np.array(targets[idx_c].get("rotation_rate", (0, 0, 0)), dtype=np_float) )