Skip to main content

World

Struct World 

Source
pub struct World<B, E, C, M, CI, PD, R: FlightFloat>
where B: BoardIo, E: Estimator<R>, C: Controller<R, State = E::State> + RcTrimCalibrator, M: Mixer<R, MixerInput = C::ControlOutput>, M::ActuatorCommands: AsRef<[R]> + Copy, E::State: Copy + Default, CI: CommInterface<B>, PD: PwmDriver<R>,
{ /* private fields */ }

Implementations§

Source§

impl<B, E, C, M, CI, PD, R> World<B, E, C, M, CI, PD, R>
where B: BoardIo, E: Estimator<R>, C: Controller<R, State = E::State> + RcTrimCalibrator, M: Mixer<R, MixerInput = C::ControlOutput>, M::ActuatorCommands: AsRef<[R]> + Copy, E::State: Copy + Default, CI: CommInterface<B>, PD: PwmDriver<R>, R: FlightFloat,

Source

pub fn run_once(&mut self) -> bool

Source

pub fn set_telemetry_rates(&mut self, telemetry_rates: TelemetryRates)

Source

pub fn set_control_loop_rates(&mut self, control_loop_rates: ControlLoopRates)

Source

pub fn set_test_pin_3(&mut self, high: bool)

Source

pub fn set_test_pin_2(&mut self, high: bool)

Source

pub fn run_comm_param_sensor_stages(&mut self)

Source

pub fn imu_pending(&self) -> bool

Source

pub fn realtime_scheduler_step(&self) -> RealtimeSchedulerStep

Source

pub fn run_imu_control_tick(&mut self) -> bool

Source

pub fn run_control_update_tick(&mut self) -> bool

Source

pub fn run_rc_command_state_stages(&mut self, fresh_rc: Option<RcPacket>)

Source

pub fn run_pwm_output_stage(&mut self) -> bool

Source

pub fn run_control_stages_if_new_imu(&mut self) -> bool

Source

pub fn run_control_and_mixing_stage_if_new_imu(&mut self) -> bool

Source§

impl<B, E, C, M, CI, PD, R> World<B, E, C, M, CI, PD, R>
where B: BoardIo, E: Estimator<R>, C: Controller<R, State = E::State> + RcTrimCalibrator, M: Mixer<R, MixerInput = C::ControlOutput>, M::ActuatorCommands: AsRef<[R]> + Copy, E::State: Copy + Default, CI: CommInterface<B>, PD: PwmDriver<R>, R: FlightFloat,

Source§

impl<B, E, C, M, CI, PD, R> World<B, E, C, M, CI, PD, R>
where B: BoardIo, E: Estimator<R>, C: Controller<R, State = E::State> + RcTrimCalibrator, M: Mixer<R, MixerInput = C::ControlOutput>, M::ActuatorCommands: AsRef<[R]> + Copy, E::State: Copy + Default, CI: CommInterface<B>, PD: PwmDriver<R>, R: FlightFloat,

Source

pub fn run_telemetry_stage(&mut self)

Source

pub fn run_realtime_telemetry_stage_budgeted( &mut self, max_streams: usize, ) -> usize

Sends up to max_streams currently due named telemetry streams.

Board realtime loops may call this after a completed control update when hardware timing shows enough post-control slack and service phases alone do not provide enough telemetry scheduling opportunities. Keep the budget board-specific and validate the resulting control p99/max timing with scope pins before making it a production default.

Source

pub fn run_realtime_telemetry_stage_with_available_slack(&mut self) -> usize

Sends due streams until there is no work left or the measured control slack reaches the board’s safety margin. The slack check occurs between individual streams, so this never turns an arbitrary stream count into a scheduling bottleneck.

Source

pub fn run_realtime_telemetry_stage_prioritized( &mut self, priority_streams: &[RealtimeTelemetryPriority], max_streams: usize, ) -> usize

Sends board-selected priority streams first, then fills the remaining budget normally.

priority_streams is a board policy list. Core applies each stream’s configured priority gate, so boards can choose normal due-deadline behavior or a stricter freshness gate for streams paced by the control tick.

Source§

impl<B, E, C, M, CI, PD, R> World<B, E, C, M, CI, PD, R>
where B: BoardIo, E: Estimator<R>, C: Controller<R, State = E::State> + RcTrimCalibrator, M: Mixer<R, MixerInput = C::ControlOutput>, M::ActuatorCommands: AsRef<[R]> + Copy, E::State: Copy + Default, CI: CommInterface<B>, PD: PwmDriver<R>, R: FlightFloat,

Source

pub fn init( board: B, params: Params, comm_link: CI, state: StateManager, estimator: E, controller: C, mixer: M, pwm: PD, ) -> Self

Auto Trait Implementations§

§

impl<B, E, C, M, CI, PD, R> Freeze for World<B, E, C, M, CI, PD, R>
where <E as Estimator<R>>::State: Sized + Freeze, <M as Mixer<R>>::ActuatorCommands: Sized + Freeze, B: Freeze, E: Freeze, C: Freeze, M: Freeze, PD: Freeze, CI: Freeze, R: Freeze,

§

impl<B, E, C, M, CI, PD, R> RefUnwindSafe for World<B, E, C, M, CI, PD, R>

§

impl<B, E, C, M, CI, PD, R> Send for World<B, E, C, M, CI, PD, R>
where <E as Estimator<R>>::State: Sized + Send, <M as Mixer<R>>::ActuatorCommands: Sized + Send, B: Send, E: Send, C: Send, M: Send, PD: Send, CI: Send,

§

impl<B, E, C, M, CI, PD, R> Sync for World<B, E, C, M, CI, PD, R>
where <E as Estimator<R>>::State: Sized + Sync, <M as Mixer<R>>::ActuatorCommands: Sized + Sync, B: Sync, E: Sync, C: Sync, M: Sync, PD: Sync, CI: Sync,

§

impl<B, E, C, M, CI, PD, R> Unpin for World<B, E, C, M, CI, PD, R>
where <E as Estimator<R>>::State: Sized + Unpin, <M as Mixer<R>>::ActuatorCommands: Sized + Unpin, B: Unpin, E: Unpin, C: Unpin, M: Unpin, PD: Unpin, CI: Unpin, R: Unpin,

§

impl<B, E, C, M, CI, PD, R> UnsafeUnpin for World<B, E, C, M, CI, PD, R>

§

impl<B, E, C, M, CI, PD, R> UnwindSafe for World<B, E, C, M, CI, PD, R>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.