maliput::api

Struct LanePosition

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

A Lane Position. Wrapper around C++ implementation maliput::api::LanePosition.

§Example

use maliput::api::LanePosition;

let lane_pos = LanePosition::new(1.0, 2.0, 3.0);
println!("lane_pos = {}", lane_pos);
assert_eq!(lane_pos.s(), 1.0);
assert_eq!(lane_pos.r(), 2.0);
assert_eq!(lane_pos.h(), 3.0);

Implementations§

Source§

impl LanePosition

Source

pub fn new(s: f64, r: f64, h: f64) -> LanePosition

Create a new LanePosition with the given s, r, and h components.

Source

pub fn s(&self) -> f64

Get the s component of the LanePosition.

Source

pub fn r(&self) -> f64

Get the r component of the LanePosition.

Source

pub fn h(&self) -> f64

Get the h component of the LanePosition.

Source

pub fn srh(&self) -> Vector3

Returns all components as 3-vector [s, r, h].

Source

pub fn set_s(&mut self, s: f64)

Set the s component of the LanePosition.

Source

pub fn set_r(&mut self, r: f64)

Set the r component of the LanePosition.

Source

pub fn set_h(&mut self, h: f64)

Set the h component of the LanePosition.

Source

pub fn set_srh(&mut self, srh: &Vector3)

Set all components from 3-vector [s, r, h].

Trait Implementations§

Source§

impl Debug for LanePosition

Source§

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

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

impl Display for LanePosition

Source§

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

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

impl PartialEq for LanePosition

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for LanePosition

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> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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.