Skip to content

Commit 7199b2d

Browse files
committed
Add density parameter to target APIs
Introduce a ray density parameter for targets: update the C++ bindings (includes/radarsimc.pxd) to add a density argument to AddTarget signatures (0.0 uses global density), and pass density from Python-side target dict (default 0.0) in cp_radarsimc.pyx and simulator_lidar.pyx. Also update the radarsimcpp submodule pointer to the new commit. This enables per-target ray density control while keeping skip_diffusion behavior unchanged.
1 parent bbba964 commit 7199b2d

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

src/radarsimcpp

src/radarsimpy/includes/radarsimc.pxd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ cdef extern from "targets_manager.hpp":
140140
const vector[Vec3[T]] & rotation_rate_array, # Time-varying rotation rates
141141
const cpp_complex[T] & ep, # Relative permittivity (material property)
142142
const cpp_complex[T] & mu, # Relative permeability (material property)
143-
const bool & skip_diffusion) except +
143+
const bool & skip_diffusion, # Skip diffusion calculation flag
144+
const T & density) except + # Ray density (0.0 uses global density)
144145

145146
void AddTargetSimple(const T * points,
146147
const int_t * cells,
@@ -150,7 +151,8 @@ cdef extern from "targets_manager.hpp":
150151
const Vec3[T] & speed,
151152
const Vec3[T] & rotation,
152153
const Vec3[T] & rotation_rate,
153-
const bool & skip_diffusion) except +
154+
const bool & skip_diffusion, # Skip diffusion calculation flag
155+
const T & density) except + # Ray density (0.0 uses global density)
154156

155157
#------------------------------------------------------------------------------
156158
# Ray Tracing Primitives

src/radarsimpy/lib/cp_radarsimc.pyx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,8 @@ cdef void cp_AddTarget(radar,
677677
rrt_vt,
678678
ep_c,
679679
mu_c,
680-
<bool> target.get("skip_diffusion", False))
680+
<bool> target.get("skip_diffusion", False),
681+
<float_t> target.get("density", 0.0))
681682

682683
@cython.cdivision(True)
683684
@cython.boundscheck(False)
@@ -763,4 +764,5 @@ cdef void cp_RCS_Target(target, mesh_module, TargetsManager[float_t] * targets_m
763764
rrt_vt,
764765
ep_c,
765766
mu_c,
766-
<bool> target.get("skip_diffusion", False))
767+
<bool> target.get("skip_diffusion", False),
768+
<float_t> target.get("density", 0.0))

src/radarsimpy/simulator_lidar.pyx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ cpdef sim_lidar(lidar, targets, frame_time=0):
143143
Vec3[float_t](&speed_mv[0]),
144144
Vec3[float_t](&rotation_mv[0]),
145145
Vec3[float_t](&rotation_rate_mv[0]),
146-
<bool> targets[idx_c].get("skip_diffusion", False))
146+
<bool> targets[idx_c].get("skip_diffusion", False),
147+
<float_t> targets[idx_c].get("density", 0.0))
147148

148149
# Lidar parameters
149150
cdef float_t[:] phi_mv = np.radians(np.array(lidar["phi"], dtype=np_float))

0 commit comments

Comments
 (0)