pydrake.systems.primitives

Bindings for the primitives portion of the Systems framework.

pydrake.systems.primitives.Adder

alias of pydrake.systems.primitives.Adder_[float]

template pydrake.systems.primitives.Adder_

Instantiations: Adder_[float], Adder_[AutoDiffXd], Adder_[Expression]

class Adder_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

An adder for arbitrarily many inputs of equal size.

input(0)→
...→
input(N-1)→
Adder
→ sum
__init__(self: pydrake.systems.primitives.Adder_[float], num_inputs: int, size: int) → None

Construct an Adder System.

Parameter num_inputs:
is the number of input ports to be added.
Parameter size:
number of elements in each input and output signal.
class pydrake.systems.primitives.Adder_[AutoDiffXd]

Bases: pydrake.systems.framework.LeafSystem_[AutoDiffXd]

An adder for arbitrarily many inputs of equal size.

input(0)→
...→
input(N-1)→
Adder
→ sum
__init__(self: pydrake.systems.primitives.Adder_[AutoDiffXd], num_inputs: int, size: int) → None

Construct an Adder System.

Parameter num_inputs:
is the number of input ports to be added.
Parameter size:
number of elements in each input and output signal.
class pydrake.systems.primitives.Adder_[Expression]

Bases: pydrake.systems.framework.LeafSystem_[Expression]

An adder for arbitrarily many inputs of equal size.

input(0)→
...→
input(N-1)→
Adder
→ sum
__init__(self: pydrake.systems.primitives.Adder_[Expression], num_inputs: int, size: int) → None

Construct an Adder System.

Parameter num_inputs:
is the number of input ports to be added.
Parameter size:
number of elements in each input and output signal.
class pydrake.systems.primitives.Adder_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

An adder for arbitrarily many inputs of equal size.

input(0)→
...→
input(N-1)→
Adder
→ sum
__init__(self: pydrake.systems.primitives.Adder_[float], num_inputs: int, size: int) → None

Construct an Adder System.

Parameter num_inputs:
is the number of input ports to be added.
Parameter size:
number of elements in each input and output signal.
pydrake.systems.primitives.AddRandomInputs(sampling_interval_sec: float, builder: pydrake.systems.framework.DiagramBuilder_[float]) → int

For each subsystem input port in builder that is (a) not yet connected and (b) labeled as random in the InputPort, this method will add a new RandomSource system of the appropriate type and connect it to the subsystem input port.

Parameter sampling_interval_sec:
interval to be used for all new sources.
Returns:the total number of RandomSource systems added.

See also

stochastic_systems

pydrake.systems.primitives.AffineSystem

alias of pydrake.systems.primitives.AffineSystem_[float]

template pydrake.systems.primitives.AffineSystem_

Instantiations: AffineSystem_[float], AffineSystem_[AutoDiffXd], AffineSystem_[Expression]

class AffineSystem_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

A discrete OR continuous affine system (with constant coefficients).

u(t)→
AffineSystem
→ y(t)

Let u denote the input vector, x denote the state vector, and y denote the output vector.

If time_period > 0.0, the affine system will have the following discrete-time state update:

\[x(t+h) = A x(t) + B u(t) + f_0,\]

where h is the time_period. If time_period == 0.0, the affine system will have the following continuous-time state update:

\[\dot{x} = A x + B u + f_0.\]

In both cases, the system will have the output:

\[y = C x + D u + y_0,\]

See also

LinearSystem

See also

MatrixGain

__init__(self: pydrake.systems.primitives.AffineSystem_[float], A: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], B: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], f0: numpy.ndarray[numpy.float64[m, 1]], C: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], D: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], y0: numpy.ndarray[numpy.float64[m, 1]], time_period: float = 0.0) → None

Constructs an Affine system with a fixed set of coefficient matrices A, B,``C``, and D as well as fixed initial velocity offset xDot0 and output offset y0. The coefficient matrices must obey the following dimensions : | Matrix | Num Rows | Num Columns | |:-------:|:———–:|:-----------:| | A | num states | num states | | B | num states | num inputs | | C | num outputs | num states | | D | num outputs | num inputs |

Parameter time_period:
Defines the period of the discrete time system; use time_period=0.0 to denote a continuous time system. $*Default:* 0.0

Subclasses must use the protected constructor, not this one.

A(self: pydrake.systems.primitives.AffineSystem_[float]) → numpy.ndarray[numpy.float64[m, n]]

@name Helper getter methods.

B(self: pydrake.systems.primitives.AffineSystem_[float]) → numpy.ndarray[numpy.float64[m, n]]
C(self: pydrake.systems.primitives.AffineSystem_[float]) → numpy.ndarray[numpy.float64[m, n]]
configure_default_state(self: pydrake.systems.primitives.AffineSystem_[float], x0: numpy.ndarray[numpy.float64[m, 1]]) → None

Configures the value that will be assigned to the state vector in SetDefaultContext. x0 must be a vector of length num_states.

configure_random_state(self: pydrake.systems.primitives.AffineSystem_[float], covariance: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous]) → None

Configures the Gaussian distribution over state vectors used in the SetRandomContext methods. The mean of the distribution will be the default state (

See also

configure_default_state()). covariance must have size num_states by num_states and must be symmetric and positive semi-definite.

D(self: pydrake.systems.primitives.AffineSystem_[float]) → numpy.ndarray[numpy.float64[m, n]]
f0(self: pydrake.systems.primitives.AffineSystem_[float]) → numpy.ndarray[numpy.float64[m, 1]]
get_input_port(*args, **kwargs)

Overloaded function.

  1. get_input_port(self: pydrake.systems.primitives.AffineSystem_[float]) -> pydrake.systems.framework.InputPort_[float]

Returns the input port containing the externally applied input.

  1. get_input_port(self: pydrake.systems.primitives.AffineSystem_[float], port_index: int) -> pydrake.systems.framework.InputPort_[float]

Returns the typed input port at index port_index.

get_output_port(*args, **kwargs)

Overloaded function.

  1. get_output_port(self: pydrake.systems.primitives.AffineSystem_[float]) -> pydrake.systems.framework.OutputPort_[float]

Returns the output port containing the output state.

  1. get_output_port(self: pydrake.systems.primitives.AffineSystem_[float], port_index: int) -> pydrake.systems.framework.OutputPort_[float]

Returns the typed output port at index port_index.

time_period(self: pydrake.systems.primitives.AffineSystem_[float]) → float
y0(self: pydrake.systems.primitives.AffineSystem_[float]) → numpy.ndarray[numpy.float64[m, 1]]
class pydrake.systems.primitives.AffineSystem_[AutoDiffXd]

Bases: pydrake.systems.framework.LeafSystem_[AutoDiffXd]

A discrete OR continuous affine system (with constant coefficients).

u(t)→
AffineSystem
→ y(t)

Let u denote the input vector, x denote the state vector, and y denote the output vector.

If time_period > 0.0, the affine system will have the following discrete-time state update:

\[x(t+h) = A x(t) + B u(t) + f_0,\]

where h is the time_period. If time_period == 0.0, the affine system will have the following continuous-time state update:

\[\dot{x} = A x + B u + f_0.\]

In both cases, the system will have the output:

\[y = C x + D u + y_0,\]

See also

LinearSystem

See also

MatrixGain

__init__(self: pydrake.systems.primitives.AffineSystem_[AutoDiffXd], A: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], B: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], f0: numpy.ndarray[numpy.float64[m, 1]], C: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], D: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], y0: numpy.ndarray[numpy.float64[m, 1]], time_period: float = 0.0) → None

Constructs an Affine system with a fixed set of coefficient matrices A, B,``C``, and D as well as fixed initial velocity offset xDot0 and output offset y0. The coefficient matrices must obey the following dimensions : | Matrix | Num Rows | Num Columns | |:-------:|:———–:|:-----------:| | A | num states | num states | | B | num states | num inputs | | C | num outputs | num states | | D | num outputs | num inputs |

Parameter time_period:
Defines the period of the discrete time system; use time_period=0.0 to denote a continuous time system. $*Default:* 0.0

Subclasses must use the protected constructor, not this one.

A(self: pydrake.systems.primitives.AffineSystem_[AutoDiffXd]) → numpy.ndarray[numpy.float64[m, n]]

@name Helper getter methods.

B(self: pydrake.systems.primitives.AffineSystem_[AutoDiffXd]) → numpy.ndarray[numpy.float64[m, n]]
C(self: pydrake.systems.primitives.AffineSystem_[AutoDiffXd]) → numpy.ndarray[numpy.float64[m, n]]
configure_default_state(self: pydrake.systems.primitives.AffineSystem_[AutoDiffXd], x0: numpy.ndarray[object[m, 1]]) → None

Configures the value that will be assigned to the state vector in SetDefaultContext. x0 must be a vector of length num_states.

configure_random_state(self: pydrake.systems.primitives.AffineSystem_[AutoDiffXd], covariance: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous]) → None

Configures the Gaussian distribution over state vectors used in the SetRandomContext methods. The mean of the distribution will be the default state (

See also

configure_default_state()). covariance must have size num_states by num_states and must be symmetric and positive semi-definite.

D(self: pydrake.systems.primitives.AffineSystem_[AutoDiffXd]) → numpy.ndarray[numpy.float64[m, n]]
f0(self: pydrake.systems.primitives.AffineSystem_[AutoDiffXd]) → numpy.ndarray[numpy.float64[m, 1]]
get_input_port(*args, **kwargs)

Overloaded function.

  1. get_input_port(self: pydrake.systems.primitives.AffineSystem_[AutoDiffXd]) -> pydrake.systems.framework.InputPort_[AutoDiffXd]

Returns the input port containing the externally applied input.

  1. get_input_port(self: pydrake.systems.primitives.AffineSystem_[AutoDiffXd], port_index: int) -> pydrake.systems.framework.InputPort_[AutoDiffXd]

Returns the typed input port at index port_index.

get_output_port(*args, **kwargs)

Overloaded function.

  1. get_output_port(self: pydrake.systems.primitives.AffineSystem_[AutoDiffXd]) -> pydrake.systems.framework.OutputPort_[AutoDiffXd]

Returns the output port containing the output state.

  1. get_output_port(self: pydrake.systems.primitives.AffineSystem_[AutoDiffXd], port_index: int) -> pydrake.systems.framework.OutputPort_[AutoDiffXd]

Returns the typed output port at index port_index.

time_period(self: pydrake.systems.primitives.AffineSystem_[AutoDiffXd]) → float
y0(self: pydrake.systems.primitives.AffineSystem_[AutoDiffXd]) → numpy.ndarray[numpy.float64[m, 1]]
class pydrake.systems.primitives.AffineSystem_[Expression]

Bases: pydrake.systems.framework.LeafSystem_[Expression]

A discrete OR continuous affine system (with constant coefficients).

u(t)→
AffineSystem
→ y(t)

Let u denote the input vector, x denote the state vector, and y denote the output vector.

If time_period > 0.0, the affine system will have the following discrete-time state update:

\[x(t+h) = A x(t) + B u(t) + f_0,\]

where h is the time_period. If time_period == 0.0, the affine system will have the following continuous-time state update:

\[\dot{x} = A x + B u + f_0.\]

In both cases, the system will have the output:

\[y = C x + D u + y_0,\]

See also

LinearSystem

See also

MatrixGain

__init__(self: pydrake.systems.primitives.AffineSystem_[Expression], A: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], B: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], f0: numpy.ndarray[numpy.float64[m, 1]], C: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], D: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], y0: numpy.ndarray[numpy.float64[m, 1]], time_period: float = 0.0) → None

Constructs an Affine system with a fixed set of coefficient matrices A, B,``C``, and D as well as fixed initial velocity offset xDot0 and output offset y0. The coefficient matrices must obey the following dimensions : | Matrix | Num Rows | Num Columns | |:-------:|:———–:|:-----------:| | A | num states | num states | | B | num states | num inputs | | C | num outputs | num states | | D | num outputs | num inputs |

Parameter time_period:
Defines the period of the discrete time system; use time_period=0.0 to denote a continuous time system. $*Default:* 0.0

Subclasses must use the protected constructor, not this one.

A(self: pydrake.systems.primitives.AffineSystem_[Expression]) → numpy.ndarray[numpy.float64[m, n]]

@name Helper getter methods.

B(self: pydrake.systems.primitives.AffineSystem_[Expression]) → numpy.ndarray[numpy.float64[m, n]]
C(self: pydrake.systems.primitives.AffineSystem_[Expression]) → numpy.ndarray[numpy.float64[m, n]]
configure_default_state(self: pydrake.systems.primitives.AffineSystem_[Expression], x0: numpy.ndarray[object[m, 1]]) → None

Configures the value that will be assigned to the state vector in SetDefaultContext. x0 must be a vector of length num_states.

configure_random_state(self: pydrake.systems.primitives.AffineSystem_[Expression], covariance: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous]) → None

Configures the Gaussian distribution over state vectors used in the SetRandomContext methods. The mean of the distribution will be the default state (

See also

configure_default_state()). covariance must have size num_states by num_states and must be symmetric and positive semi-definite.

D(self: pydrake.systems.primitives.AffineSystem_[Expression]) → numpy.ndarray[numpy.float64[m, n]]
f0(self: pydrake.systems.primitives.AffineSystem_[Expression]) → numpy.ndarray[numpy.float64[m, 1]]
get_input_port(*args, **kwargs)

Overloaded function.

  1. get_input_port(self: pydrake.systems.primitives.AffineSystem_[Expression]) -> pydrake.systems.framework.InputPort_[Expression]

Returns the input port containing the externally applied input.

  1. get_input_port(self: pydrake.systems.primitives.AffineSystem_[Expression], port_index: int) -> pydrake.systems.framework.InputPort_[Expression]

Returns the typed input port at index port_index.

get_output_port(*args, **kwargs)

Overloaded function.

  1. get_output_port(self: pydrake.systems.primitives.AffineSystem_[Expression]) -> pydrake.systems.framework.OutputPort_[Expression]

Returns the output port containing the output state.

  1. get_output_port(self: pydrake.systems.primitives.AffineSystem_[Expression], port_index: int) -> pydrake.systems.framework.OutputPort_[Expression]

Returns the typed output port at index port_index.

time_period(self: pydrake.systems.primitives.AffineSystem_[Expression]) → float
y0(self: pydrake.systems.primitives.AffineSystem_[Expression]) → numpy.ndarray[numpy.float64[m, 1]]
class pydrake.systems.primitives.AffineSystem_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

A discrete OR continuous affine system (with constant coefficients).

u(t)→
AffineSystem
→ y(t)

Let u denote the input vector, x denote the state vector, and y denote the output vector.

If time_period > 0.0, the affine system will have the following discrete-time state update:

\[x(t+h) = A x(t) + B u(t) + f_0,\]

where h is the time_period. If time_period == 0.0, the affine system will have the following continuous-time state update:

\[\dot{x} = A x + B u + f_0.\]

In both cases, the system will have the output:

\[y = C x + D u + y_0,\]

See also

LinearSystem

See also

MatrixGain

__init__(self: pydrake.systems.primitives.AffineSystem_[float], A: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], B: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], f0: numpy.ndarray[numpy.float64[m, 1]], C: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], D: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], y0: numpy.ndarray[numpy.float64[m, 1]], time_period: float = 0.0) → None

Constructs an Affine system with a fixed set of coefficient matrices A, B,``C``, and D as well as fixed initial velocity offset xDot0 and output offset y0. The coefficient matrices must obey the following dimensions : | Matrix | Num Rows | Num Columns | |:-------:|:———–:|:-----------:| | A | num states | num states | | B | num states | num inputs | | C | num outputs | num states | | D | num outputs | num inputs |

Parameter time_period:
Defines the period of the discrete time system; use time_period=0.0 to denote a continuous time system. $*Default:* 0.0

Subclasses must use the protected constructor, not this one.

A(self: pydrake.systems.primitives.AffineSystem_[float]) → numpy.ndarray[numpy.float64[m, n]]

@name Helper getter methods.

B(self: pydrake.systems.primitives.AffineSystem_[float]) → numpy.ndarray[numpy.float64[m, n]]
C(self: pydrake.systems.primitives.AffineSystem_[float]) → numpy.ndarray[numpy.float64[m, n]]
configure_default_state(self: pydrake.systems.primitives.AffineSystem_[float], x0: numpy.ndarray[numpy.float64[m, 1]]) → None

Configures the value that will be assigned to the state vector in SetDefaultContext. x0 must be a vector of length num_states.

configure_random_state(self: pydrake.systems.primitives.AffineSystem_[float], covariance: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous]) → None

Configures the Gaussian distribution over state vectors used in the SetRandomContext methods. The mean of the distribution will be the default state (

See also

configure_default_state()). covariance must have size num_states by num_states and must be symmetric and positive semi-definite.

D(self: pydrake.systems.primitives.AffineSystem_[float]) → numpy.ndarray[numpy.float64[m, n]]
f0(self: pydrake.systems.primitives.AffineSystem_[float]) → numpy.ndarray[numpy.float64[m, 1]]
get_input_port(*args, **kwargs)

Overloaded function.

  1. get_input_port(self: pydrake.systems.primitives.AffineSystem_[float]) -> pydrake.systems.framework.InputPort_[float]

Returns the input port containing the externally applied input.

  1. get_input_port(self: pydrake.systems.primitives.AffineSystem_[float], port_index: int) -> pydrake.systems.framework.InputPort_[float]

Returns the typed input port at index port_index.

get_output_port(*args, **kwargs)

Overloaded function.

  1. get_output_port(self: pydrake.systems.primitives.AffineSystem_[float]) -> pydrake.systems.framework.OutputPort_[float]

Returns the output port containing the output state.

  1. get_output_port(self: pydrake.systems.primitives.AffineSystem_[float], port_index: int) -> pydrake.systems.framework.OutputPort_[float]

Returns the typed output port at index port_index.

time_period(self: pydrake.systems.primitives.AffineSystem_[float]) → float
y0(self: pydrake.systems.primitives.AffineSystem_[float]) → numpy.ndarray[numpy.float64[m, 1]]
class pydrake.systems.primitives.BarycentricMeshSystem

Bases: pydrake.systems.framework.LeafSystem_[float]

A (stateless) vector system implemented as a multi-linear (barycentric) interpolation on a mesh over the inputs.

This has many potential uses, including representing the policies that are generated by numerical control design methods like approximate dynamic programming.

See also

math::BarycentricMesh

__init__(self: pydrake.systems.primitives.BarycentricMeshSystem, arg0: pydrake.math.BarycentricMesh, arg1: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous]) → None

Constructs the system from a mesh and the associated mesh values. output_values is a matrix with each column representing the value to output if the input is the associated mesh point. It must have the same number of columns as mesh.get_num_mesh_points(); mesh.MeshValuesFrom(function) is one useful tool for creating it.

get_mesh(self: pydrake.systems.primitives.BarycentricMeshSystem) → pydrake.math.BarycentricMesh

Returns a reference to the mesh.

get_output_values(self: pydrake.systems.primitives.BarycentricMeshSystem) → numpy.ndarray[numpy.float64[m, n]]

Returns a reference to the output values.

pydrake.systems.primitives.ConstantValueSource

alias of pydrake.systems.primitives.ConstantValueSource_[float]

template pydrake.systems.primitives.ConstantValueSource_

Instantiations: ConstantValueSource_[float], ConstantValueSource_[AutoDiffXd], ConstantValueSource_[Expression]

class ConstantValueSource_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

A source block that always outputs a constant value.

__init__(self: pydrake.systems.primitives.ConstantValueSource_[float], value: pydrake.common.value.AbstractValue) → None
Parameter value:
The constant value to emit which is copied by this system.
class pydrake.systems.primitives.ConstantValueSource_[AutoDiffXd]

Bases: pydrake.systems.framework.LeafSystem_[AutoDiffXd]

A source block that always outputs a constant value.

__init__(self: pydrake.systems.primitives.ConstantValueSource_[AutoDiffXd], value: pydrake.common.value.AbstractValue) → None
Parameter value:
The constant value to emit which is copied by this system.
class pydrake.systems.primitives.ConstantValueSource_[Expression]

Bases: pydrake.systems.framework.LeafSystem_[Expression]

A source block that always outputs a constant value.

__init__(self: pydrake.systems.primitives.ConstantValueSource_[Expression], value: pydrake.common.value.AbstractValue) → None
Parameter value:
The constant value to emit which is copied by this system.
class pydrake.systems.primitives.ConstantValueSource_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

A source block that always outputs a constant value.

__init__(self: pydrake.systems.primitives.ConstantValueSource_[float], value: pydrake.common.value.AbstractValue) → None
Parameter value:
The constant value to emit which is copied by this system.
pydrake.systems.primitives.ConstantVectorSource

alias of pydrake.systems.primitives.ConstantVectorSource_[float]

template pydrake.systems.primitives.ConstantVectorSource_

Instantiations: ConstantVectorSource_[float], ConstantVectorSource_[AutoDiffXd], ConstantVectorSource_[Expression]

class ConstantVectorSource_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

A source block with a constant output port at all times. The value of the output port is a parameter of the system (see Parameters).

__init__(self: pydrake.systems.primitives.ConstantVectorSource_[float], source_value: numpy.ndarray[numpy.float64[m, 1]]) → None

Constructs a system with a vector output that is constant and equals the supplied source_value at all times.

Parameter source_value:
the constant value of the output so that y = source_value at all times.
get_mutable_source_value(self: pydrake.systems.primitives.ConstantVectorSource_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.systems.framework.BasicVector_[float]

Return a mutable reference to the source value of this block in the given context.

get_source_value(self: pydrake.systems.primitives.ConstantVectorSource_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.systems.framework.BasicVector_[float]

Return a read-only reference to the source value of this block in the given context.

class pydrake.systems.primitives.ConstantVectorSource_[AutoDiffXd]

Bases: pydrake.systems.framework.LeafSystem_[AutoDiffXd]

A source block with a constant output port at all times. The value of the output port is a parameter of the system (see Parameters).

__init__(self: pydrake.systems.primitives.ConstantVectorSource_[AutoDiffXd], source_value: numpy.ndarray[object[m, 1]]) → None

Constructs a system with a vector output that is constant and equals the supplied source_value at all times.

Parameter source_value:
the constant value of the output so that y = source_value at all times.
get_mutable_source_value(self: pydrake.systems.primitives.ConstantVectorSource_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.systems.framework.BasicVector_[AutoDiffXd]

Return a mutable reference to the source value of this block in the given context.

get_source_value(self: pydrake.systems.primitives.ConstantVectorSource_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd]) → pydrake.systems.framework.BasicVector_[AutoDiffXd]

Return a read-only reference to the source value of this block in the given context.

class pydrake.systems.primitives.ConstantVectorSource_[Expression]

Bases: pydrake.systems.framework.LeafSystem_[Expression]

A source block with a constant output port at all times. The value of the output port is a parameter of the system (see Parameters).

__init__(self: pydrake.systems.primitives.ConstantVectorSource_[Expression], source_value: numpy.ndarray[object[m, 1]]) → None

Constructs a system with a vector output that is constant and equals the supplied source_value at all times.

Parameter source_value:
the constant value of the output so that y = source_value at all times.
get_mutable_source_value(self: pydrake.systems.primitives.ConstantVectorSource_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.systems.framework.BasicVector_[Expression]

Return a mutable reference to the source value of this block in the given context.

get_source_value(self: pydrake.systems.primitives.ConstantVectorSource_[Expression], context: pydrake.systems.framework.Context_[Expression]) → pydrake.systems.framework.BasicVector_[Expression]

Return a read-only reference to the source value of this block in the given context.

class pydrake.systems.primitives.ConstantVectorSource_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

A source block with a constant output port at all times. The value of the output port is a parameter of the system (see Parameters).

__init__(self: pydrake.systems.primitives.ConstantVectorSource_[float], source_value: numpy.ndarray[numpy.float64[m, 1]]) → None

Constructs a system with a vector output that is constant and equals the supplied source_value at all times.

Parameter source_value:
the constant value of the output so that y = source_value at all times.
get_mutable_source_value(self: pydrake.systems.primitives.ConstantVectorSource_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.systems.framework.BasicVector_[float]

Return a mutable reference to the source value of this block in the given context.

get_source_value(self: pydrake.systems.primitives.ConstantVectorSource_[float], context: pydrake.systems.framework.Context_[float]) → pydrake.systems.framework.BasicVector_[float]

Return a read-only reference to the source value of this block in the given context.

pydrake.systems.primitives.ControllabilityMatrix(arg0: pydrake.systems.primitives.LinearSystem_[float]) → numpy.ndarray[numpy.float64[m, n]]

Returns the controllability matrix: R = [B, AB, …, A^{n-1}B].

pydrake.systems.primitives.Demultiplexer

alias of pydrake.systems.primitives.Demultiplexer_[float]

template pydrake.systems.primitives.Demultiplexer_

Instantiations: Demultiplexer_[float], Demultiplexer_[AutoDiffXd], Demultiplexer_[Expression]

class Demultiplexer_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

This system splits a vector valued signal on its input into multiple outputs.

The input to this system directly feeds through to its output.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.Demultiplexer_[float], size: int, output_ports_size: int = 1) -> None

Constructs Demultiplexer with one vector valued input port of size size and vector valued output ports of size output_ports_size.

Raises:
  • RuntimeError if output_ports_sizes can not exactly divide
  • size. The number of output ports is therefore ``size /
  • output_ports_size``.
Parameter size:
is the size of the input signal to be demultiplexed into its individual components.
Parameter output_ports_size:
The size of the output ports. size must be a multiple of output_ports_size.
  1. __init__(self: pydrake.systems.primitives.Demultiplexer_[float], output_ports_sizes: List[int]) -> None

Constructs Demultiplexer with one vector valued output ports with sizes specified as the vector output_ports_sizes. The number of output ports is the length of this vector. The size of each output port is the value of the corresponding element of the vector output_ports_sizes.

Raises:

RuntimeError if output_ports_sizes is a zero length vector.

Raises:
  • RuntimeError if any element of the output_ports_sizes is zero.
  • Therefore, the Demultiplexer does not allow zero size output
  • ports.
Parameter output_ports_sizes:
Contains the sizes of each output port. The number of output ports is determined by the length of output_ports_sizes. The accumulative value of the all the values in output_ports_sizes will be the size of the input port.
get_output_ports_sizes(self: pydrake.systems.primitives.Demultiplexer_[float]) → List[int]
class pydrake.systems.primitives.Demultiplexer_[AutoDiffXd]

Bases: pydrake.systems.framework.LeafSystem_[AutoDiffXd]

This system splits a vector valued signal on its input into multiple outputs.

The input to this system directly feeds through to its output.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.Demultiplexer_[AutoDiffXd], size: int, output_ports_size: int = 1) -> None

Constructs Demultiplexer with one vector valued input port of size size and vector valued output ports of size output_ports_size.

Raises:
  • RuntimeError if output_ports_sizes can not exactly divide
  • size. The number of output ports is therefore ``size /
  • output_ports_size``.
Parameter size:
is the size of the input signal to be demultiplexed into its individual components.
Parameter output_ports_size:
The size of the output ports. size must be a multiple of output_ports_size.
  1. __init__(self: pydrake.systems.primitives.Demultiplexer_[AutoDiffXd], output_ports_sizes: List[int]) -> None

Constructs Demultiplexer with one vector valued output ports with sizes specified as the vector output_ports_sizes. The number of output ports is the length of this vector. The size of each output port is the value of the corresponding element of the vector output_ports_sizes.

Raises:

RuntimeError if output_ports_sizes is a zero length vector.

Raises:
  • RuntimeError if any element of the output_ports_sizes is zero.
  • Therefore, the Demultiplexer does not allow zero size output
  • ports.
Parameter output_ports_sizes:
Contains the sizes of each output port. The number of output ports is determined by the length of output_ports_sizes. The accumulative value of the all the values in output_ports_sizes will be the size of the input port.
get_output_ports_sizes(self: pydrake.systems.primitives.Demultiplexer_[AutoDiffXd]) → List[int]
class pydrake.systems.primitives.Demultiplexer_[Expression]

Bases: pydrake.systems.framework.LeafSystem_[Expression]

This system splits a vector valued signal on its input into multiple outputs.

The input to this system directly feeds through to its output.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.Demultiplexer_[Expression], size: int, output_ports_size: int = 1) -> None

Constructs Demultiplexer with one vector valued input port of size size and vector valued output ports of size output_ports_size.

Raises:
  • RuntimeError if output_ports_sizes can not exactly divide
  • size. The number of output ports is therefore ``size /
  • output_ports_size``.
Parameter size:
is the size of the input signal to be demultiplexed into its individual components.
Parameter output_ports_size:
The size of the output ports. size must be a multiple of output_ports_size.
  1. __init__(self: pydrake.systems.primitives.Demultiplexer_[Expression], output_ports_sizes: List[int]) -> None

Constructs Demultiplexer with one vector valued output ports with sizes specified as the vector output_ports_sizes. The number of output ports is the length of this vector. The size of each output port is the value of the corresponding element of the vector output_ports_sizes.

Raises:

RuntimeError if output_ports_sizes is a zero length vector.

Raises:
  • RuntimeError if any element of the output_ports_sizes is zero.
  • Therefore, the Demultiplexer does not allow zero size output
  • ports.
Parameter output_ports_sizes:
Contains the sizes of each output port. The number of output ports is determined by the length of output_ports_sizes. The accumulative value of the all the values in output_ports_sizes will be the size of the input port.
get_output_ports_sizes(self: pydrake.systems.primitives.Demultiplexer_[Expression]) → List[int]
class pydrake.systems.primitives.Demultiplexer_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

This system splits a vector valued signal on its input into multiple outputs.

The input to this system directly feeds through to its output.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.Demultiplexer_[float], size: int, output_ports_size: int = 1) -> None

Constructs Demultiplexer with one vector valued input port of size size and vector valued output ports of size output_ports_size.

Raises:
  • RuntimeError if output_ports_sizes can not exactly divide
  • size. The number of output ports is therefore ``size /
  • output_ports_size``.
Parameter size:
is the size of the input signal to be demultiplexed into its individual components.
Parameter output_ports_size:
The size of the output ports. size must be a multiple of output_ports_size.
  1. __init__(self: pydrake.systems.primitives.Demultiplexer_[float], output_ports_sizes: List[int]) -> None

Constructs Demultiplexer with one vector valued output ports with sizes specified as the vector output_ports_sizes. The number of output ports is the length of this vector. The size of each output port is the value of the corresponding element of the vector output_ports_sizes.

Raises:

RuntimeError if output_ports_sizes is a zero length vector.

Raises:
  • RuntimeError if any element of the output_ports_sizes is zero.
  • Therefore, the Demultiplexer does not allow zero size output
  • ports.
Parameter output_ports_sizes:
Contains the sizes of each output port. The number of output ports is determined by the length of output_ports_sizes. The accumulative value of the all the values in output_ports_sizes will be the size of the input port.
get_output_ports_sizes(self: pydrake.systems.primitives.Demultiplexer_[float]) → List[int]
pydrake.systems.primitives.DiscreteDerivative

alias of pydrake.systems.primitives.DiscreteDerivative_[float]

template pydrake.systems.primitives.DiscreteDerivative_

Instantiations: DiscreteDerivative_[float], DiscreteDerivative_[AutoDiffXd], DiscreteDerivative_[Expression]

class DiscreteDerivative_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

System that outputs the discrete-time derivative of its input: y(t) = (u[n] - u[n-1])/h, where n = floor(t/h), where h is the time period.

This is implemented as the linear system

x₀[n+1] = u[n],
  x₁[n+1] = x₀[n],
  y(t) = (x₀[n]-x₁[n])/h.
  x₀[0] and x₁[0] are initialized in the Context (default is zeros).

Alternatively, when suppress_initial_transient = true is passed to the constructor, the output remains zero until u[n] has been sampled twice.

This is implemented as the non-linear system

x₀[n+1] = u[n],
  x₁[n+1] = x₀[n],
  x₂[n+1] = x₂[n] + 1,
  y(t) = { 0.0              if x₂ <  2 }
         { (x₀[n]-x₁[n])/h  if x₂ >= 2 }
  x₀[0], x₁[0], x₂[0] are initialized in the Context (default is zeros).

Note

For dynamical systems, a derivative should not be computed in continuous-time, i.e. y(t) = (u(t) - u[n])/(t-n*h). This is numerically unstable since the time interval t-n*h could be arbitrarily close to zero. Prefer the discrete-time implementation for robustness.

u→
DiscreteDerivative
→ dudt
__init__(self: pydrake.systems.primitives.DiscreteDerivative_[float], num_inputs: int, time_step: float, suppress_initial_transient: bool = False) → None

Constructor taking num_inputs, the size of the vector to be differentiated, and time_step, the sampling interval.

suppress_initial_transient(self: pydrake.systems.primitives.DiscreteDerivative_[float]) → bool

Returns the suppress_initial_transient passed to the constructor.

time_step(self: pydrake.systems.primitives.DiscreteDerivative_[float]) → float
class pydrake.systems.primitives.DiscreteDerivative_[AutoDiffXd]

Bases: pydrake.systems.framework.LeafSystem_[AutoDiffXd]

System that outputs the discrete-time derivative of its input: y(t) = (u[n] - u[n-1])/h, where n = floor(t/h), where h is the time period.

This is implemented as the linear system

x₀[n+1] = u[n],
  x₁[n+1] = x₀[n],
  y(t) = (x₀[n]-x₁[n])/h.
  x₀[0] and x₁[0] are initialized in the Context (default is zeros).

Alternatively, when suppress_initial_transient = true is passed to the constructor, the output remains zero until u[n] has been sampled twice.

This is implemented as the non-linear system

x₀[n+1] = u[n],
  x₁[n+1] = x₀[n],
  x₂[n+1] = x₂[n] + 1,
  y(t) = { 0.0              if x₂ <  2 }
         { (x₀[n]-x₁[n])/h  if x₂ >= 2 }
  x₀[0], x₁[0], x₂[0] are initialized in the Context (default is zeros).

Note

For dynamical systems, a derivative should not be computed in continuous-time, i.e. y(t) = (u(t) - u[n])/(t-n*h). This is numerically unstable since the time interval t-n*h could be arbitrarily close to zero. Prefer the discrete-time implementation for robustness.

u→
DiscreteDerivative
→ dudt
__init__(self: pydrake.systems.primitives.DiscreteDerivative_[AutoDiffXd], num_inputs: int, time_step: float, suppress_initial_transient: bool = False) → None

Constructor taking num_inputs, the size of the vector to be differentiated, and time_step, the sampling interval.

suppress_initial_transient(self: pydrake.systems.primitives.DiscreteDerivative_[AutoDiffXd]) → bool

Returns the suppress_initial_transient passed to the constructor.

time_step(self: pydrake.systems.primitives.DiscreteDerivative_[AutoDiffXd]) → float
class pydrake.systems.primitives.DiscreteDerivative_[Expression]

Bases: pydrake.systems.framework.LeafSystem_[Expression]

System that outputs the discrete-time derivative of its input: y(t) = (u[n] - u[n-1])/h, where n = floor(t/h), where h is the time period.

This is implemented as the linear system

x₀[n+1] = u[n],
  x₁[n+1] = x₀[n],
  y(t) = (x₀[n]-x₁[n])/h.
  x₀[0] and x₁[0] are initialized in the Context (default is zeros).

Alternatively, when suppress_initial_transient = true is passed to the constructor, the output remains zero until u[n] has been sampled twice.

This is implemented as the non-linear system

x₀[n+1] = u[n],
  x₁[n+1] = x₀[n],
  x₂[n+1] = x₂[n] + 1,
  y(t) = { 0.0              if x₂ <  2 }
         { (x₀[n]-x₁[n])/h  if x₂ >= 2 }
  x₀[0], x₁[0], x₂[0] are initialized in the Context (default is zeros).

Note

For dynamical systems, a derivative should not be computed in continuous-time, i.e. y(t) = (u(t) - u[n])/(t-n*h). This is numerically unstable since the time interval t-n*h could be arbitrarily close to zero. Prefer the discrete-time implementation for robustness.

u→
DiscreteDerivative
→ dudt
__init__(self: pydrake.systems.primitives.DiscreteDerivative_[Expression], num_inputs: int, time_step: float, suppress_initial_transient: bool = False) → None

Constructor taking num_inputs, the size of the vector to be differentiated, and time_step, the sampling interval.

suppress_initial_transient(self: pydrake.systems.primitives.DiscreteDerivative_[Expression]) → bool

Returns the suppress_initial_transient passed to the constructor.

time_step(self: pydrake.systems.primitives.DiscreteDerivative_[Expression]) → float
class pydrake.systems.primitives.DiscreteDerivative_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

System that outputs the discrete-time derivative of its input: y(t) = (u[n] - u[n-1])/h, where n = floor(t/h), where h is the time period.

This is implemented as the linear system

x₀[n+1] = u[n],
  x₁[n+1] = x₀[n],
  y(t) = (x₀[n]-x₁[n])/h.
  x₀[0] and x₁[0] are initialized in the Context (default is zeros).

Alternatively, when suppress_initial_transient = true is passed to the constructor, the output remains zero until u[n] has been sampled twice.

This is implemented as the non-linear system

x₀[n+1] = u[n],
  x₁[n+1] = x₀[n],
  x₂[n+1] = x₂[n] + 1,
  y(t) = { 0.0              if x₂ <  2 }
         { (x₀[n]-x₁[n])/h  if x₂ >= 2 }
  x₀[0], x₁[0], x₂[0] are initialized in the Context (default is zeros).

Note

For dynamical systems, a derivative should not be computed in continuous-time, i.e. y(t) = (u(t) - u[n])/(t-n*h). This is numerically unstable since the time interval t-n*h could be arbitrarily close to zero. Prefer the discrete-time implementation for robustness.

u→
DiscreteDerivative
→ dudt
__init__(self: pydrake.systems.primitives.DiscreteDerivative_[float], num_inputs: int, time_step: float, suppress_initial_transient: bool = False) → None

Constructor taking num_inputs, the size of the vector to be differentiated, and time_step, the sampling interval.

suppress_initial_transient(self: pydrake.systems.primitives.DiscreteDerivative_[float]) → bool

Returns the suppress_initial_transient passed to the constructor.

time_step(self: pydrake.systems.primitives.DiscreteDerivative_[float]) → float
pydrake.systems.primitives.DiscreteTimeDelay

alias of pydrake.systems.primitives.DiscreteTimeDelay_[float]

template pydrake.systems.primitives.DiscreteTimeDelay_

Instantiations: DiscreteTimeDelay_[float], DiscreteTimeDelay_[AutoDiffXd], DiscreteTimeDelay_[Expression]

class DiscreteTimeDelay_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

A discrete time delay block with input u, which is vector-valued (discrete or continuous) or abstract, and output delayed_u which is previously received input, delayed by the given amount. The initial output will be a vector of zeros for vector-valued or a given value for abstract-valued until the delay time has passed.

u→
DiscreteTimeDelay
→ delayed_u

Let t,z ∈ ℕ be the number of delay time steps and the input vector size. For abstract-valued DiscreteTimeDelay, z is 1. The state x ∈ ℝ⁽ᵗ⁺¹⁾ᶻ is partitioned into t+1 blocks x[0] x[1] … x[t], each of size z. The input and output are u,y ∈ ℝᶻ. The discrete state space dynamics of DiscreteTimeDelay is:

xₙ₊₁ = xₙ[1] xₙ[2] ... xₙ[t] uₙ  // update
  yₙ = xₙ[0]                       // output
  x₀ = xᵢₙᵢₜ                       // initialize

where xᵢₙᵢₜ = 0 for vector-valued DiscreteTimeDelay and xᵢₙᵢₜ is a given value for abstract-valued DiscreteTimeDelay.

See discrete_systems “Discrete Systems” for general information about discrete systems in Drake, including how they interact with continuous systems.

Note

While the output port can be sampled at any continuous time, this system does not interpolate.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.DiscreteTimeDelay_[float], update_sec: float, delay_timesteps: int, vector_size: int) -> None

Constructs a DiscreteTimeDelay system updating every update_sec and delaying a vector-valued input of size vector_size for delay_timesteps number of updates.

  1. __init__(self: pydrake.systems.primitives.DiscreteTimeDelay_[float], update_sec: float, delay_timesteps: int, abstract_model_value: pydrake.common.value.AbstractValue) -> None

Constructs a DiscreteTimeDelay system updating every update_sec and delaying an abstract-valued input of type abstract_model_value for delay_timesteps number of updates.

class pydrake.systems.primitives.DiscreteTimeDelay_[AutoDiffXd]

Bases: pydrake.systems.framework.LeafSystem_[AutoDiffXd]

A discrete time delay block with input u, which is vector-valued (discrete or continuous) or abstract, and output delayed_u which is previously received input, delayed by the given amount. The initial output will be a vector of zeros for vector-valued or a given value for abstract-valued until the delay time has passed.

u→
DiscreteTimeDelay
→ delayed_u

Let t,z ∈ ℕ be the number of delay time steps and the input vector size. For abstract-valued DiscreteTimeDelay, z is 1. The state x ∈ ℝ⁽ᵗ⁺¹⁾ᶻ is partitioned into t+1 blocks x[0] x[1] … x[t], each of size z. The input and output are u,y ∈ ℝᶻ. The discrete state space dynamics of DiscreteTimeDelay is:

xₙ₊₁ = xₙ[1] xₙ[2] ... xₙ[t] uₙ  // update
  yₙ = xₙ[0]                       // output
  x₀ = xᵢₙᵢₜ                       // initialize

where xᵢₙᵢₜ = 0 for vector-valued DiscreteTimeDelay and xᵢₙᵢₜ is a given value for abstract-valued DiscreteTimeDelay.

See discrete_systems “Discrete Systems” for general information about discrete systems in Drake, including how they interact with continuous systems.

Note

While the output port can be sampled at any continuous time, this system does not interpolate.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.DiscreteTimeDelay_[AutoDiffXd], update_sec: float, delay_timesteps: int, vector_size: int) -> None

Constructs a DiscreteTimeDelay system updating every update_sec and delaying a vector-valued input of size vector_size for delay_timesteps number of updates.

  1. __init__(self: pydrake.systems.primitives.DiscreteTimeDelay_[AutoDiffXd], update_sec: float, delay_timesteps: int, abstract_model_value: pydrake.common.value.AbstractValue) -> None

Constructs a DiscreteTimeDelay system updating every update_sec and delaying an abstract-valued input of type abstract_model_value for delay_timesteps number of updates.

class pydrake.systems.primitives.DiscreteTimeDelay_[Expression]

Bases: pydrake.systems.framework.LeafSystem_[Expression]

A discrete time delay block with input u, which is vector-valued (discrete or continuous) or abstract, and output delayed_u which is previously received input, delayed by the given amount. The initial output will be a vector of zeros for vector-valued or a given value for abstract-valued until the delay time has passed.

u→
DiscreteTimeDelay
→ delayed_u

Let t,z ∈ ℕ be the number of delay time steps and the input vector size. For abstract-valued DiscreteTimeDelay, z is 1. The state x ∈ ℝ⁽ᵗ⁺¹⁾ᶻ is partitioned into t+1 blocks x[0] x[1] … x[t], each of size z. The input and output are u,y ∈ ℝᶻ. The discrete state space dynamics of DiscreteTimeDelay is:

xₙ₊₁ = xₙ[1] xₙ[2] ... xₙ[t] uₙ  // update
  yₙ = xₙ[0]                       // output
  x₀ = xᵢₙᵢₜ                       // initialize

where xᵢₙᵢₜ = 0 for vector-valued DiscreteTimeDelay and xᵢₙᵢₜ is a given value for abstract-valued DiscreteTimeDelay.

See discrete_systems “Discrete Systems” for general information about discrete systems in Drake, including how they interact with continuous systems.

Note

While the output port can be sampled at any continuous time, this system does not interpolate.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.DiscreteTimeDelay_[Expression], update_sec: float, delay_timesteps: int, vector_size: int) -> None

Constructs a DiscreteTimeDelay system updating every update_sec and delaying a vector-valued input of size vector_size for delay_timesteps number of updates.

  1. __init__(self: pydrake.systems.primitives.DiscreteTimeDelay_[Expression], update_sec: float, delay_timesteps: int, abstract_model_value: pydrake.common.value.AbstractValue) -> None

Constructs a DiscreteTimeDelay system updating every update_sec and delaying an abstract-valued input of type abstract_model_value for delay_timesteps number of updates.

class pydrake.systems.primitives.DiscreteTimeDelay_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

A discrete time delay block with input u, which is vector-valued (discrete or continuous) or abstract, and output delayed_u which is previously received input, delayed by the given amount. The initial output will be a vector of zeros for vector-valued or a given value for abstract-valued until the delay time has passed.

u→
DiscreteTimeDelay
→ delayed_u

Let t,z ∈ ℕ be the number of delay time steps and the input vector size. For abstract-valued DiscreteTimeDelay, z is 1. The state x ∈ ℝ⁽ᵗ⁺¹⁾ᶻ is partitioned into t+1 blocks x[0] x[1] … x[t], each of size z. The input and output are u,y ∈ ℝᶻ. The discrete state space dynamics of DiscreteTimeDelay is:

xₙ₊₁ = xₙ[1] xₙ[2] ... xₙ[t] uₙ  // update
  yₙ = xₙ[0]                       // output
  x₀ = xᵢₙᵢₜ                       // initialize

where xᵢₙᵢₜ = 0 for vector-valued DiscreteTimeDelay and xᵢₙᵢₜ is a given value for abstract-valued DiscreteTimeDelay.

See discrete_systems “Discrete Systems” for general information about discrete systems in Drake, including how they interact with continuous systems.

Note

While the output port can be sampled at any continuous time, this system does not interpolate.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.DiscreteTimeDelay_[float], update_sec: float, delay_timesteps: int, vector_size: int) -> None

Constructs a DiscreteTimeDelay system updating every update_sec and delaying a vector-valued input of size vector_size for delay_timesteps number of updates.

  1. __init__(self: pydrake.systems.primitives.DiscreteTimeDelay_[float], update_sec: float, delay_timesteps: int, abstract_model_value: pydrake.common.value.AbstractValue) -> None

Constructs a DiscreteTimeDelay system updating every update_sec and delaying an abstract-valued input of type abstract_model_value for delay_timesteps number of updates.

pydrake.systems.primitives.FirstOrderLowPassFilter

alias of pydrake.systems.primitives.FirstOrderLowPassFilter_[float]

template pydrake.systems.primitives.FirstOrderLowPassFilter_

Instantiations: FirstOrderLowPassFilter_[float], FirstOrderLowPassFilter_[AutoDiffXd], FirstOrderLowPassFilter_[Expression]

class FirstOrderLowPassFilter_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

An element-wise first order low pass filter system that filters the i-th input uᵢ into the i-th output zᵢ. This system has one continuous state per filtered input signal. Therefore, the i-th state of the system zᵢ evolves according to:

żᵢ = -1/τᵢ (zᵢ - uᵢ)

where τᵢ is the time constant of the i-th filter. The i-th output of the system is given by:

yᵢ = zᵢ

The transfer function for the i-th filter corresponds to:

H(s) = 1 / (1 + τᵢ s)

The Bode plot for the i-th filter exhibits a cutoff frequency (angular frequency) at 1/τᵢ and a gain of one. For frequencies higher than the cutoff frequency, the Bode plot approaches a 20 dB per decade negative slope. The Bode plot in phase exhibits a -90 degrees shift (lag) for frequencies much larger than the cutoff frequency and a zero shift for low frequencies.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[float], time_constant: float, size: int = 1) -> None

Constructs a FirstOrderLowPassFilter system that filters all input signals with the same time constant, i.e. τᵢ = τ, ∀ i.

Parameter time_constant:
the time constant τ of the filter. It must be a positive number.
Parameter size:
number of elements in the signal to be processed.
  1. __init__(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[float], time_constants: numpy.ndarray[numpy.float64[m, 1]]) -> None

Constructs a FirstOrderLowPassFilter so that the i-th component of the input signal vector is low pass filtered with a time constant given in the i-th component τᵢ of the input time_constants vector.

Parameter time_constants:
Vector of time constants. Each entry in this vector must be positive.
get_time_constant(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[float]) → float

Returns the time constant of the filter for filters that have the same time constant τ for all signals. This method aborts if called on filters if with different time constants per input signal.

See also

get_time_constants_vector().

get_time_constants_vector(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[float]) → numpy.ndarray[numpy.float64[m, 1]]

Returns the vector of time constants for this filter.

set_initial_output_value(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[float], arg0: pydrake.systems.framework.Context_[float], arg1: numpy.ndarray[numpy.float64[m, 1]]) → None

Sets the initial conditions on the output value of the filtered signal.

Parameter context:
The current system context.
Parameter z0:
The vector on initial conditions on the output value.
class pydrake.systems.primitives.FirstOrderLowPassFilter_[AutoDiffXd]

Bases: pydrake.systems.framework.LeafSystem_[AutoDiffXd]

An element-wise first order low pass filter system that filters the i-th input uᵢ into the i-th output zᵢ. This system has one continuous state per filtered input signal. Therefore, the i-th state of the system zᵢ evolves according to:

żᵢ = -1/τᵢ (zᵢ - uᵢ)

where τᵢ is the time constant of the i-th filter. The i-th output of the system is given by:

yᵢ = zᵢ

The transfer function for the i-th filter corresponds to:

H(s) = 1 / (1 + τᵢ s)

The Bode plot for the i-th filter exhibits a cutoff frequency (angular frequency) at 1/τᵢ and a gain of one. For frequencies higher than the cutoff frequency, the Bode plot approaches a 20 dB per decade negative slope. The Bode plot in phase exhibits a -90 degrees shift (lag) for frequencies much larger than the cutoff frequency and a zero shift for low frequencies.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[AutoDiffXd], time_constant: float, size: int = 1) -> None

Constructs a FirstOrderLowPassFilter system that filters all input signals with the same time constant, i.e. τᵢ = τ, ∀ i.

Parameter time_constant:
the time constant τ of the filter. It must be a positive number.
Parameter size:
number of elements in the signal to be processed.
  1. __init__(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[AutoDiffXd], time_constants: numpy.ndarray[numpy.float64[m, 1]]) -> None

Constructs a FirstOrderLowPassFilter so that the i-th component of the input signal vector is low pass filtered with a time constant given in the i-th component τᵢ of the input time_constants vector.

Parameter time_constants:
Vector of time constants. Each entry in this vector must be positive.
get_time_constant(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[AutoDiffXd]) → float

Returns the time constant of the filter for filters that have the same time constant τ for all signals. This method aborts if called on filters if with different time constants per input signal.

See also

get_time_constants_vector().

get_time_constants_vector(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[AutoDiffXd]) → numpy.ndarray[numpy.float64[m, 1]]

Returns the vector of time constants for this filter.

set_initial_output_value(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[AutoDiffXd], arg0: pydrake.systems.framework.Context_[AutoDiffXd], arg1: numpy.ndarray[object[m, 1]]) → None

Sets the initial conditions on the output value of the filtered signal.

Parameter context:
The current system context.
Parameter z0:
The vector on initial conditions on the output value.
class pydrake.systems.primitives.FirstOrderLowPassFilter_[Expression]

Bases: pydrake.systems.framework.LeafSystem_[Expression]

An element-wise first order low pass filter system that filters the i-th input uᵢ into the i-th output zᵢ. This system has one continuous state per filtered input signal. Therefore, the i-th state of the system zᵢ evolves according to:

żᵢ = -1/τᵢ (zᵢ - uᵢ)

where τᵢ is the time constant of the i-th filter. The i-th output of the system is given by:

yᵢ = zᵢ

The transfer function for the i-th filter corresponds to:

H(s) = 1 / (1 + τᵢ s)

The Bode plot for the i-th filter exhibits a cutoff frequency (angular frequency) at 1/τᵢ and a gain of one. For frequencies higher than the cutoff frequency, the Bode plot approaches a 20 dB per decade negative slope. The Bode plot in phase exhibits a -90 degrees shift (lag) for frequencies much larger than the cutoff frequency and a zero shift for low frequencies.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[Expression], time_constant: float, size: int = 1) -> None

Constructs a FirstOrderLowPassFilter system that filters all input signals with the same time constant, i.e. τᵢ = τ, ∀ i.

Parameter time_constant:
the time constant τ of the filter. It must be a positive number.
Parameter size:
number of elements in the signal to be processed.
  1. __init__(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[Expression], time_constants: numpy.ndarray[numpy.float64[m, 1]]) -> None

Constructs a FirstOrderLowPassFilter so that the i-th component of the input signal vector is low pass filtered with a time constant given in the i-th component τᵢ of the input time_constants vector.

Parameter time_constants:
Vector of time constants. Each entry in this vector must be positive.
get_time_constant(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[Expression]) → float

Returns the time constant of the filter for filters that have the same time constant τ for all signals. This method aborts if called on filters if with different time constants per input signal.

See also

get_time_constants_vector().

get_time_constants_vector(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[Expression]) → numpy.ndarray[numpy.float64[m, 1]]

Returns the vector of time constants for this filter.

set_initial_output_value(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[Expression], arg0: pydrake.systems.framework.Context_[Expression], arg1: numpy.ndarray[object[m, 1]]) → None

Sets the initial conditions on the output value of the filtered signal.

Parameter context:
The current system context.
Parameter z0:
The vector on initial conditions on the output value.
class pydrake.systems.primitives.FirstOrderLowPassFilter_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

An element-wise first order low pass filter system that filters the i-th input uᵢ into the i-th output zᵢ. This system has one continuous state per filtered input signal. Therefore, the i-th state of the system zᵢ evolves according to:

żᵢ = -1/τᵢ (zᵢ - uᵢ)

where τᵢ is the time constant of the i-th filter. The i-th output of the system is given by:

yᵢ = zᵢ

The transfer function for the i-th filter corresponds to:

H(s) = 1 / (1 + τᵢ s)

The Bode plot for the i-th filter exhibits a cutoff frequency (angular frequency) at 1/τᵢ and a gain of one. For frequencies higher than the cutoff frequency, the Bode plot approaches a 20 dB per decade negative slope. The Bode plot in phase exhibits a -90 degrees shift (lag) for frequencies much larger than the cutoff frequency and a zero shift for low frequencies.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[float], time_constant: float, size: int = 1) -> None

Constructs a FirstOrderLowPassFilter system that filters all input signals with the same time constant, i.e. τᵢ = τ, ∀ i.

Parameter time_constant:
the time constant τ of the filter. It must be a positive number.
Parameter size:
number of elements in the signal to be processed.
  1. __init__(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[float], time_constants: numpy.ndarray[numpy.float64[m, 1]]) -> None

Constructs a FirstOrderLowPassFilter so that the i-th component of the input signal vector is low pass filtered with a time constant given in the i-th component τᵢ of the input time_constants vector.

Parameter time_constants:
Vector of time constants. Each entry in this vector must be positive.
get_time_constant(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[float]) → float

Returns the time constant of the filter for filters that have the same time constant τ for all signals. This method aborts if called on filters if with different time constants per input signal.

See also

get_time_constants_vector().

get_time_constants_vector(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[float]) → numpy.ndarray[numpy.float64[m, 1]]

Returns the vector of time constants for this filter.

set_initial_output_value(self: pydrake.systems.primitives.FirstOrderLowPassFilter_[float], arg0: pydrake.systems.framework.Context_[float], arg1: numpy.ndarray[numpy.float64[m, 1]]) → None

Sets the initial conditions on the output value of the filtered signal.

Parameter context:
The current system context.
Parameter z0:
The vector on initial conditions on the output value.
pydrake.systems.primitives.FirstOrderTaylorApproximation(system: pydrake.systems.framework.System_[float], context: pydrake.systems.framework.Context_[float], input_port_index: Union[pydrake.systems.framework.InputPortSelection, pydrake.systems.framework.InputPortIndex] = InputPortSelection.kUseFirstInputIfItExists, output_port_index: Union[pydrake.systems.framework.OutputPortSelection, pydrake.systems.framework.OutputPortIndex] = OutputPortSelection.kUseFirstOutputIfItExists) → pydrake.systems.primitives.AffineSystem_[float]

A first-order Taylor series approximation to a system in the neighborhood of an arbitrary point. When Taylor-expanding a system at a non-equilibrium 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).

Parameter system:
The system or subsystem to linearize.
Parameter context:
Defines the nominal operating point about which the system should be linearized.
Parameter input_port_index:
A valid input port index for system or InputPortSelection. $*Default:* kUseFirstInputIfItExists.
Parameter output_port_index:
A valid output port index for system or OutputPortSelection. $*Default:* kUseFirstOutputIfItExists.
Returns:

An AffineSystem at this linearization point.

Raises:
  • if any abstract inputs are connected, if any vector-valued inputs
  • are unconnected, if the system is not (only) continuous or not
  • (only) discrete time with a single periodic update.

Note

x, u and y are in the same coordinate system as the original system, since the terms involving \(x_0, u_0\) reside in \(f_0\).

Note

This method does not (yet) set the initial conditions (default nor random) of the AffineSystem based on system.

pydrake.systems.primitives.Gain

alias of pydrake.systems.primitives.Gain_[float]

template pydrake.systems.primitives.Gain_

Instantiations: Gain_[float], Gain_[AutoDiffXd], Gain_[Expression]

class Gain_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

An element-wise gain block with input u and output y = k * u with k a constant vector. The input to this system directly feeds through to its output.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.Gain_[float], k: float, size: int) -> None

Constructs a Gain system where the same gain is applied to every input value.

Parameter k:
the gain constant so that y = k * u.
Parameter size:
number of elements in the signal to be processed.
  1. __init__(self: pydrake.systems.primitives.Gain_[float], k: numpy.ndarray[numpy.float64[m, 1]]) -> None

Constructs a Gain system where different gains can be applied to each input value.

Parameter k:
the gain vector constants so that y_i = k_i * u_i where subscript i indicates the i-th element of the vector.
class pydrake.systems.primitives.Gain_[AutoDiffXd]

Bases: pydrake.systems.framework.LeafSystem_[AutoDiffXd]

An element-wise gain block with input u and output y = k * u with k a constant vector. The input to this system directly feeds through to its output.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.Gain_[AutoDiffXd], k: float, size: int) -> None

Constructs a Gain system where the same gain is applied to every input value.

Parameter k:
the gain constant so that y = k * u.
Parameter size:
number of elements in the signal to be processed.
  1. __init__(self: pydrake.systems.primitives.Gain_[AutoDiffXd], k: numpy.ndarray[numpy.float64[m, 1]]) -> None

Constructs a Gain system where different gains can be applied to each input value.

Parameter k:
the gain vector constants so that y_i = k_i * u_i where subscript i indicates the i-th element of the vector.
class pydrake.systems.primitives.Gain_[Expression]

Bases: pydrake.systems.framework.LeafSystem_[Expression]

An element-wise gain block with input u and output y = k * u with k a constant vector. The input to this system directly feeds through to its output.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.Gain_[Expression], k: float, size: int) -> None

Constructs a Gain system where the same gain is applied to every input value.

Parameter k:
the gain constant so that y = k * u.
Parameter size:
number of elements in the signal to be processed.
  1. __init__(self: pydrake.systems.primitives.Gain_[Expression], k: numpy.ndarray[numpy.float64[m, 1]]) -> None

Constructs a Gain system where different gains can be applied to each input value.

Parameter k:
the gain vector constants so that y_i = k_i * u_i where subscript i indicates the i-th element of the vector.
class pydrake.systems.primitives.Gain_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

An element-wise gain block with input u and output y = k * u with k a constant vector. The input to this system directly feeds through to its output.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.Gain_[float], k: float, size: int) -> None

Constructs a Gain system where the same gain is applied to every input value.

Parameter k:
the gain constant so that y = k * u.
Parameter size:
number of elements in the signal to be processed.
  1. __init__(self: pydrake.systems.primitives.Gain_[float], k: numpy.ndarray[numpy.float64[m, 1]]) -> None

Constructs a Gain system where different gains can be applied to each input value.

Parameter k:
the gain vector constants so that y_i = k_i * u_i where subscript i indicates the i-th element of the vector.
pydrake.systems.primitives.Integrator

alias of pydrake.systems.primitives.Integrator_[float]

template pydrake.systems.primitives.Integrator_

Instantiations: Integrator_[float], Integrator_[AutoDiffXd], Integrator_[Expression]

class Integrator_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

An integrator for a continuous vector input.

__init__(self: pydrake.systems.primitives.Integrator_[float], arg0: int) → None

Constructs an Integrator system.

Parameter size:
number of elements in the signal to be processed.
class pydrake.systems.primitives.Integrator_[AutoDiffXd]

Bases: pydrake.systems.framework.LeafSystem_[AutoDiffXd]

An integrator for a continuous vector input.

__init__(self: pydrake.systems.primitives.Integrator_[AutoDiffXd], arg0: int) → None

Constructs an Integrator system.

Parameter size:
number of elements in the signal to be processed.
class pydrake.systems.primitives.Integrator_[Expression]

Bases: pydrake.systems.framework.LeafSystem_[Expression]

An integrator for a continuous vector input.

__init__(self: pydrake.systems.primitives.Integrator_[Expression], arg0: int) → None

Constructs an Integrator system.

Parameter size:
number of elements in the signal to be processed.
class pydrake.systems.primitives.Integrator_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

An integrator for a continuous vector input.

__init__(self: pydrake.systems.primitives.Integrator_[float], arg0: int) → None

Constructs an Integrator system.

Parameter size:
number of elements in the signal to be processed.
pydrake.systems.primitives.IsControllable(sys: pydrake.systems.primitives.LinearSystem_[float], threshold: Optional[float] = None) → bool

Returns true iff the controllability matrix is full row rank.

pydrake.systems.primitives.IsObservable(sys: pydrake.systems.primitives.LinearSystem_[float], threshold: Optional[float] = None) → bool

Returns true iff the observability matrix is full column rank.

pydrake.systems.primitives.Linearize(system: pydrake.systems.framework.System_[float], context: pydrake.systems.framework.Context_[float], input_port_index: Union[pydrake.systems.framework.InputPortSelection, pydrake.systems.framework.InputPortIndex] = InputPortSelection.kUseFirstInputIfItExists, output_port_index: Union[pydrake.systems.framework.OutputPortSelection, pydrake.systems.framework.OutputPortIndex] = OutputPortSelection.kUseFirstOutputIfItExists, equilibrium_check_tolerance: float = 1e-06) → pydrake.systems.primitives.LinearSystem_[float]

Takes the first-order 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). Abstract-valued input ports must be unconnected (i.e., the system must treat the port as optional and it must be unused).

Parameter system:
The system or subsystem to linearize.
Parameter context:
Defines the nominal operating point about which the system should be linearized. See note below.
Parameter 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.
Parameter output_port_index:
A valid output port index for system or an OutputPortSelection. $*Default:* kUseFirstOutputIfItExists.
Parameter equilibrium_check_tolerance:
Specifies the tolerance on ensuring that the derivative vector isZero at the nominal operating point. $*Default:* 1e-6.
Returns:

A LinearSystem that approximates the original system in the vicinity of the operating point. See note below.

Raises:
  • RuntimeError if the operating point is not an equilibrium point of
  • the system (within the specified tolerance)
Raises:
  • RuntimeError if the system is not (only) continuous or (only)
  • discrete time with a single periodic update.

Note

All vector inputs in the system must be connected, either to the output of some upstream System within a Diagram (e.g., if system is a reference to a subsystem in a Diagram), or to a constant value using, e.g. port.FixValue(context, default_input). Any abstract inputs in the system must be unconnected (the port must be both optional and unused).

Note

The inputs, states, and outputs of the returned system are NOT the same as the original system. Denote x0,u0 as the nominal state and input defined by the Context, and y0 as the value of the output at (x0,u0), then the created systems inputs are (u-u0), states are (x-x0), and outputs are (y-y0).

Note

This method does not (yet) set the initial conditions (default nor random) of the LinearSystem based on system.

pydrake.systems.primitives.LinearSystem

alias of pydrake.systems.primitives.LinearSystem_[float]

template pydrake.systems.primitives.LinearSystem_

Instantiations: LinearSystem_[float], LinearSystem_[AutoDiffXd], LinearSystem_[Expression]

class LinearSystem_[float]

Bases: pydrake.systems.primitives.AffineSystem_[float]

A discrete OR continuous linear system.

If time_period>0.0, then the linear system will have the following discrete- time state update:

\[x[n+1] = A x[n] + B u[n],\]

or if time_period==0.0, then the linear system will have the following continuous-time state update:

\[\dot{x} = A x + B u.\]

In both cases, the system will have the output:

\[y = C x + D u,\]

where u denotes the input vector, x denotes the state vector, and y denotes the output vector.

See also

AffineSystem

See also

MatrixGain

__init__(self: pydrake.systems.primitives.LinearSystem_[float], A: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], B: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], C: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], D: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], time_period: float = 0.0) → None

Constructs a LinearSystem with a fixed set of coefficient matrices A, B,``C``, and D. The coefficient matrices must obey the following dimensions: | Matrix | Num Rows | Num Columns | |:-------:|:———–:|:-----------:| | A | num states | num states | | B | num states | num inputs | | C | num outputs | num states | | D | num outputs | num inputs |

Subclasses must use the protected constructor, not this one.

class pydrake.systems.primitives.LinearSystem_[AutoDiffXd]

Bases: pydrake.systems.primitives.AffineSystem_[AutoDiffXd]

A discrete OR continuous linear system.

If time_period>0.0, then the linear system will have the following discrete- time state update:

\[x[n+1] = A x[n] + B u[n],\]

or if time_period==0.0, then the linear system will have the following continuous-time state update:

\[\dot{x} = A x + B u.\]

In both cases, the system will have the output:

\[y = C x + D u,\]

where u denotes the input vector, x denotes the state vector, and y denotes the output vector.

See also

AffineSystem

See also

MatrixGain

__init__(self: pydrake.systems.primitives.LinearSystem_[AutoDiffXd], A: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], B: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], C: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], D: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], time_period: float = 0.0) → None

Constructs a LinearSystem with a fixed set of coefficient matrices A, B,``C``, and D. The coefficient matrices must obey the following dimensions: | Matrix | Num Rows | Num Columns | |:-------:|:———–:|:-----------:| | A | num states | num states | | B | num states | num inputs | | C | num outputs | num states | | D | num outputs | num inputs |

Subclasses must use the protected constructor, not this one.

class pydrake.systems.primitives.LinearSystem_[Expression]

Bases: pydrake.systems.primitives.AffineSystem_[Expression]

A discrete OR continuous linear system.

If time_period>0.0, then the linear system will have the following discrete- time state update:

\[x[n+1] = A x[n] + B u[n],\]

or if time_period==0.0, then the linear system will have the following continuous-time state update:

\[\dot{x} = A x + B u.\]

In both cases, the system will have the output:

\[y = C x + D u,\]

where u denotes the input vector, x denotes the state vector, and y denotes the output vector.

See also

AffineSystem

See also

MatrixGain

__init__(self: pydrake.systems.primitives.LinearSystem_[Expression], A: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], B: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], C: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], D: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], time_period: float = 0.0) → None

Constructs a LinearSystem with a fixed set of coefficient matrices A, B,``C``, and D. The coefficient matrices must obey the following dimensions: | Matrix | Num Rows | Num Columns | |:-------:|:———–:|:-----------:| | A | num states | num states | | B | num states | num inputs | | C | num outputs | num states | | D | num outputs | num inputs |

Subclasses must use the protected constructor, not this one.

class pydrake.systems.primitives.LinearSystem_[float]

Bases: pydrake.systems.primitives.AffineSystem_[float]

A discrete OR continuous linear system.

If time_period>0.0, then the linear system will have the following discrete- time state update:

\[x[n+1] = A x[n] + B u[n],\]

or if time_period==0.0, then the linear system will have the following continuous-time state update:

\[\dot{x} = A x + B u.\]

In both cases, the system will have the output:

\[y = C x + D u,\]

where u denotes the input vector, x denotes the state vector, and y denotes the output vector.

See also

AffineSystem

See also

MatrixGain

__init__(self: pydrake.systems.primitives.LinearSystem_[float], A: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], B: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], C: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], D: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous], time_period: float = 0.0) → None

Constructs a LinearSystem with a fixed set of coefficient matrices A, B,``C``, and D. The coefficient matrices must obey the following dimensions: | Matrix | Num Rows | Num Columns | |:-------:|:———–:|:-----------:| | A | num states | num states | | B | num states | num inputs | | C | num outputs | num states | | D | num outputs | num inputs |

Subclasses must use the protected constructor, not this one.

pydrake.systems.primitives.LogOutput(src: pydrake.systems.framework.OutputPort_[float], builder: pydrake.systems.framework.DiagramBuilder_[float]) → pydrake.systems.primitives.SignalLogger_[float]

Provides a convenience function for adding a SignalLogger, initialized to the correct size, and connected to an output in a DiagramBuilder.

DiagramBuilder<double> builder;
  auto foo = builder.AddSystem<Foo>("name", 3.14);
  auto logger = LogOutput(foo->get_output_port(), &builder);
pydrake.systems.primitives.MatrixGain

alias of pydrake.systems.primitives.MatrixGain_[float]

template pydrake.systems.primitives.MatrixGain_

Instantiations: MatrixGain_[float], MatrixGain_[AutoDiffXd], MatrixGain_[Expression]

class MatrixGain_[float]

Bases: pydrake.systems.primitives.LinearSystem_[float]

A system that specializes LinearSystem by setting coefficient matrices A, B, and C to all be zero. Thus, the only non-zero coefficient matrix is D. Specifically, given an input signal u and a state x, the output of this system, y, is:

\[y = D u\]

See also

AffineSystem

See also

LinearSystem

__init__(self: pydrake.systems.primitives.MatrixGain_[float], D: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous]) → None

A constructor where the gain matrix D is D.

class pydrake.systems.primitives.MatrixGain_[AutoDiffXd]

Bases: pydrake.systems.primitives.LinearSystem_[AutoDiffXd]

A system that specializes LinearSystem by setting coefficient matrices A, B, and C to all be zero. Thus, the only non-zero coefficient matrix is D. Specifically, given an input signal u and a state x, the output of this system, y, is:

\[y = D u\]

See also

AffineSystem

See also

LinearSystem

__init__(self: pydrake.systems.primitives.MatrixGain_[AutoDiffXd], D: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous]) → None

A constructor where the gain matrix D is D.

class pydrake.systems.primitives.MatrixGain_[Expression]

Bases: pydrake.systems.primitives.LinearSystem_[Expression]

A system that specializes LinearSystem by setting coefficient matrices A, B, and C to all be zero. Thus, the only non-zero coefficient matrix is D. Specifically, given an input signal u and a state x, the output of this system, y, is:

\[y = D u\]

See also

AffineSystem

See also

LinearSystem

__init__(self: pydrake.systems.primitives.MatrixGain_[Expression], D: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous]) → None

A constructor where the gain matrix D is D.

class pydrake.systems.primitives.MatrixGain_[float]

Bases: pydrake.systems.primitives.LinearSystem_[float]

A system that specializes LinearSystem by setting coefficient matrices A, B, and C to all be zero. Thus, the only non-zero coefficient matrix is D. Specifically, given an input signal u and a state x, the output of this system, y, is:

\[y = D u\]

See also

AffineSystem

See also

LinearSystem

__init__(self: pydrake.systems.primitives.MatrixGain_[float], D: numpy.ndarray[numpy.float64[m, n], flags.f_contiguous]) → None

A constructor where the gain matrix D is D.

pydrake.systems.primitives.Multiplexer

alias of pydrake.systems.primitives.Multiplexer_[float]

template pydrake.systems.primitives.Multiplexer_

Instantiations: Multiplexer_[float], Multiplexer_[AutoDiffXd], Multiplexer_[Expression]

class Multiplexer_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

This system combines multiple vector-valued inputs into a vector-valued output. The input to this system directly feeds through to its output.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.Multiplexer_[float], num_scalar_inputs: int) -> None

Constructs a Multiplexer with num_scalar_inputs scalar-valued input ports, and one vector-valued output port of size num_scalar_inputs.

  1. __init__(self: pydrake.systems.primitives.Multiplexer_[float], input_sizes: List[int]) -> None

Constructs a Multiplexer with input_sizes.size() vector-valued input ports where the i-th input has size input_sizes[i], and one vector- valued output port of size sum(input_sizes).

  1. __init__(self: pydrake.systems.primitives.Multiplexer_[float], model_vector: pydrake.systems.framework.BasicVector_[float]) -> None

Constructs a Multiplexer with model_vector.size() scalar-valued inputs and one vector-valued output port whose size equals the size of model_vector. In addition, the output type derives from that of model_vector.

Note

Objects created using this constructor overload do not support system scalar conversion. See system_scalar_conversion.

class pydrake.systems.primitives.Multiplexer_[AutoDiffXd]

Bases: pydrake.systems.framework.LeafSystem_[AutoDiffXd]

This system combines multiple vector-valued inputs into a vector-valued output. The input to this system directly feeds through to its output.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.Multiplexer_[AutoDiffXd], num_scalar_inputs: int) -> None

Constructs a Multiplexer with num_scalar_inputs scalar-valued input ports, and one vector-valued output port of size num_scalar_inputs.

  1. __init__(self: pydrake.systems.primitives.Multiplexer_[AutoDiffXd], input_sizes: List[int]) -> None

Constructs a Multiplexer with input_sizes.size() vector-valued input ports where the i-th input has size input_sizes[i], and one vector- valued output port of size sum(input_sizes).

  1. __init__(self: pydrake.systems.primitives.Multiplexer_[AutoDiffXd], model_vector: pydrake.systems.framework.BasicVector_[AutoDiffXd]) -> None

Constructs a Multiplexer with model_vector.size() scalar-valued inputs and one vector-valued output port whose size equals the size of model_vector. In addition, the output type derives from that of model_vector.

Note

Objects created using this constructor overload do not support system scalar conversion. See system_scalar_conversion.

class pydrake.systems.primitives.Multiplexer_[Expression]

Bases: pydrake.systems.framework.LeafSystem_[Expression]

This system combines multiple vector-valued inputs into a vector-valued output. The input to this system directly feeds through to its output.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.Multiplexer_[Expression], num_scalar_inputs: int) -> None

Constructs a Multiplexer with num_scalar_inputs scalar-valued input ports, and one vector-valued output port of size num_scalar_inputs.

  1. __init__(self: pydrake.systems.primitives.Multiplexer_[Expression], input_sizes: List[int]) -> None

Constructs a Multiplexer with input_sizes.size() vector-valued input ports where the i-th input has size input_sizes[i], and one vector- valued output port of size sum(input_sizes).

  1. __init__(self: pydrake.systems.primitives.Multiplexer_[Expression], model_vector: pydrake.systems.framework.BasicVector_[Expression]) -> None

Constructs a Multiplexer with model_vector.size() scalar-valued inputs and one vector-valued output port whose size equals the size of model_vector. In addition, the output type derives from that of model_vector.

Note

Objects created using this constructor overload do not support system scalar conversion. See system_scalar_conversion.

class pydrake.systems.primitives.Multiplexer_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

This system combines multiple vector-valued inputs into a vector-valued output. The input to this system directly feeds through to its output.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.Multiplexer_[float], num_scalar_inputs: int) -> None

Constructs a Multiplexer with num_scalar_inputs scalar-valued input ports, and one vector-valued output port of size num_scalar_inputs.

  1. __init__(self: pydrake.systems.primitives.Multiplexer_[float], input_sizes: List[int]) -> None

Constructs a Multiplexer with input_sizes.size() vector-valued input ports where the i-th input has size input_sizes[i], and one vector- valued output port of size sum(input_sizes).

  1. __init__(self: pydrake.systems.primitives.Multiplexer_[float], model_vector: pydrake.systems.framework.BasicVector_[float]) -> None

Constructs a Multiplexer with model_vector.size() scalar-valued inputs and one vector-valued output port whose size equals the size of model_vector. In addition, the output type derives from that of model_vector.

Note

Objects created using this constructor overload do not support system scalar conversion. See system_scalar_conversion.

pydrake.systems.primitives.ObservabilityMatrix(arg0: pydrake.systems.primitives.LinearSystem_[float]) → numpy.ndarray[numpy.float64[m, n]]

Returns the observability matrix: O = [ C; CA; …; CA^{n-1} ].

pydrake.systems.primitives.PassThrough

alias of pydrake.systems.primitives.PassThrough_[float]

template pydrake.systems.primitives.PassThrough_

Instantiations: PassThrough_[float], PassThrough_[AutoDiffXd], PassThrough_[Expression]

class PassThrough_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

A pass through system with input u and output y = u. This is mathematically equivalent to a Gain system with its gain equal to one. However this system incurs no computational cost. The input to this system directly feeds through to its output. This system is used, for instance, in PidController which is a Diagram composed of simple framework primitives. In this case a PassThrough is used to connect the exported input of the Diagram to the inputs of the Gain systems for the proportional and integral constants of the controller. This is necessary to provide an output port to which the internal Gain subsystems connect. In this case the PassThrough is effectively creating an output port that feeds through the input to the Diagram and that can now be connected to the inputs of the inner subsystems to the Diagram. A detailed discussion of the PidController can be found at https://github.com/RobotLocomotion/drake/pull/3132.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.PassThrough_[float], arg0: int) -> None

Constructs a pass through system (y = u).

Parameter vector_size:
number of elements in the signal to be processed.
  1. __init__(self: pydrake.systems.primitives.PassThrough_[float], arg0: pydrake.common.value.AbstractValue) -> None

Constructs a pass through system (y = u).

Parameter abstract_model_value:
A model abstract value.
class pydrake.systems.primitives.PassThrough_[AutoDiffXd]

Bases: pydrake.systems.framework.LeafSystem_[AutoDiffXd]

A pass through system with input u and output y = u. This is mathematically equivalent to a Gain system with its gain equal to one. However this system incurs no computational cost. The input to this system directly feeds through to its output. This system is used, for instance, in PidController which is a Diagram composed of simple framework primitives. In this case a PassThrough is used to connect the exported input of the Diagram to the inputs of the Gain systems for the proportional and integral constants of the controller. This is necessary to provide an output port to which the internal Gain subsystems connect. In this case the PassThrough is effectively creating an output port that feeds through the input to the Diagram and that can now be connected to the inputs of the inner subsystems to the Diagram. A detailed discussion of the PidController can be found at https://github.com/RobotLocomotion/drake/pull/3132.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.PassThrough_[AutoDiffXd], arg0: int) -> None

Constructs a pass through system (y = u).

Parameter vector_size:
number of elements in the signal to be processed.
  1. __init__(self: pydrake.systems.primitives.PassThrough_[AutoDiffXd], arg0: pydrake.common.value.AbstractValue) -> None

Constructs a pass through system (y = u).

Parameter abstract_model_value:
A model abstract value.
class pydrake.systems.primitives.PassThrough_[Expression]

Bases: pydrake.systems.framework.LeafSystem_[Expression]

A pass through system with input u and output y = u. This is mathematically equivalent to a Gain system with its gain equal to one. However this system incurs no computational cost. The input to this system directly feeds through to its output. This system is used, for instance, in PidController which is a Diagram composed of simple framework primitives. In this case a PassThrough is used to connect the exported input of the Diagram to the inputs of the Gain systems for the proportional and integral constants of the controller. This is necessary to provide an output port to which the internal Gain subsystems connect. In this case the PassThrough is effectively creating an output port that feeds through the input to the Diagram and that can now be connected to the inputs of the inner subsystems to the Diagram. A detailed discussion of the PidController can be found at https://github.com/RobotLocomotion/drake/pull/3132.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.PassThrough_[Expression], arg0: int) -> None

Constructs a pass through system (y = u).

Parameter vector_size:
number of elements in the signal to be processed.
  1. __init__(self: pydrake.systems.primitives.PassThrough_[Expression], arg0: pydrake.common.value.AbstractValue) -> None

Constructs a pass through system (y = u).

Parameter abstract_model_value:
A model abstract value.
class pydrake.systems.primitives.PassThrough_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

A pass through system with input u and output y = u. This is mathematically equivalent to a Gain system with its gain equal to one. However this system incurs no computational cost. The input to this system directly feeds through to its output. This system is used, for instance, in PidController which is a Diagram composed of simple framework primitives. In this case a PassThrough is used to connect the exported input of the Diagram to the inputs of the Gain systems for the proportional and integral constants of the controller. This is necessary to provide an output port to which the internal Gain subsystems connect. In this case the PassThrough is effectively creating an output port that feeds through the input to the Diagram and that can now be connected to the inputs of the inner subsystems to the Diagram. A detailed discussion of the PidController can be found at https://github.com/RobotLocomotion/drake/pull/3132.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.PassThrough_[float], arg0: int) -> None

Constructs a pass through system (y = u).

Parameter vector_size:
number of elements in the signal to be processed.
  1. __init__(self: pydrake.systems.primitives.PassThrough_[float], arg0: pydrake.common.value.AbstractValue) -> None

Constructs a pass through system (y = u).

Parameter abstract_model_value:
A model abstract value.
class pydrake.systems.primitives.RandomSource

Bases: pydrake.systems.framework.LeafSystem_[float]

A source block which generates random numbers at a fixed sampling interval, with a zero-order hold between samples. For continuous-time systems, this can be interpreted as a band-limited approximation of continuous white noise (with a power-spectral density of the form Ts * sinc^2( omega * Ts ), where Ts is the sampling interval.

RandomSource
→ output

This system exposes a parameter named seed for the pseudo-random number generator that determines the noise output. The seed parameter behaves as follows:

1. Each newly-created RandomSource chooses a new per_instance_seed member field value for itself. The value will be unique within the current executable process.

2. By default, source.CreateDefaultContext() will set the returned context’s seed parameter to per_instance_seed. Therefore, for a given instance of this system, the parameters, state, and outputs will be identical for all simulations that start from a default context.

3. By default, source.SetRandomContext() will choose a new, arbitrary value for the context’s seed parameter, which means that the system’s parameters, state, and outputs will (almost certainly) differ from their defaults.

4. The user may call source.set_fixed_seed(new_seed) on this system. When a new_seed value is provided, it is used by both CreateDefaultContext and SetRandomContext. Therefore, the system’s parameters, state, and outputs will be identical to any other instances that share the same new_seed value for their seed context parameter. Note that set_fixed_seed affects subsequently-created contexts; any pre-existing contexts are unaffected. The user may call source.set_fixed_seed(nullopt) to revert to the default the behaviors described in #2 and #3 again.

5. The context returned by source.AllocateContext() does not contain a valid seed parameter; that context should not be used until its values are populated via another Context.

Note

This system is only defined for the double scalar type.

Note

The exact distribution results may vary across multiple platforms or revisions of Drake, but will be consistent for all compilations on a given platform and Drake revision.

Note

The hard-coding of (default) distribution parameters is imposed intentionally to simplify analysis (by forcing systems taking noise inputs to implement the shifting/scaling, the system itself contains all of the necessary information for stochastic analysis).

See also

stochastic_systems

__init__(self: pydrake.systems.primitives.RandomSource, distribution: pydrake.common._module_py.RandomDistribution, num_outputs: int, sampling_interval_sec: float) → None

Constructs the RandomSource system.

Parameter distribution:
The RandomDistribution used for each of the outputs.
Parameter num_outputs:
The dimension of the (single) vector output port.
Parameter sampling_interval_sec:
The sampling interval in seconds.
pydrake.systems.primitives.Saturation

alias of pydrake.systems.primitives.Saturation_[float]

template pydrake.systems.primitives.Saturation_

Instantiations: Saturation_[float], Saturation_[AutoDiffXd], Saturation_[Expression]

class Saturation_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

An element-wise hard saturation block with inputs signal u, saturation values \(u_{min}\) and/or \(u_{max}\), and output y respectively as in:

\[y = u, u_{min} < u < u_{min}\]
\[y = u_{min}, u \le u_{min}\]
\[y = u_{max}, u \ge u_{max}\]

The input to this system directly feeds through to its output.

Note that \(u_{min}\), and \(u_{max}\), and \(u\) are all vectors of same dimension, and the following condition holds elementwise in runtime.

\[u_{min} <= u_{max}\]

The quantities \(u_{min}\), and \(u_{max}\) can be supplied as inputs in separate ports or be initialised as constants using the appropriate constructor by passing their default value. If these quantities are not defined as constants but they are not connected to appropriate sources, their values are taken by default to be \(u_{min} = -\infty\), and \(u_{max} = \infty\) respectively. In this “variable” configuration, at least one of the input ports must be connected.

__init__(self: pydrake.systems.primitives.Saturation_[float], min_value: numpy.ndarray[numpy.float64[m, 1]], max_value: numpy.ndarray[numpy.float64[m, 1]]) → None

Constructs a constant Saturation system where the upper and lower values are represented by vectors of identical size supplied via this constructor.

Parameter u_min:
the lower (vector) limit to the saturation.
Parameter u_max:
the upper (vector) limit to the saturation.

Please consult this class’s description for the requirements of u_min and u_max.

class pydrake.systems.primitives.Saturation_[AutoDiffXd]

Bases: pydrake.systems.framework.LeafSystem_[AutoDiffXd]

An element-wise hard saturation block with inputs signal u, saturation values \(u_{min}\) and/or \(u_{max}\), and output y respectively as in:

\[y = u, u_{min} < u < u_{min}\]
\[y = u_{min}, u \le u_{min}\]
\[y = u_{max}, u \ge u_{max}\]

The input to this system directly feeds through to its output.

Note that \(u_{min}\), and \(u_{max}\), and \(u\) are all vectors of same dimension, and the following condition holds elementwise in runtime.

\[u_{min} <= u_{max}\]

The quantities \(u_{min}\), and \(u_{max}\) can be supplied as inputs in separate ports or be initialised as constants using the appropriate constructor by passing their default value. If these quantities are not defined as constants but they are not connected to appropriate sources, their values are taken by default to be \(u_{min} = -\infty\), and \(u_{max} = \infty\) respectively. In this “variable” configuration, at least one of the input ports must be connected.

__init__(self: pydrake.systems.primitives.Saturation_[AutoDiffXd], min_value: numpy.ndarray[object[m, 1]], max_value: numpy.ndarray[object[m, 1]]) → None

Constructs a constant Saturation system where the upper and lower values are represented by vectors of identical size supplied via this constructor.

Parameter u_min:
the lower (vector) limit to the saturation.
Parameter u_max:
the upper (vector) limit to the saturation.

Please consult this class’s description for the requirements of u_min and u_max.

class pydrake.systems.primitives.Saturation_[Expression]

Bases: pydrake.systems.framework.LeafSystem_[Expression]

An element-wise hard saturation block with inputs signal u, saturation values \(u_{min}\) and/or \(u_{max}\), and output y respectively as in:

\[y = u, u_{min} < u < u_{min}\]
\[y = u_{min}, u \le u_{min}\]
\[y = u_{max}, u \ge u_{max}\]

The input to this system directly feeds through to its output.

Note that \(u_{min}\), and \(u_{max}\), and \(u\) are all vectors of same dimension, and the following condition holds elementwise in runtime.

\[u_{min} <= u_{max}\]

The quantities \(u_{min}\), and \(u_{max}\) can be supplied as inputs in separate ports or be initialised as constants using the appropriate constructor by passing their default value. If these quantities are not defined as constants but they are not connected to appropriate sources, their values are taken by default to be \(u_{min} = -\infty\), and \(u_{max} = \infty\) respectively. In this “variable” configuration, at least one of the input ports must be connected.

__init__(self: pydrake.systems.primitives.Saturation_[Expression], min_value: numpy.ndarray[object[m, 1]], max_value: numpy.ndarray[object[m, 1]]) → None

Constructs a constant Saturation system where the upper and lower values are represented by vectors of identical size supplied via this constructor.

Parameter u_min:
the lower (vector) limit to the saturation.
Parameter u_max:
the upper (vector) limit to the saturation.

Please consult this class’s description for the requirements of u_min and u_max.

class pydrake.systems.primitives.Saturation_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

An element-wise hard saturation block with inputs signal u, saturation values \(u_{min}\) and/or \(u_{max}\), and output y respectively as in:

\[y = u, u_{min} < u < u_{min}\]
\[y = u_{min}, u \le u_{min}\]
\[y = u_{max}, u \ge u_{max}\]

The input to this system directly feeds through to its output.

Note that \(u_{min}\), and \(u_{max}\), and \(u\) are all vectors of same dimension, and the following condition holds elementwise in runtime.

\[u_{min} <= u_{max}\]

The quantities \(u_{min}\), and \(u_{max}\) can be supplied as inputs in separate ports or be initialised as constants using the appropriate constructor by passing their default value. If these quantities are not defined as constants but they are not connected to appropriate sources, their values are taken by default to be \(u_{min} = -\infty\), and \(u_{max} = \infty\) respectively. In this “variable” configuration, at least one of the input ports must be connected.

__init__(self: pydrake.systems.primitives.Saturation_[float], min_value: numpy.ndarray[numpy.float64[m, 1]], max_value: numpy.ndarray[numpy.float64[m, 1]]) → None

Constructs a constant Saturation system where the upper and lower values are represented by vectors of identical size supplied via this constructor.

Parameter u_min:
the lower (vector) limit to the saturation.
Parameter u_max:
the upper (vector) limit to the saturation.

Please consult this class’s description for the requirements of u_min and u_max.

pydrake.systems.primitives.SignalLogger

alias of pydrake.systems.primitives.SignalLogger_[float]

template pydrake.systems.primitives.SignalLogger_

Instantiations: SignalLogger_[float], SignalLogger_[AutoDiffXd], SignalLogger_[Expression]

class SignalLogger_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

A discrete sink block which logs its input to memory (not thread safe). This data is then retrievable (e.g. after a simulation) via a handful of accessor methods. This system holds a large, mutable Eigen matrix for data storage, where each column corresponds to a data point. It saves a data point and the context time whenever it samples its input.

By default, sampling is performed every time the Simulator completes a trajectory-advancing substep (that is, via a per-step Publish event), with the first sample occurring during Simulator::Initialize(). That means the samples will generally be unevenly spaced in time. If you prefer regular sampling, you may optionally specify a “publish period” in which case sampling occurs periodically, with the first sample occurring at time 0. Alternatively (not common), you can specify that logging should only occur at “forced publish” events, meaning at explicit calls to System::Publish(). The Simulator’s “publish every time step” option also results in forced publish events, so should be disabled if you want to control logging yourself.

Warning

SignalLogger is not thread-safe because it writes to a mutable buffer internally. If you have a Diagram that contains a SignalLogger, even with each thread having its own Context, the threads will conflict. You would have to have separate Diagrams in each thread to avoid trouble.

See also

LogOutput() for a convenient way to add logging to a Diagram.

See also

Simulator::set_publish_every_time_step()

See also

Simulator::set_publish_at_initialization()

data→
SignalLogger
__init__(self: pydrake.systems.primitives.SignalLogger_[float], input_size: int, batch_allocation_size: int = 1000) → None

Constructs the signal logger system.

Warning

SignalLogger may become slower and slower as the number of log entries increases due to memory reallocations. You can avoid that by providing a batch_allocation_size comparable to the total expected number of log entries for your simulation.

Parameter input_size:
Dimension of the (single) input port. This corresponds to the number of rows of the data matrix.
Parameter batch_allocation_size:
Storage is (re)allocated in blocks of input_size-by-batch_allocation_size.

See also

LogOutput() helper function for a convenient way to add logging.

data(self: pydrake.systems.primitives.SignalLogger_[float]) → numpy.ndarray[numpy.float64[m, n], flags.f_contiguous]

Provides access to the logged data.

reset(self: pydrake.systems.primitives.SignalLogger_[float]) → None

Clears the logged data.

sample_times(self: pydrake.systems.primitives.SignalLogger_[float]) → numpy.ndarray[numpy.float64[m, 1]]

Provides access to the sample times of the logged data. Time is taken from the Context when the log entry is added.

set_forced_publish_only(self: pydrake.systems.primitives.SignalLogger_[float]) → None

Limits logging to forced publish calls only, that is, explicit calls to System::Publish() issued directly or by the Simulator and disables the default per-step sampling. This method cannot be called if set_publish_period() has been called.

Raises:RuntimeError if set_publish_period() has been called.
set_publish_period(self: pydrake.systems.primitives.SignalLogger_[float], period: float) → None

Sets the publishing period of this system to specify periodic sampling and disables the default per-step sampling. This method can only be called once and only if set_forced_publish_only() hasn’t been called.

Raises:
  • RuntimeError if called more than once, or if
  • set_forced_publish_only() has been called.
Precondition:
period must be greater than zero.
class pydrake.systems.primitives.SignalLogger_[AutoDiffXd]

Bases: pydrake.systems.framework.LeafSystem_[AutoDiffXd]

A discrete sink block which logs its input to memory (not thread safe). This data is then retrievable (e.g. after a simulation) via a handful of accessor methods. This system holds a large, mutable Eigen matrix for data storage, where each column corresponds to a data point. It saves a data point and the context time whenever it samples its input.

By default, sampling is performed every time the Simulator completes a trajectory-advancing substep (that is, via a per-step Publish event), with the first sample occurring during Simulator::Initialize(). That means the samples will generally be unevenly spaced in time. If you prefer regular sampling, you may optionally specify a “publish period” in which case sampling occurs periodically, with the first sample occurring at time 0. Alternatively (not common), you can specify that logging should only occur at “forced publish” events, meaning at explicit calls to System::Publish(). The Simulator’s “publish every time step” option also results in forced publish events, so should be disabled if you want to control logging yourself.

Warning

SignalLogger is not thread-safe because it writes to a mutable buffer internally. If you have a Diagram that contains a SignalLogger, even with each thread having its own Context, the threads will conflict. You would have to have separate Diagrams in each thread to avoid trouble.

See also

LogOutput() for a convenient way to add logging to a Diagram.

See also

Simulator::set_publish_every_time_step()

See also

Simulator::set_publish_at_initialization()

data→
SignalLogger
__init__(self: pydrake.systems.primitives.SignalLogger_[AutoDiffXd], input_size: int, batch_allocation_size: int = 1000) → None

Constructs the signal logger system.

Warning

SignalLogger may become slower and slower as the number of log entries increases due to memory reallocations. You can avoid that by providing a batch_allocation_size comparable to the total expected number of log entries for your simulation.

Parameter input_size:
Dimension of the (single) input port. This corresponds to the number of rows of the data matrix.
Parameter batch_allocation_size:
Storage is (re)allocated in blocks of input_size-by-batch_allocation_size.

See also

LogOutput() helper function for a convenient way to add logging.

data(self: pydrake.systems.primitives.SignalLogger_[AutoDiffXd]) → numpy.ndarray[object[m, n], flags.f_contiguous]

Provides access to the logged data.

reset(self: pydrake.systems.primitives.SignalLogger_[AutoDiffXd]) → None

Clears the logged data.

sample_times(self: pydrake.systems.primitives.SignalLogger_[AutoDiffXd]) → numpy.ndarray[object[m, 1]]

Provides access to the sample times of the logged data. Time is taken from the Context when the log entry is added.

set_forced_publish_only(self: pydrake.systems.primitives.SignalLogger_[AutoDiffXd]) → None

Limits logging to forced publish calls only, that is, explicit calls to System::Publish() issued directly or by the Simulator and disables the default per-step sampling. This method cannot be called if set_publish_period() has been called.

Raises:RuntimeError if set_publish_period() has been called.
set_publish_period(self: pydrake.systems.primitives.SignalLogger_[AutoDiffXd], period: float) → None

Sets the publishing period of this system to specify periodic sampling and disables the default per-step sampling. This method can only be called once and only if set_forced_publish_only() hasn’t been called.

Raises:
  • RuntimeError if called more than once, or if
  • set_forced_publish_only() has been called.
Precondition:
period must be greater than zero.
class pydrake.systems.primitives.SignalLogger_[Expression]

Bases: pydrake.systems.framework.LeafSystem_[Expression]

A discrete sink block which logs its input to memory (not thread safe). This data is then retrievable (e.g. after a simulation) via a handful of accessor methods. This system holds a large, mutable Eigen matrix for data storage, where each column corresponds to a data point. It saves a data point and the context time whenever it samples its input.

By default, sampling is performed every time the Simulator completes a trajectory-advancing substep (that is, via a per-step Publish event), with the first sample occurring during Simulator::Initialize(). That means the samples will generally be unevenly spaced in time. If you prefer regular sampling, you may optionally specify a “publish period” in which case sampling occurs periodically, with the first sample occurring at time 0. Alternatively (not common), you can specify that logging should only occur at “forced publish” events, meaning at explicit calls to System::Publish(). The Simulator’s “publish every time step” option also results in forced publish events, so should be disabled if you want to control logging yourself.

Warning

SignalLogger is not thread-safe because it writes to a mutable buffer internally. If you have a Diagram that contains a SignalLogger, even with each thread having its own Context, the threads will conflict. You would have to have separate Diagrams in each thread to avoid trouble.

See also

LogOutput() for a convenient way to add logging to a Diagram.

See also

Simulator::set_publish_every_time_step()

See also

Simulator::set_publish_at_initialization()

data→
SignalLogger
__init__(self: pydrake.systems.primitives.SignalLogger_[Expression], input_size: int, batch_allocation_size: int = 1000) → None

Constructs the signal logger system.

Warning

SignalLogger may become slower and slower as the number of log entries increases due to memory reallocations. You can avoid that by providing a batch_allocation_size comparable to the total expected number of log entries for your simulation.

Parameter input_size:
Dimension of the (single) input port. This corresponds to the number of rows of the data matrix.
Parameter batch_allocation_size:
Storage is (re)allocated in blocks of input_size-by-batch_allocation_size.

See also

LogOutput() helper function for a convenient way to add logging.

data(self: pydrake.systems.primitives.SignalLogger_[Expression]) → numpy.ndarray[object[m, n], flags.f_contiguous]

Provides access to the logged data.

reset(self: pydrake.systems.primitives.SignalLogger_[Expression]) → None

Clears the logged data.

sample_times(self: pydrake.systems.primitives.SignalLogger_[Expression]) → numpy.ndarray[object[m, 1]]

Provides access to the sample times of the logged data. Time is taken from the Context when the log entry is added.

set_forced_publish_only(self: pydrake.systems.primitives.SignalLogger_[Expression]) → None

Limits logging to forced publish calls only, that is, explicit calls to System::Publish() issued directly or by the Simulator and disables the default per-step sampling. This method cannot be called if set_publish_period() has been called.

Raises:RuntimeError if set_publish_period() has been called.
set_publish_period(self: pydrake.systems.primitives.SignalLogger_[Expression], period: float) → None

Sets the publishing period of this system to specify periodic sampling and disables the default per-step sampling. This method can only be called once and only if set_forced_publish_only() hasn’t been called.

Raises:
  • RuntimeError if called more than once, or if
  • set_forced_publish_only() has been called.
Precondition:
period must be greater than zero.
class pydrake.systems.primitives.SignalLogger_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

A discrete sink block which logs its input to memory (not thread safe). This data is then retrievable (e.g. after a simulation) via a handful of accessor methods. This system holds a large, mutable Eigen matrix for data storage, where each column corresponds to a data point. It saves a data point and the context time whenever it samples its input.

By default, sampling is performed every time the Simulator completes a trajectory-advancing substep (that is, via a per-step Publish event), with the first sample occurring during Simulator::Initialize(). That means the samples will generally be unevenly spaced in time. If you prefer regular sampling, you may optionally specify a “publish period” in which case sampling occurs periodically, with the first sample occurring at time 0. Alternatively (not common), you can specify that logging should only occur at “forced publish” events, meaning at explicit calls to System::Publish(). The Simulator’s “publish every time step” option also results in forced publish events, so should be disabled if you want to control logging yourself.

Warning

SignalLogger is not thread-safe because it writes to a mutable buffer internally. If you have a Diagram that contains a SignalLogger, even with each thread having its own Context, the threads will conflict. You would have to have separate Diagrams in each thread to avoid trouble.

See also

LogOutput() for a convenient way to add logging to a Diagram.

See also

Simulator::set_publish_every_time_step()

See also

Simulator::set_publish_at_initialization()

data→
SignalLogger
__init__(self: pydrake.systems.primitives.SignalLogger_[float], input_size: int, batch_allocation_size: int = 1000) → None

Constructs the signal logger system.

Warning

SignalLogger may become slower and slower as the number of log entries increases due to memory reallocations. You can avoid that by providing a batch_allocation_size comparable to the total expected number of log entries for your simulation.

Parameter input_size:
Dimension of the (single) input port. This corresponds to the number of rows of the data matrix.
Parameter batch_allocation_size:
Storage is (re)allocated in blocks of input_size-by-batch_allocation_size.

See also

LogOutput() helper function for a convenient way to add logging.

data(self: pydrake.systems.primitives.SignalLogger_[float]) → numpy.ndarray[numpy.float64[m, n], flags.f_contiguous]

Provides access to the logged data.

reset(self: pydrake.systems.primitives.SignalLogger_[float]) → None

Clears the logged data.

sample_times(self: pydrake.systems.primitives.SignalLogger_[float]) → numpy.ndarray[numpy.float64[m, 1]]

Provides access to the sample times of the logged data. Time is taken from the Context when the log entry is added.

set_forced_publish_only(self: pydrake.systems.primitives.SignalLogger_[float]) → None

Limits logging to forced publish calls only, that is, explicit calls to System::Publish() issued directly or by the Simulator and disables the default per-step sampling. This method cannot be called if set_publish_period() has been called.

Raises:RuntimeError if set_publish_period() has been called.
set_publish_period(self: pydrake.systems.primitives.SignalLogger_[float], period: float) → None

Sets the publishing period of this system to specify periodic sampling and disables the default per-step sampling. This method can only be called once and only if set_forced_publish_only() hasn’t been called.

Raises:
  • RuntimeError if called more than once, or if
  • set_forced_publish_only() has been called.
Precondition:
period must be greater than zero.
pydrake.systems.primitives.Sine

alias of pydrake.systems.primitives.Sine_[float]

template pydrake.systems.primitives.Sine_

Instantiations: Sine_[float], Sine_[AutoDiffXd], Sine_[Expression]

class Sine_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

A sine system which outputs y = a * sin(f * t + p) and first and second derivatives w.r.t. the time parameter t. The block parameters are: a the amplitude, f the frequency (radians/second), and p the phase (radians), all of which are constant vectors provided at construction time. This system has one or zero input ports and three vector valued output ports (y and its first two derivatives). The user can specify whether to use simulation time as the source of values for the time variable or an external source. If an external time source is specified, the system is created with an input port for the time source. Otherwise, the system is created with zero input ports.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.Sine_[float], amplitude: float, frequency: float, phase: float, size: int, is_time_based: bool = True) -> None

Constructs a Sine system where the amplitude, frequency, and phase is applied to every input.

Parameter amplitude:
the sine wave amplitude
Parameter frequency:
the sine wave frequency (radians/second)
Parameter phase:
the sine wave phase (radians)
Parameter size:
number of elements in the output signal.
Parameter is_time_based:
indicates whether to use the simulation time as the source for the sine wave time variable, or use an external source, in which case an input port of size size is created.
  1. __init__(self: pydrake.systems.primitives.Sine_[float], amplitudes: numpy.ndarray[numpy.float64[m, 1]], frequencies: numpy.ndarray[numpy.float64[m, 1]], phases: numpy.ndarray[numpy.float64[m, 1]], is_time_based: bool = True) -> None

Constructs a Sine system where different amplitudes, frequencies, and phases can be applied to each sine wave.

Parameter amplitudes:
the sine wave amplitudes
Parameter frequencies:
the sine wave frequencies (radians/second)
Parameter phases:
the sine wave phases (radians)
Parameter is_time_based:
indicates whether to use the simulation time as the source for the sine wave time variable, or use an external source, in which case an input port is created.
class pydrake.systems.primitives.Sine_[AutoDiffXd]

Bases: pydrake.systems.framework.LeafSystem_[AutoDiffXd]

A sine system which outputs y = a * sin(f * t + p) and first and second derivatives w.r.t. the time parameter t. The block parameters are: a the amplitude, f the frequency (radians/second), and p the phase (radians), all of which are constant vectors provided at construction time. This system has one or zero input ports and three vector valued output ports (y and its first two derivatives). The user can specify whether to use simulation time as the source of values for the time variable or an external source. If an external time source is specified, the system is created with an input port for the time source. Otherwise, the system is created with zero input ports.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.Sine_[AutoDiffXd], amplitude: float, frequency: float, phase: float, size: int, is_time_based: bool = True) -> None

Constructs a Sine system where the amplitude, frequency, and phase is applied to every input.

Parameter amplitude:
the sine wave amplitude
Parameter frequency:
the sine wave frequency (radians/second)
Parameter phase:
the sine wave phase (radians)
Parameter size:
number of elements in the output signal.
Parameter is_time_based:
indicates whether to use the simulation time as the source for the sine wave time variable, or use an external source, in which case an input port of size size is created.
  1. __init__(self: pydrake.systems.primitives.Sine_[AutoDiffXd], amplitudes: numpy.ndarray[numpy.float64[m, 1]], frequencies: numpy.ndarray[numpy.float64[m, 1]], phases: numpy.ndarray[numpy.float64[m, 1]], is_time_based: bool = True) -> None

Constructs a Sine system where different amplitudes, frequencies, and phases can be applied to each sine wave.

Parameter amplitudes:
the sine wave amplitudes
Parameter frequencies:
the sine wave frequencies (radians/second)
Parameter phases:
the sine wave phases (radians)
Parameter is_time_based:
indicates whether to use the simulation time as the source for the sine wave time variable, or use an external source, in which case an input port is created.
class pydrake.systems.primitives.Sine_[Expression]

Bases: pydrake.systems.framework.LeafSystem_[Expression]

A sine system which outputs y = a * sin(f * t + p) and first and second derivatives w.r.t. the time parameter t. The block parameters are: a the amplitude, f the frequency (radians/second), and p the phase (radians), all of which are constant vectors provided at construction time. This system has one or zero input ports and three vector valued output ports (y and its first two derivatives). The user can specify whether to use simulation time as the source of values for the time variable or an external source. If an external time source is specified, the system is created with an input port for the time source. Otherwise, the system is created with zero input ports.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.Sine_[Expression], amplitude: float, frequency: float, phase: float, size: int, is_time_based: bool = True) -> None

Constructs a Sine system where the amplitude, frequency, and phase is applied to every input.

Parameter amplitude:
the sine wave amplitude
Parameter frequency:
the sine wave frequency (radians/second)
Parameter phase:
the sine wave phase (radians)
Parameter size:
number of elements in the output signal.
Parameter is_time_based:
indicates whether to use the simulation time as the source for the sine wave time variable, or use an external source, in which case an input port of size size is created.
  1. __init__(self: pydrake.systems.primitives.Sine_[Expression], amplitudes: numpy.ndarray[numpy.float64[m, 1]], frequencies: numpy.ndarray[numpy.float64[m, 1]], phases: numpy.ndarray[numpy.float64[m, 1]], is_time_based: bool = True) -> None

Constructs a Sine system where different amplitudes, frequencies, and phases can be applied to each sine wave.

Parameter amplitudes:
the sine wave amplitudes
Parameter frequencies:
the sine wave frequencies (radians/second)
Parameter phases:
the sine wave phases (radians)
Parameter is_time_based:
indicates whether to use the simulation time as the source for the sine wave time variable, or use an external source, in which case an input port is created.
class pydrake.systems.primitives.Sine_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

A sine system which outputs y = a * sin(f * t + p) and first and second derivatives w.r.t. the time parameter t. The block parameters are: a the amplitude, f the frequency (radians/second), and p the phase (radians), all of which are constant vectors provided at construction time. This system has one or zero input ports and three vector valued output ports (y and its first two derivatives). The user can specify whether to use simulation time as the source of values for the time variable or an external source. If an external time source is specified, the system is created with an input port for the time source. Otherwise, the system is created with zero input ports.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.Sine_[float], amplitude: float, frequency: float, phase: float, size: int, is_time_based: bool = True) -> None

Constructs a Sine system where the amplitude, frequency, and phase is applied to every input.

Parameter amplitude:
the sine wave amplitude
Parameter frequency:
the sine wave frequency (radians/second)
Parameter phase:
the sine wave phase (radians)
Parameter size:
number of elements in the output signal.
Parameter is_time_based:
indicates whether to use the simulation time as the source for the sine wave time variable, or use an external source, in which case an input port of size size is created.
  1. __init__(self: pydrake.systems.primitives.Sine_[float], amplitudes: numpy.ndarray[numpy.float64[m, 1]], frequencies: numpy.ndarray[numpy.float64[m, 1]], phases: numpy.ndarray[numpy.float64[m, 1]], is_time_based: bool = True) -> None

Constructs a Sine system where different amplitudes, frequencies, and phases can be applied to each sine wave.

Parameter amplitudes:
the sine wave amplitudes
Parameter frequencies:
the sine wave frequencies (radians/second)
Parameter phases:
the sine wave phases (radians)
Parameter is_time_based:
indicates whether to use the simulation time as the source for the sine wave time variable, or use an external source, in which case an input port is created.
pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative

alias of pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[float]

template pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_

Instantiations: StateInterpolatorWithDiscreteDerivative_[float], StateInterpolatorWithDiscreteDerivative_[AutoDiffXd], StateInterpolatorWithDiscreteDerivative_[Expression]

class StateInterpolatorWithDiscreteDerivative_[float]

Bases: pydrake.systems.framework.Diagram_[float]

Supports the common pattern of combining a (feed-through) position with a velocity estimated with the DiscreteDerivative into a single output vector with positions and velocities stacked. This assumes that the number of positions == the number of velocities.

┌─────┐
position ───┬───────────────────>│     │
            │                    │ Mux ├──> state
            │   ┌────────────┐   │     │
            └──>│  Discrete  ├──>│     │
                │ Derivative │   └─────┘
                └────────────┘
position→
StateInterpolatorWithDiscreteDerivative
→ state
__init__(self: pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[float], num_positions: int, time_step: float, suppress_initial_transient: bool = False) → None

Constructor taking num_positions, the size of the position vector to be differentiated, and time_step, the sampling interval.

set_initial_position(*args, **kwargs)

Overloaded function.

  1. set_initial_position(self: pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[float], context: pydrake.systems.framework.Context_[float], position: numpy.ndarray[numpy.float64[m, 1]]) -> None

Convenience method that sets the entire position history for the discrete-time derivative to a constant vector value (resulting in velocity estimate of zero). This is useful during initialization to avoid large derivative outputs. position must be the same size as the input/output ports. If suppress_initial_transient() is true, then also disables the suppression for this context.

Warning

This only changes the position history used for the velocity half of the output port; it has no effect on the feedthrough position.

  1. set_initial_position(self: pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[float], state: pydrake.systems.framework.State_[float], position: numpy.ndarray[numpy.float64[m, 1]]) -> None

Convenience method that sets the entire position history for the discrete-time derivative to a constant vector value (resulting in velocity estimate of zero). This is useful during initialization to avoid large derivative outputs. position must be the same size as the input/output ports. If suppress_initial_transient() is true, then also disables the suppression for this state.

Warning

This only changes the position history used for the velocity half of the output port; it has no effect on the feedthrough position.

suppress_initial_transient(self: pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[float]) → bool

Returns the suppress_initial_transient passed to the constructor.

class pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[AutoDiffXd]

Bases: pydrake.systems.framework.Diagram_[AutoDiffXd]

Supports the common pattern of combining a (feed-through) position with a velocity estimated with the DiscreteDerivative into a single output vector with positions and velocities stacked. This assumes that the number of positions == the number of velocities.

┌─────┐
position ───┬───────────────────>│     │
            │                    │ Mux ├──> state
            │   ┌────────────┐   │     │
            └──>│  Discrete  ├──>│     │
                │ Derivative │   └─────┘
                └────────────┘
position→
StateInterpolatorWithDiscreteDerivative
→ state
__init__(self: pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[AutoDiffXd], num_positions: int, time_step: float, suppress_initial_transient: bool = False) → None

Constructor taking num_positions, the size of the position vector to be differentiated, and time_step, the sampling interval.

set_initial_position(*args, **kwargs)

Overloaded function.

  1. set_initial_position(self: pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[AutoDiffXd], context: pydrake.systems.framework.Context_[AutoDiffXd], position: numpy.ndarray[object[m, 1]]) -> None

Convenience method that sets the entire position history for the discrete-time derivative to a constant vector value (resulting in velocity estimate of zero). This is useful during initialization to avoid large derivative outputs. position must be the same size as the input/output ports. If suppress_initial_transient() is true, then also disables the suppression for this context.

Warning

This only changes the position history used for the velocity half of the output port; it has no effect on the feedthrough position.

  1. set_initial_position(self: pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[AutoDiffXd], state: pydrake.systems.framework.State_[AutoDiffXd], position: numpy.ndarray[object[m, 1]]) -> None

Convenience method that sets the entire position history for the discrete-time derivative to a constant vector value (resulting in velocity estimate of zero). This is useful during initialization to avoid large derivative outputs. position must be the same size as the input/output ports. If suppress_initial_transient() is true, then also disables the suppression for this state.

Warning

This only changes the position history used for the velocity half of the output port; it has no effect on the feedthrough position.

suppress_initial_transient(self: pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[AutoDiffXd]) → bool

Returns the suppress_initial_transient passed to the constructor.

class pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[Expression]

Bases: pydrake.systems.framework.Diagram_[Expression]

Supports the common pattern of combining a (feed-through) position with a velocity estimated with the DiscreteDerivative into a single output vector with positions and velocities stacked. This assumes that the number of positions == the number of velocities.

┌─────┐
position ───┬───────────────────>│     │
            │                    │ Mux ├──> state
            │   ┌────────────┐   │     │
            └──>│  Discrete  ├──>│     │
                │ Derivative │   └─────┘
                └────────────┘
position→
StateInterpolatorWithDiscreteDerivative
→ state
__init__(self: pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[Expression], num_positions: int, time_step: float, suppress_initial_transient: bool = False) → None

Constructor taking num_positions, the size of the position vector to be differentiated, and time_step, the sampling interval.

set_initial_position(*args, **kwargs)

Overloaded function.

  1. set_initial_position(self: pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[Expression], context: pydrake.systems.framework.Context_[Expression], position: numpy.ndarray[object[m, 1]]) -> None

Convenience method that sets the entire position history for the discrete-time derivative to a constant vector value (resulting in velocity estimate of zero). This is useful during initialization to avoid large derivative outputs. position must be the same size as the input/output ports. If suppress_initial_transient() is true, then also disables the suppression for this context.

Warning

This only changes the position history used for the velocity half of the output port; it has no effect on the feedthrough position.

  1. set_initial_position(self: pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[Expression], state: pydrake.systems.framework.State_[Expression], position: numpy.ndarray[object[m, 1]]) -> None

Convenience method that sets the entire position history for the discrete-time derivative to a constant vector value (resulting in velocity estimate of zero). This is useful during initialization to avoid large derivative outputs. position must be the same size as the input/output ports. If suppress_initial_transient() is true, then also disables the suppression for this state.

Warning

This only changes the position history used for the velocity half of the output port; it has no effect on the feedthrough position.

suppress_initial_transient(self: pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[Expression]) → bool

Returns the suppress_initial_transient passed to the constructor.

class pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[float]

Bases: pydrake.systems.framework.Diagram_[float]

Supports the common pattern of combining a (feed-through) position with a velocity estimated with the DiscreteDerivative into a single output vector with positions and velocities stacked. This assumes that the number of positions == the number of velocities.

┌─────┐
position ───┬───────────────────>│     │
            │                    │ Mux ├──> state
            │   ┌────────────┐   │     │
            └──>│  Discrete  ├──>│     │
                │ Derivative │   └─────┘
                └────────────┘
position→
StateInterpolatorWithDiscreteDerivative
→ state
__init__(self: pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[float], num_positions: int, time_step: float, suppress_initial_transient: bool = False) → None

Constructor taking num_positions, the size of the position vector to be differentiated, and time_step, the sampling interval.

set_initial_position(*args, **kwargs)

Overloaded function.

  1. set_initial_position(self: pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[float], context: pydrake.systems.framework.Context_[float], position: numpy.ndarray[numpy.float64[m, 1]]) -> None

Convenience method that sets the entire position history for the discrete-time derivative to a constant vector value (resulting in velocity estimate of zero). This is useful during initialization to avoid large derivative outputs. position must be the same size as the input/output ports. If suppress_initial_transient() is true, then also disables the suppression for this context.

Warning

This only changes the position history used for the velocity half of the output port; it has no effect on the feedthrough position.

  1. set_initial_position(self: pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[float], state: pydrake.systems.framework.State_[float], position: numpy.ndarray[numpy.float64[m, 1]]) -> None

Convenience method that sets the entire position history for the discrete-time derivative to a constant vector value (resulting in velocity estimate of zero). This is useful during initialization to avoid large derivative outputs. position must be the same size as the input/output ports. If suppress_initial_transient() is true, then also disables the suppression for this state.

Warning

This only changes the position history used for the velocity half of the output port; it has no effect on the feedthrough position.

suppress_initial_transient(self: pydrake.systems.primitives.StateInterpolatorWithDiscreteDerivative_[float]) → bool

Returns the suppress_initial_transient passed to the constructor.

pydrake.systems.primitives.SymbolicVectorSystem

alias of pydrake.systems.primitives.SymbolicVectorSystem_[float]

template pydrake.systems.primitives.SymbolicVectorSystem_

Instantiations: SymbolicVectorSystem_[float], SymbolicVectorSystem_[AutoDiffXd], SymbolicVectorSystem_[Expression]

class SymbolicVectorSystem_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

A LeafSystem that is defined by vectors of symbolic::Expression representing the dynamics and output. The resulting system has only zero or one vector input ports, zero or one vector of continuous or discrete state (depending on the specified time_period), zero or one vector of numeric parameters, and only zero or one vector output ports.

See SymbolicVectorSystemBuilder to make the construction a little nicer.

For example, to define the system: ẋ = -x + x³, y = x, we could write

symbolic::Variable x("x");
  auto system = SymbolicVectorSystemBuilder().state(x)
                                             .dynamics(-x + pow(x,3))
                                             .output(x)
                                             .Build();

Note: This will not be as performant as writing your own LeafSystem. It is meant primarily for rapid prototyping.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.SymbolicVectorSystem_[float], time: Optional[pydrake.symbolic.Variable] = None, state: numpy.ndarray[object[m, 1]] = array([], dtype=object), input: numpy.ndarray[object[m, 1]] = array([], dtype=object), dynamics: numpy.ndarray[object[m, 1]] = array([], dtype=object), output: numpy.ndarray[object[m, 1]] = array([], dtype=object), time_period: float = 0.0) -> None

Construct the SymbolicVectorSystem.

Parameter time:
an (optional) Variable used to represent time in the dynamics.
Parameter state:
an (optional) vector of Variables representing the state. The order in this vector will determine the order of the elements in the state vector. Each element must be unique.
Parameter input:
an (optional) vector of Variables representing the input. The order in this vector will determine the order of the elements in the vector-valued input port. Each element must be unique.
Parameter dynamics:
a vector of Expressions representing the dynamics of the system. If time_period == 0, then this describes the continuous time derivatives. If time_period > 0, then it defines the updates of the single discrete-valued state vector. The size of this vector must match the number of state variables.
Parameter output:
a vector of Expressions representing the output of the system. If empty, then no output port will be allocated.
Parameter time_period:
a scalar representing the period of a periodic update. time_period == 0.0 implies that the state variables will be declared as continuous state and the dynamics will be implemented as time derivatives. time_period > 0.0 implies the state variables will be declared as discrete state and the dynamics will be implemented as a dicraete variable update.
  1. __init__(self: pydrake.systems.primitives.SymbolicVectorSystem_[float], time: Optional[pydrake.symbolic.Variable] = None, state: numpy.ndarray[object[m, 1]] = array([], dtype=object), input: numpy.ndarray[object[m, 1]] = array([], dtype=object), parameter: numpy.ndarray[object[m, 1]] = array([], dtype=object), dynamics: numpy.ndarray[object[m, 1]] = array([], dtype=object), output: numpy.ndarray[object[m, 1]] = array([], dtype=object), time_period: float = 0.0) -> None

Construct the SymbolicVectorSystem.

Parameter time:
an (optional) Variable used to represent time in the dynamics.
Parameter state:
an (optional) vector of Variables representing the state. The order in this vector will determine the order of the elements in the state vector. Each element must be unique.
Parameter input:
an (optional) vector of Variables representing the input. The order in this vector will determine the order of the elements in the vector-valued input port. Each element must be unique.
Parameter parameter:
an (optional) vector of Variables representing the numeric parameter. The order in this vector will determine the order of the elements in the vector-valued parameter. Each element must be unique.
Parameter dynamics:
a vector of Expressions representing the dynamics of the system. If time_period == 0, then this describes the continuous time derivatives. If time_period > 0, then it defines the updates of the single discrete-valued state vector. The size of this vector must match the number of state variables.
Parameter output:
a vector of Expressions representing the output of the system. If empty, then no output port will be allocated.
Parameter time_period:
a scalar representing the period of a periodic update. time_period == 0.0 implies that the state variables will be declared as continuous state and the dynamics will be implemented as time derivatives. time_period > 0.0 implies the state variables will be declared as discrete state and the dynamics will be implemented as a dicraete variable update.
dynamics_for_variable(self: pydrake.systems.primitives.SymbolicVectorSystem_[float], var: pydrake.symbolic.Variable) → pydrake.symbolic.Expression

Returns the dynamics for the variable var. That is, it returns the scalar expression corresponding to either \dot{var} (continuous case) or var[n+1] (discrete case).

Raises:
  • ValueError if this system has no corresponding dynamics for the
  • variable var.
class pydrake.systems.primitives.SymbolicVectorSystem_[AutoDiffXd]

Bases: pydrake.systems.framework.LeafSystem_[AutoDiffXd]

A LeafSystem that is defined by vectors of symbolic::Expression representing the dynamics and output. The resulting system has only zero or one vector input ports, zero or one vector of continuous or discrete state (depending on the specified time_period), zero or one vector of numeric parameters, and only zero or one vector output ports.

See SymbolicVectorSystemBuilder to make the construction a little nicer.

For example, to define the system: ẋ = -x + x³, y = x, we could write

symbolic::Variable x("x");
  auto system = SymbolicVectorSystemBuilder().state(x)
                                             .dynamics(-x + pow(x,3))
                                             .output(x)
                                             .Build();

Note: This will not be as performant as writing your own LeafSystem. It is meant primarily for rapid prototyping.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.SymbolicVectorSystem_[AutoDiffXd], time: Optional[pydrake.symbolic.Variable] = None, state: numpy.ndarray[object[m, 1]] = array([], dtype=object), input: numpy.ndarray[object[m, 1]] = array([], dtype=object), dynamics: numpy.ndarray[object[m, 1]] = array([], dtype=object), output: numpy.ndarray[object[m, 1]] = array([], dtype=object), time_period: float = 0.0) -> None

Construct the SymbolicVectorSystem.

Parameter time:
an (optional) Variable used to represent time in the dynamics.
Parameter state:
an (optional) vector of Variables representing the state. The order in this vector will determine the order of the elements in the state vector. Each element must be unique.
Parameter input:
an (optional) vector of Variables representing the input. The order in this vector will determine the order of the elements in the vector-valued input port. Each element must be unique.
Parameter dynamics:
a vector of Expressions representing the dynamics of the system. If time_period == 0, then this describes the continuous time derivatives. If time_period > 0, then it defines the updates of the single discrete-valued state vector. The size of this vector must match the number of state variables.
Parameter output:
a vector of Expressions representing the output of the system. If empty, then no output port will be allocated.
Parameter time_period:
a scalar representing the period of a periodic update. time_period == 0.0 implies that the state variables will be declared as continuous state and the dynamics will be implemented as time derivatives. time_period > 0.0 implies the state variables will be declared as discrete state and the dynamics will be implemented as a dicraete variable update.
  1. __init__(self: pydrake.systems.primitives.SymbolicVectorSystem_[AutoDiffXd], time: Optional[pydrake.symbolic.Variable] = None, state: numpy.ndarray[object[m, 1]] = array([], dtype=object), input: numpy.ndarray[object[m, 1]] = array([], dtype=object), parameter: numpy.ndarray[object[m, 1]] = array([], dtype=object), dynamics: numpy.ndarray[object[m, 1]] = array([], dtype=object), output: numpy.ndarray[object[m, 1]] = array([], dtype=object), time_period: float = 0.0) -> None

Construct the SymbolicVectorSystem.

Parameter time:
an (optional) Variable used to represent time in the dynamics.
Parameter state:
an (optional) vector of Variables representing the state. The order in this vector will determine the order of the elements in the state vector. Each element must be unique.
Parameter input:
an (optional) vector of Variables representing the input. The order in this vector will determine the order of the elements in the vector-valued input port. Each element must be unique.
Parameter parameter:
an (optional) vector of Variables representing the numeric parameter. The order in this vector will determine the order of the elements in the vector-valued parameter. Each element must be unique.
Parameter dynamics:
a vector of Expressions representing the dynamics of the system. If time_period == 0, then this describes the continuous time derivatives. If time_period > 0, then it defines the updates of the single discrete-valued state vector. The size of this vector must match the number of state variables.
Parameter output:
a vector of Expressions representing the output of the system. If empty, then no output port will be allocated.
Parameter time_period:
a scalar representing the period of a periodic update. time_period == 0.0 implies that the state variables will be declared as continuous state and the dynamics will be implemented as time derivatives. time_period > 0.0 implies the state variables will be declared as discrete state and the dynamics will be implemented as a dicraete variable update.
dynamics_for_variable(self: pydrake.systems.primitives.SymbolicVectorSystem_[AutoDiffXd], var: pydrake.symbolic.Variable) → pydrake.symbolic.Expression

Returns the dynamics for the variable var. That is, it returns the scalar expression corresponding to either \dot{var} (continuous case) or var[n+1] (discrete case).

Raises:
  • ValueError if this system has no corresponding dynamics for the
  • variable var.
class pydrake.systems.primitives.SymbolicVectorSystem_[Expression]

Bases: pydrake.systems.framework.LeafSystem_[Expression]

A LeafSystem that is defined by vectors of symbolic::Expression representing the dynamics and output. The resulting system has only zero or one vector input ports, zero or one vector of continuous or discrete state (depending on the specified time_period), zero or one vector of numeric parameters, and only zero or one vector output ports.

See SymbolicVectorSystemBuilder to make the construction a little nicer.

For example, to define the system: ẋ = -x + x³, y = x, we could write

symbolic::Variable x("x");
  auto system = SymbolicVectorSystemBuilder().state(x)
                                             .dynamics(-x + pow(x,3))
                                             .output(x)
                                             .Build();

Note: This will not be as performant as writing your own LeafSystem. It is meant primarily for rapid prototyping.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.SymbolicVectorSystem_[Expression], time: Optional[pydrake.symbolic.Variable] = None, state: numpy.ndarray[object[m, 1]] = array([], dtype=object), input: numpy.ndarray[object[m, 1]] = array([], dtype=object), dynamics: numpy.ndarray[object[m, 1]] = array([], dtype=object), output: numpy.ndarray[object[m, 1]] = array([], dtype=object), time_period: float = 0.0) -> None

Construct the SymbolicVectorSystem.

Parameter time:
an (optional) Variable used to represent time in the dynamics.
Parameter state:
an (optional) vector of Variables representing the state. The order in this vector will determine the order of the elements in the state vector. Each element must be unique.
Parameter input:
an (optional) vector of Variables representing the input. The order in this vector will determine the order of the elements in the vector-valued input port. Each element must be unique.
Parameter dynamics:
a vector of Expressions representing the dynamics of the system. If time_period == 0, then this describes the continuous time derivatives. If time_period > 0, then it defines the updates of the single discrete-valued state vector. The size of this vector must match the number of state variables.
Parameter output:
a vector of Expressions representing the output of the system. If empty, then no output port will be allocated.
Parameter time_period:
a scalar representing the period of a periodic update. time_period == 0.0 implies that the state variables will be declared as continuous state and the dynamics will be implemented as time derivatives. time_period > 0.0 implies the state variables will be declared as discrete state and the dynamics will be implemented as a dicraete variable update.
  1. __init__(self: pydrake.systems.primitives.SymbolicVectorSystem_[Expression], time: Optional[pydrake.symbolic.Variable] = None, state: numpy.ndarray[object[m, 1]] = array([], dtype=object), input: numpy.ndarray[object[m, 1]] = array([], dtype=object), parameter: numpy.ndarray[object[m, 1]] = array([], dtype=object), dynamics: numpy.ndarray[object[m, 1]] = array([], dtype=object), output: numpy.ndarray[object[m, 1]] = array([], dtype=object), time_period: float = 0.0) -> None

Construct the SymbolicVectorSystem.

Parameter time:
an (optional) Variable used to represent time in the dynamics.
Parameter state:
an (optional) vector of Variables representing the state. The order in this vector will determine the order of the elements in the state vector. Each element must be unique.
Parameter input:
an (optional) vector of Variables representing the input. The order in this vector will determine the order of the elements in the vector-valued input port. Each element must be unique.
Parameter parameter:
an (optional) vector of Variables representing the numeric parameter. The order in this vector will determine the order of the elements in the vector-valued parameter. Each element must be unique.
Parameter dynamics:
a vector of Expressions representing the dynamics of the system. If time_period == 0, then this describes the continuous time derivatives. If time_period > 0, then it defines the updates of the single discrete-valued state vector. The size of this vector must match the number of state variables.
Parameter output:
a vector of Expressions representing the output of the system. If empty, then no output port will be allocated.
Parameter time_period:
a scalar representing the period of a periodic update. time_period == 0.0 implies that the state variables will be declared as continuous state and the dynamics will be implemented as time derivatives. time_period > 0.0 implies the state variables will be declared as discrete state and the dynamics will be implemented as a dicraete variable update.
dynamics_for_variable(self: pydrake.systems.primitives.SymbolicVectorSystem_[Expression], var: pydrake.symbolic.Variable) → pydrake.symbolic.Expression

Returns the dynamics for the variable var. That is, it returns the scalar expression corresponding to either \dot{var} (continuous case) or var[n+1] (discrete case).

Raises:
  • ValueError if this system has no corresponding dynamics for the
  • variable var.
class pydrake.systems.primitives.SymbolicVectorSystem_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

A LeafSystem that is defined by vectors of symbolic::Expression representing the dynamics and output. The resulting system has only zero or one vector input ports, zero or one vector of continuous or discrete state (depending on the specified time_period), zero or one vector of numeric parameters, and only zero or one vector output ports.

See SymbolicVectorSystemBuilder to make the construction a little nicer.

For example, to define the system: ẋ = -x + x³, y = x, we could write

symbolic::Variable x("x");
  auto system = SymbolicVectorSystemBuilder().state(x)
                                             .dynamics(-x + pow(x,3))
                                             .output(x)
                                             .Build();

Note: This will not be as performant as writing your own LeafSystem. It is meant primarily for rapid prototyping.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.SymbolicVectorSystem_[float], time: Optional[pydrake.symbolic.Variable] = None, state: numpy.ndarray[object[m, 1]] = array([], dtype=object), input: numpy.ndarray[object[m, 1]] = array([], dtype=object), dynamics: numpy.ndarray[object[m, 1]] = array([], dtype=object), output: numpy.ndarray[object[m, 1]] = array([], dtype=object), time_period: float = 0.0) -> None

Construct the SymbolicVectorSystem.

Parameter time:
an (optional) Variable used to represent time in the dynamics.
Parameter state:
an (optional) vector of Variables representing the state. The order in this vector will determine the order of the elements in the state vector. Each element must be unique.
Parameter input:
an (optional) vector of Variables representing the input. The order in this vector will determine the order of the elements in the vector-valued input port. Each element must be unique.
Parameter dynamics:
a vector of Expressions representing the dynamics of the system. If time_period == 0, then this describes the continuous time derivatives. If time_period > 0, then it defines the updates of the single discrete-valued state vector. The size of this vector must match the number of state variables.
Parameter output:
a vector of Expressions representing the output of the system. If empty, then no output port will be allocated.
Parameter time_period:
a scalar representing the period of a periodic update. time_period == 0.0 implies that the state variables will be declared as continuous state and the dynamics will be implemented as time derivatives. time_period > 0.0 implies the state variables will be declared as discrete state and the dynamics will be implemented as a dicraete variable update.
  1. __init__(self: pydrake.systems.primitives.SymbolicVectorSystem_[float], time: Optional[pydrake.symbolic.Variable] = None, state: numpy.ndarray[object[m, 1]] = array([], dtype=object), input: numpy.ndarray[object[m, 1]] = array([], dtype=object), parameter: numpy.ndarray[object[m, 1]] = array([], dtype=object), dynamics: numpy.ndarray[object[m, 1]] = array([], dtype=object), output: numpy.ndarray[object[m, 1]] = array([], dtype=object), time_period: float = 0.0) -> None

Construct the SymbolicVectorSystem.

Parameter time:
an (optional) Variable used to represent time in the dynamics.
Parameter state:
an (optional) vector of Variables representing the state. The order in this vector will determine the order of the elements in the state vector. Each element must be unique.
Parameter input:
an (optional) vector of Variables representing the input. The order in this vector will determine the order of the elements in the vector-valued input port. Each element must be unique.
Parameter parameter:
an (optional) vector of Variables representing the numeric parameter. The order in this vector will determine the order of the elements in the vector-valued parameter. Each element must be unique.
Parameter dynamics:
a vector of Expressions representing the dynamics of the system. If time_period == 0, then this describes the continuous time derivatives. If time_period > 0, then it defines the updates of the single discrete-valued state vector. The size of this vector must match the number of state variables.
Parameter output:
a vector of Expressions representing the output of the system. If empty, then no output port will be allocated.
Parameter time_period:
a scalar representing the period of a periodic update. time_period == 0.0 implies that the state variables will be declared as continuous state and the dynamics will be implemented as time derivatives. time_period > 0.0 implies the state variables will be declared as discrete state and the dynamics will be implemented as a dicraete variable update.
dynamics_for_variable(self: pydrake.systems.primitives.SymbolicVectorSystem_[float], var: pydrake.symbolic.Variable) → pydrake.symbolic.Expression

Returns the dynamics for the variable var. That is, it returns the scalar expression corresponding to either \dot{var} (continuous case) or var[n+1] (discrete case).

Raises:
  • ValueError if this system has no corresponding dynamics for the
  • variable var.
class pydrake.systems.primitives.TrajectorySource

Bases: pydrake.systems.framework.LeafSystem_[float]

A source block that generates the value of a Trajectory for a given time. The output is vector values, and may vary with the time (as reflected in the context) at which the output is evaluated.

__init__(self: pydrake.systems.primitives.TrajectorySource, trajectory: pydrake.trajectories.Trajectory, output_derivative_order: int = 0, zero_derivatives_beyond_limits: bool = True) → None
Parameter trajectory:
Trajectory used by the system.
Parameter output_derivative_order:
The number of times to take the derivative. Must be greater than or equal to zero.
Parameter zero_derivatives_beyond_limits:
All derivatives will be zero before the start time or after the end time of trajectory.
pydrake.systems.primitives.WrapToSystem

alias of pydrake.systems.primitives.WrapToSystem_[float]

template pydrake.systems.primitives.WrapToSystem_

Instantiations: WrapToSystem_[float], WrapToSystem_[AutoDiffXd], WrapToSystem_[Expression]

class WrapToSystem_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

An element-wise wrapping block that transforms the specified indices of the input signal u into the interval [low, high). Precisely, the output element i is given the value:

outputᵢ = inputᵢ + kᵢ*(highᵢ-lowᵢ)

for the unique integer value kᵢ that lands the output in the desired interval.

__init__(self: pydrake.systems.primitives.WrapToSystem_[float], arg0: int) → None

Constructs a system to pass through a fixed-size input vector to the output. Additional calls to set_interval() are required to produce any wrapping behavior.

set_interval(self: pydrake.systems.primitives.WrapToSystem_[float], arg0: int, arg1: float, arg2: float) → None

Sets the system to wrap the index element of the input vector to the interval [low, high). If this method is called multiple times for the same index, then only the last interval will be used. low and high should be finite, and low < high.

class pydrake.systems.primitives.WrapToSystem_[AutoDiffXd]

Bases: pydrake.systems.framework.LeafSystem_[AutoDiffXd]

An element-wise wrapping block that transforms the specified indices of the input signal u into the interval [low, high). Precisely, the output element i is given the value:

outputᵢ = inputᵢ + kᵢ*(highᵢ-lowᵢ)

for the unique integer value kᵢ that lands the output in the desired interval.

__init__(self: pydrake.systems.primitives.WrapToSystem_[AutoDiffXd], arg0: int) → None

Constructs a system to pass through a fixed-size input vector to the output. Additional calls to set_interval() are required to produce any wrapping behavior.

set_interval(self: pydrake.systems.primitives.WrapToSystem_[AutoDiffXd], arg0: int, arg1: pydrake.autodiffutils.AutoDiffXd, arg2: pydrake.autodiffutils.AutoDiffXd) → None

Sets the system to wrap the index element of the input vector to the interval [low, high). If this method is called multiple times for the same index, then only the last interval will be used. low and high should be finite, and low < high.

class pydrake.systems.primitives.WrapToSystem_[Expression]

Bases: pydrake.systems.framework.LeafSystem_[Expression]

An element-wise wrapping block that transforms the specified indices of the input signal u into the interval [low, high). Precisely, the output element i is given the value:

outputᵢ = inputᵢ + kᵢ*(highᵢ-lowᵢ)

for the unique integer value kᵢ that lands the output in the desired interval.

__init__(self: pydrake.systems.primitives.WrapToSystem_[Expression], arg0: int) → None

Constructs a system to pass through a fixed-size input vector to the output. Additional calls to set_interval() are required to produce any wrapping behavior.

set_interval(self: pydrake.systems.primitives.WrapToSystem_[Expression], arg0: int, arg1: pydrake.symbolic.Expression, arg2: pydrake.symbolic.Expression) → None

Sets the system to wrap the index element of the input vector to the interval [low, high). If this method is called multiple times for the same index, then only the last interval will be used. low and high should be finite, and low < high.

class pydrake.systems.primitives.WrapToSystem_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

An element-wise wrapping block that transforms the specified indices of the input signal u into the interval [low, high). Precisely, the output element i is given the value:

outputᵢ = inputᵢ + kᵢ*(highᵢ-lowᵢ)

for the unique integer value kᵢ that lands the output in the desired interval.

__init__(self: pydrake.systems.primitives.WrapToSystem_[float], arg0: int) → None

Constructs a system to pass through a fixed-size input vector to the output. Additional calls to set_interval() are required to produce any wrapping behavior.

set_interval(self: pydrake.systems.primitives.WrapToSystem_[float], arg0: int, arg1: float, arg2: float) → None

Sets the system to wrap the index element of the input vector to the interval [low, high). If this method is called multiple times for the same index, then only the last interval will be used. low and high should be finite, and low < high.

pydrake.systems.primitives.ZeroOrderHold

alias of pydrake.systems.primitives.ZeroOrderHold_[float]

template pydrake.systems.primitives.ZeroOrderHold_

Instantiations: ZeroOrderHold_[float], ZeroOrderHold_[AutoDiffXd], ZeroOrderHold_[Expression]

class ZeroOrderHold_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

A zero order hold block with input u, which may be vector-valued (discrete or continuous) or abstract, and discrete output y, where the y is sampled from u with a fixed period.

u→
ZeroOrderHold
→ y

The discrete state space dynamics of ZeroOrderHold is:

xₙ₊₁ = uₙ     // update
  yₙ   = xₙ     // output
  x₀   = xᵢₙᵢₜ  // initialize

where xᵢₙᵢₜ = 0 for vector-valued ZeroOrderHold, and xᵢₙᵢₜ is a given value for abstract-valued ZeroOrderHold.

See discrete_systems “Discrete Systems” for general information about discrete systems in Drake, including how they interact with continuous systems.

Note

This system uses a periodic update with zero offset, so the first update occurs at t=0. When used with a Simulator, the output port is equal to xᵢₙᵢₜ after simulator.Initialize(), but is immediately updated to u₀ at the start of the first step. If you want to force that initial update, use simulator.AdvanceTo(0.).

Note

For an abstract-valued ZeroOrderHold, scalar-type conversion is not supported since AbstractValue does not support it.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.ZeroOrderHold_[float], period_sec: float, vector_size: int) -> None

Constructs a ZeroOrderHold system with the given period_sec, over a vector-valued input of size vector_size. The default initial value for this system will be zero. The offset is always zero, meaning that the first update occurs at t=0.

  1. __init__(self: pydrake.systems.primitives.ZeroOrderHold_[float], period_sec: float, abstract_model_value: pydrake.common.value.AbstractValue) -> None

Constructs a ZeroOrderHold system with the given period_sec, over a abstract-valued input abstract_model_value. The default initial value for this system will be abstract_model_value. The offset is always zero, meaning that the first update occurs at t=0.

class pydrake.systems.primitives.ZeroOrderHold_[AutoDiffXd]

Bases: pydrake.systems.framework.LeafSystem_[AutoDiffXd]

A zero order hold block with input u, which may be vector-valued (discrete or continuous) or abstract, and discrete output y, where the y is sampled from u with a fixed period.

u→
ZeroOrderHold
→ y

The discrete state space dynamics of ZeroOrderHold is:

xₙ₊₁ = uₙ     // update
  yₙ   = xₙ     // output
  x₀   = xᵢₙᵢₜ  // initialize

where xᵢₙᵢₜ = 0 for vector-valued ZeroOrderHold, and xᵢₙᵢₜ is a given value for abstract-valued ZeroOrderHold.

See discrete_systems “Discrete Systems” for general information about discrete systems in Drake, including how they interact with continuous systems.

Note

This system uses a periodic update with zero offset, so the first update occurs at t=0. When used with a Simulator, the output port is equal to xᵢₙᵢₜ after simulator.Initialize(), but is immediately updated to u₀ at the start of the first step. If you want to force that initial update, use simulator.AdvanceTo(0.).

Note

For an abstract-valued ZeroOrderHold, scalar-type conversion is not supported since AbstractValue does not support it.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.ZeroOrderHold_[AutoDiffXd], period_sec: float, vector_size: int) -> None

Constructs a ZeroOrderHold system with the given period_sec, over a vector-valued input of size vector_size. The default initial value for this system will be zero. The offset is always zero, meaning that the first update occurs at t=0.

  1. __init__(self: pydrake.systems.primitives.ZeroOrderHold_[AutoDiffXd], period_sec: float, abstract_model_value: pydrake.common.value.AbstractValue) -> None

Constructs a ZeroOrderHold system with the given period_sec, over a abstract-valued input abstract_model_value. The default initial value for this system will be abstract_model_value. The offset is always zero, meaning that the first update occurs at t=0.

class pydrake.systems.primitives.ZeroOrderHold_[Expression]

Bases: pydrake.systems.framework.LeafSystem_[Expression]

A zero order hold block with input u, which may be vector-valued (discrete or continuous) or abstract, and discrete output y, where the y is sampled from u with a fixed period.

u→
ZeroOrderHold
→ y

The discrete state space dynamics of ZeroOrderHold is:

xₙ₊₁ = uₙ     // update
  yₙ   = xₙ     // output
  x₀   = xᵢₙᵢₜ  // initialize

where xᵢₙᵢₜ = 0 for vector-valued ZeroOrderHold, and xᵢₙᵢₜ is a given value for abstract-valued ZeroOrderHold.

See discrete_systems “Discrete Systems” for general information about discrete systems in Drake, including how they interact with continuous systems.

Note

This system uses a periodic update with zero offset, so the first update occurs at t=0. When used with a Simulator, the output port is equal to xᵢₙᵢₜ after simulator.Initialize(), but is immediately updated to u₀ at the start of the first step. If you want to force that initial update, use simulator.AdvanceTo(0.).

Note

For an abstract-valued ZeroOrderHold, scalar-type conversion is not supported since AbstractValue does not support it.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.ZeroOrderHold_[Expression], period_sec: float, vector_size: int) -> None

Constructs a ZeroOrderHold system with the given period_sec, over a vector-valued input of size vector_size. The default initial value for this system will be zero. The offset is always zero, meaning that the first update occurs at t=0.

  1. __init__(self: pydrake.systems.primitives.ZeroOrderHold_[Expression], period_sec: float, abstract_model_value: pydrake.common.value.AbstractValue) -> None

Constructs a ZeroOrderHold system with the given period_sec, over a abstract-valued input abstract_model_value. The default initial value for this system will be abstract_model_value. The offset is always zero, meaning that the first update occurs at t=0.

class pydrake.systems.primitives.ZeroOrderHold_[float]

Bases: pydrake.systems.framework.LeafSystem_[float]

A zero order hold block with input u, which may be vector-valued (discrete or continuous) or abstract, and discrete output y, where the y is sampled from u with a fixed period.

u→
ZeroOrderHold
→ y

The discrete state space dynamics of ZeroOrderHold is:

xₙ₊₁ = uₙ     // update
  yₙ   = xₙ     // output
  x₀   = xᵢₙᵢₜ  // initialize

where xᵢₙᵢₜ = 0 for vector-valued ZeroOrderHold, and xᵢₙᵢₜ is a given value for abstract-valued ZeroOrderHold.

See discrete_systems “Discrete Systems” for general information about discrete systems in Drake, including how they interact with continuous systems.

Note

This system uses a periodic update with zero offset, so the first update occurs at t=0. When used with a Simulator, the output port is equal to xᵢₙᵢₜ after simulator.Initialize(), but is immediately updated to u₀ at the start of the first step. If you want to force that initial update, use simulator.AdvanceTo(0.).

Note

For an abstract-valued ZeroOrderHold, scalar-type conversion is not supported since AbstractValue does not support it.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.systems.primitives.ZeroOrderHold_[float], period_sec: float, vector_size: int) -> None

Constructs a ZeroOrderHold system with the given period_sec, over a vector-valued input of size vector_size. The default initial value for this system will be zero. The offset is always zero, meaning that the first update occurs at t=0.

  1. __init__(self: pydrake.systems.primitives.ZeroOrderHold_[float], period_sec: float, abstract_model_value: pydrake.common.value.AbstractValue) -> None

Constructs a ZeroOrderHold system with the given period_sec, over a abstract-valued input abstract_model_value. The default initial value for this system will be abstract_model_value. The offset is always zero, meaning that the first update occurs at t=0.