pub struct Scenario {
pub seed: u64,
pub fps: f64,
pub arena: Arena,
pub cameras: CameraRig,
pub insects: Vec<InsectSpec>,
pub blob: BlobParams,
pub bg_warmup_frames: u32,
pub timing: TimingModel,
pub observation: ObservationModel,
pub reported_fps: Option<f64>,
pub calibration_perturbation: CalibrationPerturbation,
}Expand description
A complete simulated scenario, deserialized from sim.toml.
Fields§
§seed: u64RNG seed driving all deterministic stochastic behavior (detection noise, dropout, clutter, occlusion, timing jitter, calibration perturbation).
fps: f64Synchronized frame rate, frames per second.
arena: ArenaTracking volume.
cameras: CameraRigCamera arrangement.
insects: Vec<InsectSpec>The insects to simulate.
blob: BlobParamsBlob rendering parameters.
bg_warmup_frames: u32Number of insect-free frames to render first so the background model settles before insects appear.
timing: TimingModelPer-camera frame-arrival timing perturbation (default: none).
observation: ObservationModelObservation-model imperfections: detection noise, dropout, clutter (default: none).
reported_fps: Option<f64>If set, the cameras’ host timestamps advance at this rate (frames per second) instead of true wall-clock time, modeling a host clock that is bunched relative to the true frame cadence — as happens under load when the camera driver delivers buffered frames in bursts.
The sim still emits a hardware (device) timestamp at the true cadence, so
this exercises the frame-rate-estimation fix: a fps estimator that uses
the host clock is fooled (reads reported_fps, corrupting the tracker’s
dt = 1/fps and fragmenting trajectories), while one that uses the
hardware timestamp is correct. None reports true wall-clock host
timestamps.
calibration_perturbation: CalibrationPerturbationPerturbation applied to the tracking calibration relative to the perfect
generation calibration (default: none — perfect == tracking). See
CalibrationPerturbation.
Implementations§
Source§impl Scenario
impl Scenario
Sourcepub fn from_toml_str(s: &str) -> Result<Self>
pub fn from_toml_str(s: &str) -> Result<Self>
Parse a scenario from a sim.toml string.
Sourcepub fn camera_name(k: usize) -> String
pub fn camera_name(k: usize) -> String
The camera name for camera index k. Used as the calibration camera
name, the Braid [[cameras]] name, and the --camera-name passed to the
simulated strand-cam. Kept purely alphanumeric to avoid ROS-name
encoding mismatches.
Sourcepub fn camera_index(name: &str) -> Option<usize>
pub fn camera_index(name: &str) -> Option<usize>
Parse the camera index k from a simcam{k} name.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Scenario
impl<'de> Deserialize<'de> for Scenario
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Scenario
Auto Trait Implementations§
impl Freeze for Scenario
impl RefUnwindSafe for Scenario
impl Send for Scenario
impl Sync for Scenario
impl Unpin for Scenario
impl UnsafeUnpin for Scenario
impl UnwindSafe for Scenario
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Preferences for Twhere
T: Serialize + DeserializeOwned,
impl<T> Preferences for Twhere
T: Serialize + DeserializeOwned,
Source§fn save<S>(&self, app: &AppInfo, key: S) -> Result<(), PreferencesError>
fn save<S>(&self, app: &AppInfo, key: S) -> Result<(), PreferencesError>
Source§fn load<S>(app: &AppInfo, key: S) -> Result<T, PreferencesError>
fn load<S>(app: &AppInfo, key: S) -> Result<T, PreferencesError>
key. This is
an instance method which completely overwrites the object’s state with the serialized
data. Thus, it is recommended that you call this method immediately after instantiating
the preferences object. Read moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.