pub struct TrajectoryConfig {
pub motor: String<32>,
pub target_degrees: Degrees,
pub velocity_percent: u8,
pub acceleration_percent: u8,
pub acceleration: Option<DegreesPerSecSquared>,
pub deceleration: Option<DegreesPerSecSquared>,
pub dwell_ms: Option<u32>,
}Expand description
A named trajectory from configuration.
Fields§
§motor: String<32>Target motor name (must match a motor in config).
target_degrees: DegreesTarget position in degrees (absolute from origin).
velocity_percent: u8Velocity as percentage of motor’s max (1-200).
acceleration_percent: u8Acceleration as percentage of motor’s max (1-200). Used when absolute rates are not specified.
acceleration: Option<DegreesPerSecSquared>Absolute acceleration rate in degrees/sec² (optional). Overrides acceleration_percent for the acceleration phase.
deceleration: Option<DegreesPerSecSquared>Absolute deceleration rate in degrees/sec² (optional). If not set, uses acceleration value (symmetric profile).
dwell_ms: Option<u32>Optional dwell time at target (milliseconds).
Implementations§
Source§impl TrajectoryConfig
impl TrajectoryConfig
Sourcepub fn effective_acceleration(&self, constraints: &MechanicalConstraints) -> f32
pub fn effective_acceleration(&self, constraints: &MechanicalConstraints) -> f32
Get effective acceleration rate for this trajectory.
Sourcepub fn effective_deceleration(&self, constraints: &MechanicalConstraints) -> f32
pub fn effective_deceleration(&self, constraints: &MechanicalConstraints) -> f32
Get effective deceleration rate for this trajectory. Falls back to acceleration if not specified (symmetric profile).
Sourcepub fn effective_velocity(&self, constraints: &MechanicalConstraints) -> f32
pub fn effective_velocity(&self, constraints: &MechanicalConstraints) -> f32
Get effective velocity for this trajectory.
Sourcepub fn is_asymmetric(&self) -> bool
pub fn is_asymmetric(&self) -> bool
Check if this trajectory uses asymmetric acceleration.
Sourcepub fn check_feasibility(
&self,
constraints: &MechanicalConstraints,
) -> Result<()>
pub fn check_feasibility( &self, constraints: &MechanicalConstraints, ) -> Result<()>
Check if this trajectory is feasible given the motor constraints.
Returns Ok(()) if the trajectory can be executed, or an error describing
why it cannot.
§Checks performed:
- Velocity percent is valid (1-200)
- Acceleration percent is valid (1-200)
- Target position is within soft limits (if configured)
- Effective velocity doesn’t exceed motor max
- Effective acceleration doesn’t exceed motor max
Trait Implementations§
Source§impl Clone for TrajectoryConfig
impl Clone for TrajectoryConfig
Source§fn clone(&self) -> TrajectoryConfig
fn clone(&self) -> TrajectoryConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more