Skip to main content

MainbrainConfig

Struct MainbrainConfig 

Source
pub struct MainbrainConfig {
    pub cal_fname: Option<PathBuf>,
    pub output_base_dirname: PathBuf,
    pub tracking_params: TrackingParams,
    pub lowlatency_camdata_udp_addr: Option<String>,
    pub lowlatency_camdata_udp_port: u16,
    pub http_api_server_addr: String,
    pub model_server_addr: SocketAddr,
    pub save_empty_data2d: bool,
    pub secret_base64: Option<String>,
    pub trusted_networks: Vec<String>,
    pub acquisition_duration_allowed_imprecision_msec: Option<f64>,
    pub write_buffer_size_num_messages: usize,
}
Expand description

The sub-configuration of BraidConfig for mainbrain - the central component of Braid that integrates information from multiple cameras and performs tracking.

Fields§

§cal_fname: Option<PathBuf>

Filename of the camera calibration, optional.

Can contain shell variables such as ~, $A, or ${B}.

If the filename ends with .pymvg or .json, it will be treated as a pymvg calibration file. Else it will be treated considered in the flydra XML calibration format.

§output_base_dirname: PathBuf

Directory where data should be saved. Can contain shell variables. Defaults to DEFAULT_OUTPUT_BASE_DIRNAME.

§tracking_params: TrackingParams

Parameters for Kalman filter and data association

§lowlatency_camdata_udp_addr: Option<String>

Address of UDP port to send low-latency detection data

§lowlatency_camdata_udp_port: u16§http_api_server_addr: String

Address of HTTP port for control API. This is specified in the format IP:PORT where:

IP can be:

  • a numerical IPv4 address:
    • e.g. 1.1.1.1 uses the specific IP
    • 127.0.0.1 for the loopback interface
    • 0.0.0.0 to open the server on all available IPv4 interfaces
  • a numerical IPv6 address:
    • e.g. [2001:db8:3333:4444:5555:6666:7777:8888] uses the specific IP
    • [::1] for the loopback interface
    • [::] to open the server on all available IPv6 interfaces
  • a hostname which resolves to an IP address (depending on your DNS configuration, resolves to either IPv4 or IPv6):
    • localhost resolves to the IP address of the loopback interface
    • e.g. hostname for a specific IP address

PORT can be:

  • 0 allows the operating system to choose an unassigned port dynamically
  • e.g. 1234 uses the specific port

Set to 0.0.0.0:0 to be automatically assigned a public IP address with a dynamically assigned port.

Both IPv4 and IPv6 addresses are accepted (see the format details above). Giving a non-localhost IP address makes Braid available remotely on the network. Remote clients must present an access token to connect. Using the unspecified IP address (0.0.0.0 for IPv4 or [::] for IPv6) exposes the server on all network interfaces. Using port 0 lets the operating system pick a free port.

The default value is set to DEFAULT_HTTP_API_SERVER_ADDR.

§model_server_addr: SocketAddr

Address of HTTP port for model server emitting realtime tracking results

§save_empty_data2d: bool

Save rows to data2d_distorted where nothing detected (saves timestamps)

§secret_base64: Option<String>

Secret to use for signing HTTP cookies (base64 encoded)

§trusted_networks: Vec<String>

Client networks (CIDR notation, e.g. 100.64.0.0/10 for Tailscale or a WireGuard subnet) that are trusted to have already authenticated the peer. Requests from these networks are accepted without an access token, delegating authentication to the overlay network. Defaults to empty.

§acquisition_duration_allowed_imprecision_msec: Option<f64>

Threshold duration before logging error (msec).

If the image acquisition timestamp precedes the computed trigger timestamp, clearly an error has happened. This error must lie in the computation of the trigger timestamp. This specifies the threshold error at which an error is logged. (The underlying source of such errors remains unknown.)

§write_buffer_size_num_messages: usize

The size of the buffer, in number of messages, used by the channel for sending data to disk.

Trait Implementations§

Source§

impl Clone for MainbrainConfig

Source§

fn clone(&self) -> MainbrainConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MainbrainConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MainbrainConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for MainbrainConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for MainbrainConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Preferences for T

Source§

fn save<S>(&self, app: &AppInfo, key: S) -> Result<(), PreferencesError>
where S: AsRef<str>,

Saves the current state of this object. Implementation is platform-dependent, but the data will be local to the active user. Read more
Source§

fn load<S>(app: &AppInfo, key: S) -> Result<T, PreferencesError>
where S: AsRef<str>,

Loads this object’s state from previously saved user data with the same 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 more
Source§

fn save_to<W>(&self, writer: &mut W) -> Result<(), PreferencesError>
where W: Write,

Same as save, but writes the serialized preferences to an arbitrary writer.
Source§

fn load_from<R>(reader: &mut R) -> Result<T, PreferencesError>
where R: Read,

Same as load, but reads the serialized preferences from an arbitrary writer.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,