Drake

Generalpurpose Systems such as Gain, Multiplexer, Integrator, and LinearSystem.
Classes  
class  Adder< T > 
An adder for arbitrarily many inputs of equal size. More...  
class  TimeVaryingAffineSystem< T > 
Base class for a discrete or continuoustime, timevarying affine system, with potentially timevarying coefficients. More...  
class  AffineSystem< T > 
A discrete OR continuous affine system (with constant coefficients). More...  
class  ConstantValueSource< T > 
A source block that always outputs a constant value. More...  
class  ConstantVectorSource< T > 
A source block with a constant output port at all times. More...  
class  Demultiplexer< T > 
This system splits a vector valued signal on its input into multiple outputs. More...  
class  DiscreteDerivative< T > 
System that outputs the discretetime derivative of its input: y(t) = (u[n]  u[n1])/h, where n = floor(t/h), where h is the time period. More...  
class  StateInterpolatorWithDiscreteDerivative< T > 
Supports the common pattern of combining a (feedthrough) position with a velocity estimated with the DiscreteDerivative into a single output vector with positions and velocities stacked. More...  
class  DiscreteTimeDelay< T > 
A discrete time delay block with input u, which is vectorvalued (discrete or continuous) or abstract, and output delayed_u which is previously received input, delayed by the given amount. More...  
class  FirstOrderLowPassFilter< T > 
An elementwise first order low pass filter system that filters the ith input uᵢ into the ith output zᵢ. More...  
class  Gain< T > 
An elementwise gain block with input u and output y = k * u with k a constant vector. More...  
class  Integrator< T > 
An integrator for a continuous vector input. More...  
class  LinearSystem< T > 
A discrete OR continuous linear system. More...  
class  TimeVaryingLinearSystem< T > 
Base class for a discrete or continuous linear timevarying (LTV) system. More...  
class  MatrixGain< T > 
A system that specializes LinearSystem by setting coefficient matrices A , B , and C to all be zero. More...  
class  Multiplexer< T > 
This system combines multiple vectorvalued inputs into a vectorvalued output. More...  
class  PassThrough< T > 
A pass through system with input u and output y = u . More...  
class  RandomSource 
A source block which generates random numbers at a fixed sampling interval, with a zeroorder hold between samples. More...  
class  Saturation< T > 
An elementwise hard saturation block with inputs signal u , saturation values \( u_{min} \) and/or \( u_{max} \), and output y respectively as in: More...  
class  SignalLogger< T > 
A discrete sink block which logs its input to memory (not thread safe). More...  
class  Sine< T > 
A sine system which outputs y = a * sin(f * t + p) and first and second derivatives w.r.t. More...  
class  TrajectoryAffineSystem< T > 
A continuous or discretetime Affine TimeVarying system with system matrices described by trajectories. More...  
class  TrajectoryLinearSystem< T > 
A continuous or discretetime Linear TimeVarying system with system matrices described by trajectories. More...  
class  TrajectorySource< T > 
A source block that generates the value of a Trajectory for a given time. More...  
class  WrapToSystem< T > 
An elementwise wrapping block that transforms the specified indices of the input signal u into the interval [low, high) . More...  
class  ZeroOrderHold< T > 
A zero order hold block with input u, which may be vectorvalued (discrete or continuous) or abstract, and discrete output y, where the y is sampled from u with a fixed period. More...  
Functions  
std::unique_ptr< LinearSystem< double > >  Linearize (const System< double > &system, const Context< double > &context, std::variant< InputPortSelection, InputPortIndex > input_port_index=InputPortSelection::kUseFirstInputIfItExists, std::variant< OutputPortSelection, OutputPortIndex > output_port_index=OutputPortSelection::kUseFirstOutputIfItExists, double equilibrium_check_tolerance=1e6) 
Takes the firstorder Taylor expansion of a System around a nominal operating point (defined by the Context). More...  
std::unique_ptr< AffineSystem< double > >  FirstOrderTaylorApproximation (const System< double > &system, const Context< double > &context, std::variant< InputPortSelection, InputPortIndex > input_port_index=InputPortSelection::kUseFirstInputIfItExists, std::variant< OutputPortSelection, OutputPortIndex > output_port_index=OutputPortSelection::kUseFirstOutputIfItExists) 
A firstorder Taylor series approximation to a system in the neighborhood of an arbitrary point. More...  
std::unique_ptr<AffineSystem<double> > drake::systems::FirstOrderTaylorApproximation  (  const System< double > &  system, 
const Context< double > &  context,  
std::variant< InputPortSelection, InputPortIndex >  input_port_index = InputPortSelection::kUseFirstInputIfItExists , 

std::variant< OutputPortSelection, OutputPortIndex >  output_port_index = OutputPortSelection::kUseFirstOutputIfItExists 

) 
A firstorder Taylor series approximation to a system
in the neighborhood of an arbitrary point.
When Taylorexpanding a system at a nonequilibrium point, it may be represented either of the form:
\[ \dot{x}  \dot{x}_0 = A (x  x_0) + B (u  u_0), \]
for continuous time, or
\[ x[n+1]  x_0[n+1] = A (x[n]  x_0[n]) + B (u[n]  u_0[n]), \]
for discrete time. As above, we denote \( x_0, u_0 \) to be the nominal state and input at the provided context
. The system description is affine when the terms \( \dot{x}_0  A x_0  B u_0 \) and \( x_0[n+1]  A x_0[n]  B u_0[n] \) are nonzero.
More precisely, let x be a state and u be an input. This function returns an AffineSystem of the form:
\[ \dot{x} = A x + B u + f_0, \]
(CT)
\[ x[n+1] = A x[n] + B u[n] + f_0, \]
(DT) where \( f_0 = \dot{x}_0  A x_0  B u_0 \) (CT) and \( f_0 = x_0[n+1]  A x[n]  B u[n] \) (DT).
This method currently supports approximating around at most a single vector input port and at most a single vector output port. For systems with more ports, use input_port_index
and output_port_index
to select the input for the newly constructed system. Any additional input ports will be treated as constants (fixed at the value specified in context
).
system  The system or subsystem to linearize. 
context  Defines the nominal operating point about which the system should be linearized. 
input_port_index  A valid input port index for system or InputPortSelection. Default: kUseFirstInputIfItExists. 
output_port_index  A valid output port index for system or OutputPortSelection. Default: kUseFirstOutputIfItExists. 
if  any abstract inputs are connected, if any vectorvalued inputs are unconnected, if the system is not (only) continuous or not (only) discrete time with a single periodic update. 
system
, since the terms involving \( x_0, u_0 \) reside in \( f_0 \).system
. std::unique_ptr<LinearSystem<double> > drake::systems::Linearize  (  const System< double > &  system, 
const Context< double > &  context,  
std::variant< InputPortSelection, InputPortIndex >  input_port_index = InputPortSelection::kUseFirstInputIfItExists , 

std::variant< OutputPortSelection, OutputPortIndex >  output_port_index = OutputPortSelection::kUseFirstOutputIfItExists , 

double  equilibrium_check_tolerance = 1e6 

) 
Takes the firstorder Taylor expansion of a System around a nominal operating point (defined by the Context).
This method currently supports linearizing around at most a single vector input port and at most a single vector output port. For systems with more ports, use input_port_index
and output_port_index
to select the input for the newly constructed system. Any additional vector input ports will be treated as constants (fixed at the value specified in context
). Abstractvalued input ports must be unconnected (i.e., the system must treat the port as optional and it must be unused).
system  The system or subsystem to linearize. 
context  Defines the nominal operating point about which the system should be linearized. See note below. 
input_port_index  A valid input port index for system or InputPortSelection. All other inputs are assumed to be fixed to the value described by the context . Default: kUseFirstInputIfItExists. 
output_port_index  A valid output port index for system or an OutputPortSelection. Default: kUseFirstOutputIfItExists. 
equilibrium_check_tolerance  Specifies the tolerance on ensuring that the derivative vector isZero at the nominal operating point. Default: 1e6. 
std::runtime_error  if the operating point is not an equilibrium point of the system (within the specified tolerance) 
std::runtime_error  if the system is not (only) continuous or (only) discrete time with a single periodic update. 
port.FixValue(context, default_input)
. Any abstract inputs in the system must be unconnected (the port must be both optional and unused).system
.