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
impl TrajectoryMemory
Sourcepub async fn write_uncompressed(
&self,
segments: &[Poly4D],
start_addr: usize,
) -> Result<usize>
pub async fn write_uncompressed( &self, segments: &[Poly4D], start_addr: usize, ) -> Result<usize>
Sourcepub async fn write_uncompressed_with_progress<F>(
&self,
segments: &[Poly4D],
start_addr: usize,
progress_callback: F,
) -> Result<usize>
pub async fn write_uncompressed_with_progress<F>( &self, segments: &[Poly4D], start_addr: usize, progress_callback: F, ) -> Result<usize>
Sourcepub async fn write_compressed(
&self,
start: &CompressedStart,
segments: &[CompressedSegment],
start_addr: usize,
) -> Result<usize>
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 trajectorysegments- A slice of compressed trajectory segmentsstart_addr- The address in trajectory memory to upload to (0 by default)
§Returns
The number of bytes written
Sourcepub async fn write_compressed_with_progress<F>(
&self,
start: &CompressedStart,
segments: &[CompressedSegment],
start_addr: usize,
progress_callback: F,
) -> Result<usize>
pub async fn write_compressed_with_progress<F>( &self, start: &CompressedStart, segments: &[CompressedSegment], start_addr: usize, progress_callback: F, ) -> Result<usize>
Write a compressed trajectory with progress reporting
§Arguments
start- The starting point of the trajectorysegments- A slice of compressed trajectory segmentsstart_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
impl Debug for TrajectoryMemory
Source§impl FromMemoryBackend for TrajectoryMemory
impl FromMemoryBackend for TrajectoryMemory
Source§async fn from_memory_backend(memory: MemoryBackend) -> Result<Self>
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 moreSource§async fn initialize_memory_backend(memory: MemoryBackend) -> Result<Self>
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
fn close_memory(self) -> MemoryBackend
Close the memory and return the backend to the subsystem Read more
Auto Trait Implementations§
impl Freeze for TrajectoryMemory
impl RefUnwindSafe for TrajectoryMemory
impl Send for TrajectoryMemory
impl Sync for TrajectoryMemory
impl Unpin for TrajectoryMemory
impl UnsafeUnpin for TrajectoryMemory
impl UnwindSafe for TrajectoryMemory
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
Mutably borrows from an owned value. Read more