Skip to content

Commit fd4fc03

Browse files
committed
Add 'environment' flag to target APIs
Add a new boolean 'environment' parameter to target-related APIs and call sites. Updated the Cython .pxd declarations to include the environment flag after density, and modified cp_radarsimc.pyx and simulator_lidar.pyx to pass target.get("environment", False) when adding targets and computing RCS/lidar. Also updates the radarsimcpp submodule pointer to the new commit. The new flag defaults to False to preserve backward compatibility.
1 parent ffefcdb commit fd4fc03

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
@@ -141,7 +141,8 @@ cdef extern from "targets_manager.hpp":
141141
const cpp_complex[T] & ep, # Relative permittivity (material property)
142142
const cpp_complex[T] & mu, # Relative permeability (material property)
143143
const bool & skip_diffusion, # Skip diffusion calculation flag
144-
const T & density) except + # Ray density (0.0 uses global density)
144+
const T & density, # Ray density (0.0 uses global density)
145+
const bool & environment) except + # Environment flag for target
145146

146147
void AddTargetSimple(const T * points,
147148
const int_t * cells,
@@ -152,7 +153,8 @@ cdef extern from "targets_manager.hpp":
152153
const Vec3[T] & rotation,
153154
const Vec3[T] & rotation_rate,
154155
const bool & skip_diffusion, # Skip diffusion calculation flag
155-
const T & density) except + # Ray density (0.0 uses global density)
156+
const T & density, # Ray density (0.0 uses global density)
157+
const bool & environment) except + # Environment flag for target
156158

157159
#------------------------------------------------------------------------------
158160
# Ray Tracing Primitives

src/radarsimpy/lib/cp_radarsimc.pyx

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

683684
@cython.cdivision(True)
684685
@cython.boundscheck(False)
@@ -765,4 +766,5 @@ cdef void cp_RCS_Target(target, mesh_module, TargetsManager[float_t] * targets_m
765766
ep_c,
766767
mu_c,
767768
<bool> target.get("skip_diffusion", False),
768-
<float_t> target.get("density", 0.0))
769+
<float_t> target.get("density", 0.0),
770+
<bool> target.get("environment", False))

src/radarsimpy/simulator_lidar.pyx

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

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

0 commit comments

Comments
 (0)