Skip to main content

PoseGraph

Struct PoseGraph 

Source
pub struct PoseGraph { /* private fields */ }

Implementations§

Source§

impl PoseGraph

Source

pub fn new() -> Self

Source

pub fn loops(&self) -> u32

Loop edges the graph holds, each counted once.

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn node_id(canvas_id: &str, frame: u32) -> String

The node id for a canvas and frame: <canvasId>/<frame padded to 10 digits>.

Source

pub fn get(&self, id: &str) -> Option<&PoseNode>

Source

pub fn hydrate_node(&mut self, node: PoseNode)

Takes back one stored node/ row.

Source

pub fn hydrate_edge(&mut self, key: &str, edge: PoseEdge)

Takes back one stored edge/ row under its full key; the owning node’s id is what the key holds between edge/ and /<other>/<kind>.

Source

pub fn add( &mut self, canvas_id: &str, frame: u32, (x, y): (f64, f64), previous: Option<&str>, weight: f64, ) -> Result<(PoseNode, Vec<Write>), PoseGraphError>

Adds the node for canvas_id at frame, observed at odometry pose (x, y). With a previous node on the same chain it starts from the correction that node has received so far, links to it with an odometry edge of weight (a step measured on a thin overlap pulls less) and becomes its next; without one it is pinned.

Source

pub fn connect( &mut self, a_id: &str, b_id: &str, dx: f64, dy: f64, weight: f64, kind: EdgeKind, ) -> Result<Vec<Write>, PoseGraphError>

Links a to b by the offset (dx, dy) measured from a, once per pair and kind. A loop edge forward along a’s own odometry chain also spreads the closure error over the nodes after a, in proportion to their frame, so relaxation starts near the answer.

Source

pub fn unpin(&mut self, id: &str) -> Result<Vec<Write>, PoseGraphError>

Lets a node move under relaxation (a relocalized or attached node starts pinned until its loop edge is wired) and stores it.

Source

pub fn correction( &self, id: &str, frame: f64, ) -> Result<(f64, f64), PoseGraphError>

How far relaxation moved the pose at frame on the chain through node id: that node’s correction, blended towards its next node’s by how far frame lies between them.

Source

pub fn begin_optimize(&self) -> Option<Optimizer>

Starts relaxing the graph, or returns None when it holds no loop edge (nothing to relax: the outcome is zero residual after zero iterations, and nothing is written).

Source

pub fn finish_optimize( &mut self, optimizer: Optimizer, ) -> (OptimizeOutcome, Vec<Write>)

Writes a finished relaxation back: every unpinned node with at least one edge takes its relaxed position and is stored, in node order, FLUSH_CHUNK per putMany.

Trait Implementations§

Source§

impl Default for PoseGraph

Source§

fn default() -> Self

Returns the “default value” for a type. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.