|
|
|
@ -28,7 +28,7 @@ class ShenronRadarModel: |
|
|
|
Args: |
|
|
|
radar_type (str): Type of radar to simulate (default: 'radarbook'). |
|
|
|
""" |
|
|
|
print(f"Initializing ShenronRadarModel with type: {radar_type}") |
|
|
|
# Init message suppressed — telemetry is emitted by generate_shenron.py |
|
|
|
self.radar_type = radar_type |
|
|
|
|
|
|
|
# Initialize the hardware radar object |
|
|
|
@ -69,7 +69,7 @@ class ShenronRadarModel: |
|
|
|
ur.fftCfg['NFFT'] = self.radar_obj.N_sample |
|
|
|
ur.fftCfg['NFFTVel'] = self.radar_obj.chirps |
|
|
|
|
|
|
|
print(f"Synced global config: N={ur.radarCfg['N']}, Np={ur.radarCfg['Np']}, Ant={ur.radarCfg['NrChn']}") |
|
|
|
# Sync log suppressed for dashboard cleanliness — data exposed via get_radar_specs() |
|
|
|
|
|
|
|
# CRITICAL: Re-initialize the internal axes of the processor to match new hardware |
|
|
|
if hasattr(self, 'processor'): |
|
|
|
@ -160,6 +160,22 @@ class ShenronRadarModel: |
|
|
|
"active_bins": int(np.sum(rd > avg_noise)) |
|
|
|
} |
|
|
|
|
|
|
|
def get_radar_specs(self): |
|
|
|
"""Return radar hardware specs for dashboard telemetry.""" |
|
|
|
r = self.radar_obj |
|
|
|
return { |
|
|
|
"type": self.radar_type, |
|
|
|
"freq_ghz": r.f / 1e9, |
|
|
|
"bw_mhz": r.B / 1e6, |
|
|
|
"chirps": r.chirps, |
|
|
|
"samples": r.N_sample, |
|
|
|
"antennas": r.nRx, |
|
|
|
"range_res_m": round(r.range_res, 3), |
|
|
|
"max_range_m": round(r.max_range, 1), |
|
|
|
"chirp_rep_us": round(r.chirp_rep * 1e6, 1), |
|
|
|
"gain_db": round(10 * np.log10(r.gain), 1), |
|
|
|
} |
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
|
# Internal test/demo |
|
|
|
model = ShenronRadarModel() |
|
|
|
|