Skip to main content

Visualizer

Struct Visualizer 

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

Main visualizer struct

Implementations§

Source§

impl Visualizer

Source

pub fn new() -> Self

Create a new visualizer

Source

pub fn set_title(&mut self, title: &str) -> &mut Self

Set the plot title

Source

pub fn set_x_label(&mut self, label: &str) -> &mut Self

Set X axis label

Source

pub fn set_y_label(&mut self, label: &str) -> &mut Self

Set Y axis label

Source

pub fn set_x_range(&mut self, min: f64, max: f64) -> &mut Self

Set X axis range

Source

pub fn set_y_range(&mut self, min: f64, max: f64) -> &mut Self

Set Y axis range

Source

pub fn set_aspect_ratio(&mut self, ratio: Option<f64>) -> &mut Self

Set aspect ratio (None for auto)

Source

pub fn figure_mut(&mut self) -> &mut Figure

Get mutable reference to the internal figure for advanced usage

Source

pub fn plot_path(&mut self, path: &Path2D, style: &PathStyle) -> &mut Self

Plot a path

Source

pub fn plot_path_xy( &mut self, x: &[f64], y: &[f64], style: &PathStyle, ) -> &mut Self

Plot a path from x,y vectors

Source

pub fn plot_obstacles(&mut self, obstacles: &Obstacles) -> &mut Self

Plot obstacles

Source

pub fn plot_obstacles_xy(&mut self, ox: &[f64], oy: &[f64]) -> &mut Self

Plot obstacles from x,y vectors

Source

pub fn plot_point(&mut self, point: Point2D, style: &PointStyle) -> &mut Self

Plot a single point (start, goal, etc.)

Source

pub fn plot_points( &mut self, points: &[Point2D], style: &PointStyle, ) -> &mut Self

Plot multiple points

Source

pub fn plot_points_xy( &mut self, x: &[f64], y: &[f64], style: &PointStyle, ) -> &mut Self

Plot points from x,y vectors

Source

pub fn plot_robot(&mut self, pose: &Pose2D, size: f64) -> &mut Self

Plot robot pose with direction indicator

Source

pub fn plot_start(&mut self, point: Point2D) -> &mut Self

Plot start position

Source

pub fn plot_goal(&mut self, point: Point2D) -> &mut Self

Plot goal position

Source

pub fn show(&mut self) -> Result<(), String>

Finalize and show the plot

Source

pub fn save_png( &mut self, path: &str, width: u32, height: u32, ) -> Result<(), String>

Save plot to PNG file

Source

pub fn save_svg( &mut self, path: &str, width: u32, height: u32, ) -> Result<(), String>

Save plot to SVG file

Trait Implementations§

Source§

impl Default for Visualizer

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> 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.