Browse Source

feat(shenron): gain recalibration and visualization stability

- [Radar Cfg] Increase gain by +10dB (110dB -> 120dB) for all radar models in ConfigureRadar.py
- [Root Cause] Compensate for the SNR drop caused by restoring the 1/R^4 physics law (Iteration 37), which removed the artificial R^2 area boost and made RD maps 'hazy' or 'out of focus'.

- [Viz] Update SYSTEM_GAIN_OFFSET from 68.0 to 78.0 in plots.py and test_shenron.py
- [Viz] Increase dynamic range clipping ceiling from 45dB to 55dB
- [Root Cause] Prevents RA heatmap saturation. The +10dB gain increase caused signals to hit the previous 45dB hard-clip ceiling, making the dynamic plots look identical to the static ones (blown out).
Shenron
RUSHIL AMBARISH KADU 2 weeks ago
parent
commit
70aa058e4d
  1. 6
      scripts/ISOLATE/e2e_agent_sem_lidar2shenron_package/ConfigureRadar.py
  2. 11
      scripts/ISOLATE/sim_radar_utils/plots.py
  3. 4
      scripts/test_shenron.py

6
scripts/ISOLATE/e2e_agent_sem_lidar2shenron_package/ConfigureRadar.py

@ -25,7 +25,7 @@ class radar():
self.chirps = 3 # 128 self.chirps = 3 # 128
self.nRx = 86 #16 # number of antennas(virtual antennas included, AOA dim) self.nRx = 86 #16 # number of antennas(virtual antennas included, AOA dim)
self.noise_amp = 0.005 #0.0001(concrete+metal) # 0.00001(metal) #0.005(after skyward data) self.noise_amp = 0.005 #0.0001(concrete+metal) # 0.00001(metal) #0.005(after skyward data)
self.gain = 10 ** (110 / 10) # Calibrated for Iteration 16
self.gain = 10 ** (120 / 10) # Recalibrated (+10dB) to compensate for 1/R^4 physics fix (Iteration 37)
self.angle_fft_size = 256 self.angle_fft_size = 256
self.range_res = self.c / (2 * self.B) # range resolution self.range_res = self.c / (2 * self.B) # range resolution
@ -70,7 +70,7 @@ class radar():
self.chirps = 128 self.chirps = 128
self.nRx = 8 # number of antennas(virtual antennas included, AOA dim) self.nRx = 8 # number of antennas(virtual antennas included, AOA dim)
self.noise_amp = 0.005 self.noise_amp = 0.005
self.gain = 10 ** (110 / 10) # Calibrated for Iteration 16
self.gain = 10 ** (120 / 10) # Recalibrated (+10dB) to compensate for 1/R^4 physics fix (Iteration 37)
self.angle_fft_size = 256 self.angle_fft_size = 256
self.range_res = self.c / (2 * self.B) # range resolution self.range_res = self.c / (2 * self.B) # range resolution
@ -115,7 +115,7 @@ class radar():
self.chirps = 128 # Increased to match 2TX MIMO frame depth for 3dB processing gain self.chirps = 128 # Increased to match 2TX MIMO frame depth for 3dB processing gain
self.nRx = 6 self.nRx = 6
self.noise_amp = 0.005 self.noise_amp = 0.005
self.gain = 10 ** (110 / 10) # Calibrated for Iteration 16
self.gain = 10 ** (120 / 10) # Recalibrated (+10dB) to compensate for 1/R^4 physics fix (Iteration 37)
self.angle_fft_size = 256 self.angle_fft_size = 256
self.range_res = self.c / (2 * self.B) self.range_res = self.c / (2 * self.B)

11
scripts/ISOLATE/sim_radar_utils/plots.py

@ -104,11 +104,16 @@ def postprocess_ra(ra_heatmap, range_axis, smooth_sigma=1.0):
ra = np.clip(ra, 1e-9, None) ra = np.clip(ra, 1e-9, None)
# 2. Physics-based dynamic range compression (Linear -> Log) # 2. Physics-based dynamic range compression (Linear -> Log)
SYSTEM_GAIN_OFFSET = 68.0
# SYSTEM_GAIN_OFFSET: Accounts for the absolute scale of the simulated signal.
# Must be updated when radar.gain changes. Formula: 10*log10(gain) - reference_offset
# Baseline: gain=10^(110/10) -> offset=68.0
# After +10dB recalibration: gain=10^(120/10) -> offset=78.0
SYSTEM_GAIN_OFFSET = 78.0
ra_db = 10 * np.log10(ra) - SYSTEM_GAIN_OFFSET ra_db = 10 * np.log10(ra) - SYSTEM_GAIN_OFFSET
# 3. Fixed dynamic range clipping (-5 to 45 dB)
ra_db = np.clip(ra_db, -5, 45)
# 3. Fixed dynamic range clipping (-5 to 55 dB)
# Upper limit raised from 45 to 55 dB to provide headroom after gain recalibration.
ra_db = np.clip(ra_db, -5, 55)
# 4. Optional Gaussian smoothing # 4. Optional Gaussian smoothing
if smooth_sigma > 0: if smooth_sigma > 0:

4
scripts/test_shenron.py

@ -309,7 +309,7 @@ def run_testbench(iter_name):
render_engines[r_type] = { render_engines[r_type] = {
'rd': FastHeatmapEngine(extent=[-max_vel_cfg, max_vel_cfg, 0, max_r_cfg], cmap='viridis', title=f'{r_type.upper()} Range-Doppler', xlabel='Doppler Velocity [m/s]', ylabel='Range [m]', ylim=[0, 120], interpolation='bicubic'), 'rd': FastHeatmapEngine(extent=[-max_vel_cfg, max_vel_cfg, 0, max_r_cfg], cmap='viridis', title=f'{r_type.upper()} Range-Doppler', xlabel='Doppler Velocity [m/s]', ylabel='Range [m]', ylim=[0, 120], interpolation='bicubic'),
'cfar': FastHeatmapEngine(extent=[-max_vel_cfg, max_vel_cfg, 0, max_r_cfg], cmap='plasma', title=f'{r_type.upper()} CFAR Noise Threshold', xlabel='Doppler Velocity [m/s]', ylabel='Range [m]', ylim=[0, 120], interpolation='bicubic'), 'cfar': FastHeatmapEngine(extent=[-max_vel_cfg, max_vel_cfg, 0, max_r_cfg], cmap='plasma', title=f'{r_type.upper()} CFAR Noise Threshold', xlabel='Doppler Velocity [m/s]', ylabel='Range [m]', ylim=[0, 120], interpolation='bicubic'),
'ra_static': FastHeatmapEngine(extent=[-display_limit_cfg, display_limit_cfg, 0, display_limit_cfg], cmap='jet', vmin=-5, vmax=45, title=f'{r_type.upper()} Range-Azimuth (Absolute)', xlabel='Lateral distance [m]', ylabel='Longitudinal distance [m]', aspect='equal'),
'ra_static': FastHeatmapEngine(extent=[-display_limit_cfg, display_limit_cfg, 0, display_limit_cfg], cmap='jet', vmin=-5, vmax=55, title=f'{r_type.upper()} Range-Azimuth (Absolute)', xlabel='Lateral distance [m]', ylabel='Longitudinal distance [m]', aspect='equal'),
'ra_dyn': FastHeatmapEngine(extent=[-display_limit_cfg, display_limit_cfg, 0, display_limit_cfg], cmap='jet', title=f'{r_type.upper()} Range-Azimuth (Dynamic)', xlabel='Lateral distance [m]', ylabel='Longitudinal distance [m]', aspect='equal') 'ra_dyn': FastHeatmapEngine(extent=[-display_limit_cfg, display_limit_cfg, 0, display_limit_cfg], cmap='jet', title=f'{r_type.upper()} Range-Azimuth (Dynamic)', xlabel='Lateral distance [m]', ylabel='Longitudinal distance [m]', aspect='equal')
} }
@ -433,7 +433,7 @@ def run_testbench(iter_name):
rd_data = np.load(rd_p) rd_data = np.load(rd_p)
# Apply log conversion minus identical system gain offset to maintain -5 to 45 scaling # Apply log conversion minus identical system gain offset to maintain -5 to 45 scaling
# Simple 10*log10 - SYSTEM_GAIN_OFFSET # Simple 10*log10 - SYSTEM_GAIN_OFFSET
rd_db = 10 * np.log10(np.clip(rd_data, 1e-9, None)) - 68.0
rd_db = 10 * np.log10(np.clip(rd_data, 1e-9, None)) - 78.0 # Updated offset: +10dB from gain recalibration
# Flip UD so Range 0 (ego) is at the bottom. Use Cached Renderer. # Flip UD so Range 0 (ego) is at the bottom. Use Cached Renderer.
b64 = render_engines[r_type]['rd'].render(np.flipud(rd_db)) b64 = render_engines[r_type]['rd'].render(np.flipud(rd_db))

Loading…
Cancel
Save