Skip to main content

TrajectoryMemory

Struct TrajectoryMemory 

Source
pub struct TrajectoryMemory { /* private fields */ }
Expand description

Memory interface for trajectories used by the high level commander

Trajectories can be either uncompressed (using Poly4D segments) or compressed (using CompressedStart followed by CompressedSegments). Use write_uncompressed for Poly4D trajectories and write_compressed for compressed trajectories.

Implementations§

Source§

impl TrajectoryMemory

Source

pub async fn write_uncompressed( &self, segments: &[Poly4D], start_addr: usize, ) -> Result<usize>

Write an uncompressed trajectory (Poly4D segments) to the Crazyflie

§Arguments
  • segments - A slice of Poly4D trajectory segments
  • start_addr - The address in trajectory memory to upload to (0 by default)
§Returns

The number of bytes written

Source

pub async fn write_uncompressed_with_progress<F>( &self, segments: &[Poly4D], start_addr: usize, progress_callback: F, ) -> Result<usize>
where F: FnMut(usize, usize),

Write an uncompressed trajectory with progress reporting

§Arguments
  • segments - A slice of Poly4D trajectory segments
  • start_addr - The address in trajectory memory to upload to (0 by default)
  • progress_callback - Called with (bytes_written, total_bytes)
§Returns

The number of bytes written

Source

pub async fn write_compressed( &self, start: &CompressedStart, segments: &[CompressedSegment], start_addr: usize, ) -> Result<usize>

Write a compressed trajectory to the Crazyflie

Compressed trajectories must start with a CompressedStart followed by zero or more CompressedSegments.

§Arguments
  • start - The starting point of the trajectory
  • segments - A slice of compressed trajectory segments
  • start_addr - The address in trajectory memory to upload to (0 by default)
§Returns

The number of bytes written

Source

pub async fn write_compressed_with_progress<F>( &self, start: &CompressedStart, segments: &[CompressedSegment], start_addr: usize, progress_callback: F, ) -> Result<usize>
where F: FnMut(usize, usize),

Write a compressed trajectory with progress reporting

§Arguments
  • start - The starting point of the trajectory
  • segments - A slice of compressed trajectory segments
  • start_addr - The address in trajectory memory to upload to (0 by default)
  • progress_callback - Called with (bytes_written, total_bytes)
§Returns

The number of bytes written

Trait Implementations§

Source§

impl Debug for TrajectoryMemory

Source§

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

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

impl FromMemoryBackend for TrajectoryMemory

Source§

async fn from_memory_backend(memory: MemoryBackend) -> Result<Self>

Create a memory-specific type from a MemoryBackend. When created the memory is automatically read to populate the fields of the type. Read more
Source§

async fn initialize_memory_backend(memory: MemoryBackend) -> Result<Self>

Get a specific memory by its ID and initialize it according to the defaults. Note that the values will not be written to the memory by default, the user needs to handle this. Read more
Source§

fn close_memory(self) -> MemoryBackend

Close the memory and return the backend to the subsystem 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> 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, 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.