|
|
@ -90,15 +90,17 @@ def Cropped_forRadar(pc, veh_coord, veh_angle, radarobj): |
|
|
# skew_pc = np.vstack(((skew_pc ).T, pc[:, 3], pc[:, 5])).T #x,y,z,speed,material |
|
|
# skew_pc = np.vstack(((skew_pc ).T, pc[:, 3], pc[:, 5])).T #x,y,z,speed,material |
|
|
skew_pc = np.vstack(((skew_pc ).T, pc[:, 3], pc[:, 5],pc[:,6])).T #x,y,z,speed,material, cosines |
|
|
skew_pc = np.vstack(((skew_pc ).T, pc[:, 3], pc[:, 5],pc[:,6])).T #x,y,z,speed,material, cosines |
|
|
|
|
|
|
|
|
# Restoration: X is Side (Index 0), Y is Forward (Index 1) |
|
|
|
|
|
rowy = np.where((skew_pc[:, 1] > 0.5)) # Start 0.5m forward to avoid bumper |
|
|
|
|
|
|
|
|
# NORMALIZATION: The points are now relative to the bumper (X=2.0). |
|
|
|
|
|
# Any point with Y < 0.2 is the car's own hood or internal bumper structure. |
|
|
|
|
|
rowy = np.where((skew_pc[:, 1] > 0.2)) |
|
|
new_pc = skew_pc[rowy, :].squeeze(0) |
|
|
new_pc = skew_pc[rowy, :].squeeze(0) |
|
|
|
|
|
|
|
|
new_pc = new_pc[new_pc[:,4]!=0] # Drop empty materials |
|
|
new_pc = new_pc[new_pc[:,4]!=0] # Drop empty materials |
|
|
|
|
|
|
|
|
new_pc = new_pc[(new_pc[:,0]<30)*(new_pc[:,0]>-30)] # Side range (X) is +-30m |
|
|
new_pc = new_pc[(new_pc[:,0]<30)*(new_pc[:,0]>-30)] # Side range (X) is +-30m |
|
|
new_pc = new_pc[(new_pc[:,1]<120)] # Forward range (Y) extended to 120m for headroom |
|
|
new_pc = new_pc[(new_pc[:,1]<120)] # Forward range (Y) extended to 120m for headroom |
|
|
new_pc = new_pc[(new_pc[:,2]<10)] # Height cut-off |
|
|
|
|
|
|
|
|
new_pc = new_pc[(new_pc[:,2]<10)] # Height cut-off (Up) |
|
|
|
|
|
new_pc = new_pc[(new_pc[:,2]>-2.2)] # Ground-level cut-off (30cm road-clearance to keep wheels/bumpers) |
|
|
|
|
|
|
|
|
simobj = Sceneset(new_pc) |
|
|
simobj = Sceneset(new_pc) |
|
|
|
|
|
|
|
|
@ -158,10 +160,11 @@ def run_lidar(sim_config, sem_lidar_frame): |
|
|
test = new_map_material(load_pc) |
|
|
test = new_map_material(load_pc) |
|
|
|
|
|
|
|
|
# LEGACY REQUIREMENT: Shenron physics engine expects Index 1 to be Forward. |
|
|
# LEGACY REQUIREMENT: Shenron physics engine expects Index 1 to be Forward. |
|
|
# We swap CARLA's X (Forward) into Index 1 and CARLA's Y (Right) into Index 0. |
|
|
|
|
|
|
|
|
# MOUNT OFFSET: Radar is at +2.0m (Front Bumper), LiDAR is at +0.0m (Center Roof). |
|
|
|
|
|
# We subtract 2.0m from the CARLA X (Forward) to normalize points to the Radar Center. |
|
|
points = np.zeros((np.shape(test)[0], 7)) |
|
|
points = np.zeros((np.shape(test)[0], 7)) |
|
|
points[:, 0] = test[:, 1] # Side (Y in CARLA) |
|
|
points[:, 0] = test[:, 1] # Side (Y in CARLA) |
|
|
points[:, 1] = test[:, 0] # Forward (X in CARLA) |
|
|
|
|
|
|
|
|
points[:, 1] = test[:, 0] - 2.0 # Normalized Forward (X in CARLA) |
|
|
points[:, 2] = test[:, 2] # Up (Z in CARLA) |
|
|
points[:, 2] = test[:, 2] # Up (Z in CARLA) |
|
|
|
|
|
|
|
|
""" |
|
|
""" |
|
|
|