pub struct Track {
pub straight: f64,
pub radius: f64,
pub clothoid: f64,
pub curve: f64,
pub length: f64,
pub width: f64,
pub segments: Vec<f64>,
/* private fields */
}Expand description
The closed track’s centre line: straight 1 from the origin along +x, curve 1, straight 2 back along -x at the track’s width, curve 2; and its motor segments (each straight cut into modules, each curve one).
Fields§
§straight: f64§radius: f64§clothoid: f64§curve: f64One curve’s length, pi R + clothoid.
length: f64The loop, 2 straight + 2 curve.
width: f64The distance between the straights (the curve’s “diameter” in Beckhoff’s catalogue).
segments: Vec<f64>Where each segment starts along the loop, rising from 0; the last ends at length.
Implementations§
Source§impl Track
impl Track
pub fn new( straight: f64, module: f64, radius: f64, clothoid: f64, ) -> Result<Self, ConfigError>
Sourcepub fn mean_curvature(&self, s: f64, w: f64) -> (f64, f64)
pub fn mean_curvature(&self, s: f64, w: f64) -> (f64, f64)
The curvature a body on rollers w apart follows at s, its mean over [s - w/2, s + w/2], and its rate along s.
Sourcepub fn mean_heading(&self, s: f64, w: f64) -> f64
pub fn mean_heading(&self, s: f64, w: f64) -> f64
The heading of a body on rollers w apart at s, its mean over [s - w/2, s + w/2]: its rate along s is
mean_curvature’s, the curvature the body follows.
Sourcepub fn point(&self, s: f64) -> [f64; 2]
pub fn point(&self, s: f64) -> [f64; 2]
The centre line’s point at s (m, in the track’s plane).
Sourcepub fn tangent(&self, s: f64) -> [f64; 2]
pub fn tangent(&self, s: f64) -> [f64; 2]
The centre line’s direction at s, d point / ds: a unit vector, along the curve’s chord between two of its
table’s points, where point runs.
Sourcepub fn is_curve(&self, j: usize) -> bool
pub fn is_curve(&self, j: usize) -> bool
Whether segment j is a curve (one segment each), else a straight module.
The share of a plate of length plate centred at s that lies over segment j.