pub struct SphericalLedArm {
pub commanded_angles: Vec<(f64, f64)>,
pub arm_length: f64,
pub pivot_offset: (f64, f64, f64),
pub orientation_radians: (f64, f64, f64),
pub theta_zero_radians: f64,
pub phi_zero_radians: f64,
pub theta_scale: f64,
pub phi_scale: f64,
pub elevation_axis_tilt_radians: f64,
pub theta_backlash_radians: f64,
pub phi_backlash_radians: f64,
}Expand description
A single LED moved over a spherical trajectory by an azimuth/elevation arm.
commanded_angles are (theta, phi) encoder commands in acquisition order.
The kinematic model includes encoder affine errors, direction-dependent
backlash, inner-axis non-orthogonality, arm-pivot displacement, and a rigid
mount rotation. Azimuth commands should be unwrapped when crossing +-pi so
that backlash direction is unambiguous.
Fields§
§commanded_angles: Vec<(f64, f64)>Movement-order (theta, phi) encoder commands in radians.
arm_length: f64Positive distance from pivot to LED, in metres.
pivot_offset: (f64, f64, f64)Arm-pivot displacement (x, y, z) from the sample, in metres.
orientation_radians: (f64, f64, f64)Rigid mount rotation (rx, ry, rz) in radians.
theta_zero_radians: f64Additive elevation-encoder zero offset, in radians.
phi_zero_radians: f64Additive azimuth-encoder zero offset, in radians.
theta_scale: f64Positive dimensionless elevation-encoder scale.
phi_scale: f64Positive dimensionless azimuth-encoder scale.
elevation_axis_tilt_radians: f64Tilt of the elevation axis toward the azimuth axis, in radians.
theta_backlash_radians: f64Total separation between increasing and decreasing encoder branches.
phi_backlash_radians: f64Total separation between increasing and decreasing encoder branches.
Implementations§
Source§impl SphericalLedArm
impl SphericalLedArm
Sourcepub fn new(commanded_angles: Vec<(f64, f64)>, arm_length: f64) -> Self
pub fn new(commanded_angles: Vec<(f64, f64)>, arm_length: f64) -> Self
Creates an arm from movement-order commands in radians and length in metres.
Sourcepub fn pivot_offset(self, offset: (f64, f64, f64)) -> Self
pub fn pivot_offset(self, offset: (f64, f64, f64)) -> Self
Sets pivot displacement (x, y, z) from the sample in metres.
Sourcepub fn orientation_deg(self, degrees: (f64, f64, f64)) -> Self
pub fn orientation_deg(self, degrees: (f64, f64, f64)) -> Self
Sets extrinsic mount rotations (rx, ry, rz) in degrees, applied as Rz * Ry * Rx.
Sourcepub fn encoder_zero_deg(self, theta: f64, phi: f64) -> Self
pub fn encoder_zero_deg(self, theta: f64, phi: f64) -> Self
Sets additive elevation and azimuth encoder-zero offsets in degrees.
Sourcepub fn encoder_scale(self, theta: f64, phi: f64) -> Self
pub fn encoder_scale(self, theta: f64, phi: f64) -> Self
Sets positive dimensionless elevation and azimuth encoder scales.
Sourcepub fn elevation_axis_tilt_deg(self, degrees: f64) -> Self
pub fn elevation_axis_tilt_deg(self, degrees: f64) -> Self
Sets the elevation-axis non-orthogonality tilt in degrees.
Sourcepub fn backlash_deg(self, theta: f64, phi: f64) -> Self
pub fn backlash_deg(self, theta: f64, phi: f64) -> Self
Sets total elevation and azimuth backlash branch separations in degrees.
Sourcepub fn source_count(&self) -> usize
pub fn source_count(&self) -> usize
Returns the number of commanded physical source positions.
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Checks non-empty finite commands, positive geometry and encoder scales, and finite pose and mechanical calibration values.
Sourcepub fn resolve(&self, optics: &Optics) -> Result<ResolvedSources>
pub fn resolve(&self, optics: &Optics) -> Result<ResolvedSources>
Resolves physical positions to source-to-sample directions and transverse vectors.
Trait Implementations§
Source§impl Clone for SphericalLedArm
impl Clone for SphericalLedArm
Source§fn clone(&self) -> SphericalLedArm
fn clone(&self) -> SphericalLedArm
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SphericalLedArm
impl Debug for SphericalLedArm
Source§impl<'de> Deserialize<'de> for SphericalLedArm
impl<'de> Deserialize<'de> for SphericalLedArm
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<SphericalLedArm> for SourceGeometry
impl From<SphericalLedArm> for SourceGeometry
Source§fn from(value: SphericalLedArm) -> Self
fn from(value: SphericalLedArm) -> Self
Source§impl PartialEq for SphericalLedArm
impl PartialEq for SphericalLedArm
Source§fn eq(&self, other: &SphericalLedArm) -> bool
fn eq(&self, other: &SphericalLedArm) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for SphericalLedArm
impl Serialize for SphericalLedArm
impl StructuralPartialEq for SphericalLedArm
Auto Trait Implementations§
impl Freeze for SphericalLedArm
impl RefUnwindSafe for SphericalLedArm
impl Send for SphericalLedArm
impl Sync for SphericalLedArm
impl Unpin for SphericalLedArm
impl UnsafeUnpin for SphericalLedArm
impl UnwindSafe for SphericalLedArm
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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