Limits¶
Parameter Value Limits¶
Limits act as a safety rail for scene editing. When limited_mode is
enabled on an editor, every method decorated with
check_value_limits() validates its
numeric arguments against the bounds in DEFAULT_VALUE_LIMITS before
any trajectory computation takes place. This prevents accidental large
displacements or rotations that would produce unrealistic scenes — for
example, a 500 m forward shift or a 180° yaw applied to an actor in a
single call. The limits are intentionally conservative: they cover typical
sensor-noise corrections and minor augmentation ranges, not large-scale
scene restructuring. To bypass them for a specific operation, set
limited_mode = False on the editor, or pass the raw
TrajectoryEditor API
directly.
Example — enabling limits and catching a violation
# This is fine: 5 m forward is within [-20, +20]
scene.actor(4).shift(forward=5)
# This line below raises ValueError: 50 m exceeds the +20 m bound
scene.actor(4).shift(forward=50)
# ValueError: Parameter 'forward'=50.0 outside [-15.0,15.0] in shift.
Example — temporarily disabling limits
scene.limited_mode = False
scene.actor(4).shift(forward=50) # now allowed
scene.limited_mode = True
Example — using a custom limits dict
from mimic_scene_edition.core.limits import DEFAULT_SCENE_ACTOR_VALUE_LIMITS
# Widen the forward limit for scene actors only
my_limits = {**DEFAULT_SCENE_ACTOR_VALUE_LIMITS, "forward": (-40.0, 40.0)}
scene.scene_actor_value_limits = my_limits
scene.actor(4).shift(forward=40) # now allowed
Ego vehicle — DEFAULT_EGO_VALUE_LIMITS
Applied to EgoEditor and
SensorEditor methods.
Parameter |
Min |
Max |
|---|---|---|
|
−20 m |
+20 m |
|
−5 m |
+5 m |
|
−2.0 m |
+2.0 m |
|
−20 ° |
+20 ° |
|
−3 ° |
+25 ° |
|
−45 ° |
+45 ° |
Scene actors — DEFAULT_SCENE_ACTOR_VALUE_LIMITS
Applied to ActorEditor methods
when the actor was already present in the original scene.
Parameter |
Min |
Max |
|---|---|---|
|
−15 m |
+15 m |
|
−5 m |
+5 m |
|
−0.15 m |
+0.15 m |
|
−10 ° |
+10 ° |
|
−2 ° |
+2 ° |
|
−10 ° |
+10 ° |
External actors — DEFAULT_EXTERNAL_ACTOR_VALUE_LIMITS
Applied to actors that originate outside the scene (those with a
base_folderpath). Limits are intentionally wider to allow full
repositioning.
Parameter |
Min |
Max |
|---|---|---|
|
−50 m |
+50 m |
|
−50 m |
+50 m |
|
−0.25 m |
+0.25 m |
|
−10 ° |
+10 ° |
|
−45 ° |
+45 ° |
|
−180 ° |
+180 ° |
Temporal (all categories)
The following limits are identical across all three categories.
Parameter |
Min |
Max |
Applies to |
|---|---|---|---|
|
10 frames |
90 frames |
|
|
−20 frames |
+20 frames |
|
|
30 frames/rev |
90 frames/rev |
- mimic_scene_edition.core.limits.DEFAULT_EGO_VALUE_LIMITS: dict[str, tuple[float, float]] = {'backward': (-20.0, 20.0), 'down': (-2.0, 2.0), 'duration': (10, 90), 'forward': (-20.0, 20.0), 'left': (-5.0, 5.0), 'offset_frame': (-20, 20), 'period': (30, 90), 'pitch': (-3.0, 25.0), 'right': (-5.0, 5.0), 'roll': (-20.0, 20.0), 'up': (-2.0, 2.0), 'yaw': (-45.0, 45.0)}¶
Default allowed ranges for ego vehicle methods.
- mimic_scene_edition.core.limits.DEFAULT_SCENE_ACTOR_VALUE_LIMITS: dict[str, tuple[float, float]] = {'backward': (-15.0, 15.0), 'down': (-0.15, 0.15), 'duration': (10, 90), 'forward': (-15.0, 15.0), 'left': (-5.0, 5.0), 'offset_frame': (-20, 20), 'period': (30, 90), 'pitch': (-2.0, 2.0), 'right': (-5.0, 5.0), 'roll': (-10.0, 10.0), 'up': (-0.15, 0.15), 'yaw': (-10.0, 10.0)}¶
Default allowed ranges for scene actors (actors present at load time).
- mimic_scene_edition.core.limits.DEFAULT_EXTERNAL_ACTOR_VALUE_LIMITS: dict[str, tuple[float, float]] = {'backward': (-50.0, 50.0), 'down': (-0.25, 0.25), 'duration': (10, 90), 'forward': (-50.0, 50.0), 'left': (-50.0, 50.0), 'offset_frame': (-20, 20), 'period': (30, 90), 'pitch': (-45.0, 45.0), 'right': (-50.0, 50.0), 'roll': (-10.0, 10.0), 'up': (-0.25, 0.25), 'yaw': (-180.0, 180.0)}¶
Default allowed ranges for external actors (actors with a
base_folderpath).
- mimic_scene_edition.core.limits.DEFAULT_VALUE_LIMITS: dict[str, tuple[float, float]] = {'backward': (-20.0, 20.0), 'down': (-2.0, 2.0), 'duration': (10, 90), 'forward': (-20.0, 20.0), 'left': (-5.0, 5.0), 'offset_frame': (-20, 20), 'period': (30, 90), 'pitch': (-3.0, 25.0), 'right': (-5.0, 5.0), 'roll': (-20.0, 20.0), 'up': (-2.0, 2.0), 'yaw': (-45.0, 45.0)}¶
Backward-compatible alias — defaults to ego limits.