Signals#
- class staliro.signals.Signal#
Representation of a time-varying input to a system.
- abstract at_time(time)#
Get the value of the signal at the specified time.
- class staliro.signals.SignalFactory(*args, **kwargs)#
Factory interface for creating signals from a set of times and control points.
Implementations#
- staliro.signals.pchip(times, control_points)#
Create a signal using PChip interpolation.
Pchip is a smooth 3rd-order cubic spline interpolation.
- staliro.signals.piecewise_linear(times, control_points)#
Create a signal that is interpolated linearly between control points.
The values of the signal between control points are interpolated by using the control point before and after the time to create a linear equation that is evaluated at the current time.
- staliro.signals.piecewise_constant(times, values)#
Create a signal that is constant between control points.
The values of the signal between control points are constant until the next control point.
- staliro.signals.harmonic(_, control_points)#
Create a signal that is the sum of multiple sinusoidal components.
The bias value for this signal is the first control point and any harmonic components must be defined after the bias in groups of 3 with the order being the amplitude, frequency, and phase.
Combinators#
- staliro.signals.delayed(inner, *, delay)#
Delay the control points inner signal by the given amount.
- Parameters:
inner (SignalFactory) – Factory for the signal to delay
delay (float) – The amount of time to delay
- Returns:
A
SignalFactoryfor the delayed signal- Return type:
- staliro.signals.clamped(inner, *, lo=None, hi=None)#
Create a signal that will not exceed the given range.
- Parameters:
inner (SignalFactory) – Factory for the signal to clamp
lo (float | None) – The optional lower bound of the signal
hi (float | None) – The optional upper bound of the signal
- Returns:
A
SignalFactoryfor the clamped signal- Return type:
- staliro.signals.sequenced(first, second, *, t_switch)#
Create a signal that will switch behavior at a given time.
- Parameters:
first (SignalFactory) – Factory for the signal to use before the switch time
second (SignalFactory) – Factory for the signal to use after the switch time
t_switch (float) – The time to switch from first to second
- Returns:
A
SignalFactoryfor the sequenced signal- Return type: