Drake
|
A template interface for Systems that have continuous dynamics. More...
#include <drake/systems/framework/continuous_system_interface.h>
Public Member Functions | |
virtual std::unique_ptr< ContinuousState< T > > | AllocateTimeDerivatives () const =0 |
Returns a ContinuousState of the same size as the continuous_state allocated in CreateDefaultContext. More... | |
virtual void | EvalTimeDerivatives (const Context< T > &context, ContinuousState< T > *derivatives) const =0 |
Produces the derivatives of the continuous state xc with respect to time. More... | |
virtual void | MapVelocityToConfigurationDerivatives (const Context< T > &context, const StateVector< T > &generalized_velocity, StateVector< T > *configuration_derivatives) const =0 |
Transforms the velocity (v) in the given Context state to the derivative of the configuration (qdot). More... | |
virtual T | EvalConservativePower (const Context< T > &context) const |
Return the rate at which mechanical energy is being converted from potential energy to kinetic energy by this system in the given Context. More... | |
virtual T | EvalNonConservativePower (const Context< T > &context) const |
Return the rate at which mechanical energy is being generated (positive) or dissipated (negative) other than by conversion between potential and kinetic energy (in the given Context). More... | |
Public Member Functions inherited from SystemInterface< T > | |
virtual std::unique_ptr< Context< T > > | CreateDefaultContext () const =0 |
Returns a default context, initialized with the correct numbers of concrete input ports and state variables for this System. More... | |
virtual std::unique_ptr< SystemOutput< T > > | AllocateOutput () const =0 |
Returns a default output, initialized with the correct number of concrete output ports for this System. More... | |
virtual void | EvalOutput (const Context< T > &context, SystemOutput< T > *output) const =0 |
Computes the output for the given context, possibly updating values in the cache. More... | |
virtual T | EvalPotentialEnergy (const Context< T > &context) const |
Return the potential energy currently stored in the configuration provided in the given Context. More... | |
virtual T | EvalKineticEnergy (const Context< T > &context) const |
Return the kinetic energy currently present in the motion provided in the given Context. More... | |
Public Member Functions inherited from AbstractSystemInterface | |
virtual | ~AbstractSystemInterface () |
virtual std::string | get_name () const =0 |
Returns the name of this System. More... | |
Protected Member Functions | |
ContinuousSystemInterface () | |
Protected Member Functions inherited from SystemInterface< T > | |
SystemInterface () | |
Protected Member Functions inherited from AbstractSystemInterface | |
AbstractSystemInterface () | |
A template interface for Systems that have continuous dynamics.
|
inlineprotected |
|
pure virtual |
Returns a ContinuousState of the same size as the continuous_state allocated in CreateDefaultContext.
Solvers will provide this state as the output argument to EvalTimeDerivatives.
|
inlinevirtual |
Return the rate at which mechanical energy is being converted from potential energy to kinetic energy by this system in the given Context.
This quantity will be positive when potential energy is decreasing. Note that kinetic energy will also be affected by non-conservative forces so we can't say which direction it is moving, only whether the conservative power is increasing or decreasing the kinetic energy. Power is in watts (J/s). This method is meaningful only for physical systems; others return 0.
|
inlinevirtual |
Return the rate at which mechanical energy is being generated (positive) or dissipated (negative) other than by conversion between potential and kinetic energy (in the given Context).
Integrating this quantity yields work W, and the total energy E=PE+KE-W
should be conserved by any physically-correct model, to within integration accuracy of W. Power is in watts (J/s). (Watts are abbreviated W but not to be confused with work!) This method is meaningful only for physical systems; others return 0.
|
pure virtual |
Produces the derivatives of the continuous state xc with respect to time.
The derivatives
vector will correspond elementwise with the state vector Context.state.continuous_state.get_state(). Thus, if the state in the Context has second-order structure, that same structure applies to the derivatives.
Implementations may assume that the given derivatives
argument has the same constituent structure as was produced by AllocateTimeDerivatives.
derivatives | The output vector. Will be the same length as the state vector Context.state.continuous_state. |
|
pure virtual |
Transforms the velocity (v) in the given Context state to the derivative of the configuration (qdot).
The transformation must be linear in velocity (qdot = N(q) * v), and it must require no more than O(N) time to compute in the number of generalized velocity states.
Implementations may assume that configuration_derivatives
is of the same size as the generalized position allocated in CreateDefaultContext()->continuous_state.get_generalized_position(), and should populate it with elementwise-corresponding derivatives of position. Implementations that are not second-order systems may simply do nothing.
context | The complete evaluation context. |
generalized_velocity | The velocity to transform. |
configuration_derivatives | The output vector. Must not be nullptr. |
Implemented in ContinuousSystem< T >.