Drake
DiagramContinuousState< T > Class Template Reference

DiagramContinuousState is a ContinuousState consisting of Supervectors over a set of constituent ContinuousStates. More...

#include <systems/framework/diagram_continuous_state.h>

Inheritance diagram for DiagramContinuousState< T >:
[legend]
Collaboration diagram for DiagramContinuousState< T >:
[legend]

Public Member Functions

 DiagramContinuousState (std::vector< ContinuousState< T > * > substates)
 Constructs a ContinuousState that is composed of other ContinuousStates, which are not owned by this object and must outlive it. More...
 
 ~DiagramContinuousState () override
 
int get_num_substates () const
 
const ContinuousState< T > * get_substate (int index) const
 Returns the continuous state at the given index. More...
 
ContinuousState< T > * get_mutable_substate (int index)
 Returns the continuous state at the given index. More...
 
Does not allow copy, move, or assignment
 DiagramContinuousState (const DiagramContinuousState &)=delete
 
DiagramContinuousStateoperator= (const DiagramContinuousState &)=delete
 
 DiagramContinuousState (DiagramContinuousState &&)=delete
 
DiagramContinuousStateoperator= (DiagramContinuousState &&)=delete
 
- Public Member Functions inherited from ContinuousState< T >
 ContinuousState (std::unique_ptr< VectorBase< T >> state)
 Constructs a ContinuousState for a system that does not have second-order structure. More...
 
 ContinuousState (std::unique_ptr< VectorBase< T >> state, int num_q, int num_v, int num_z)
 Constructs a ContinuousState that exposes second-order structure. More...
 
 ContinuousState ()
 Constructs a zero-length ContinuousState. More...
 
virtual ~ContinuousState ()
 
int size () const
 Returns the size of the entire continuous state vector. More...
 
Toperator[] (std::size_t idx)
 
const Toperator[] (std::size_t idx) const
 
const VectorBase< T > & get_vector () const
 Returns a reference to the entire continuous state vector. More...
 
VectorBase< T > & get_mutable_vector ()
 Returns a mutable reference to the entire continuous state vector. More...
 
const VectorBase< T > & get_generalized_position () const
 Returns a const reference to the subset of the state vector that is generalized position q. More...
 
VectorBase< T > & get_mutable_generalized_position ()
 Returns a mutable reference to the subset of the state vector that is generalized position q. More...
 
const VectorBase< T > & get_generalized_velocity () const
 Returns a const reference to the subset of the continuous state vector that is generalized velocity v. More...
 
VectorBase< T > & get_mutable_generalized_velocity ()
 Returns a mutable reference to the subset of the continuous state vector that is generalized velocity v. More...
 
const VectorBase< T > & get_misc_continuous_state () const
 Returns a const reference to the subset of the continuous state vector that is other continuous state z. More...
 
VectorBase< T > & get_mutable_misc_continuous_state ()
 Returns a mutable reference to the subset of the continuous state vector that is other continuous state z. More...
 
void CopyFrom (const ContinuousState< T > &other)
 Copies the values from another ContinuousState of the same scalar type into this State. More...
 
void SetFrom (const ContinuousState< double > &other)
 Initializes this ContinuousState (regardless of scalar type) from a State<double>. More...
 
void SetFromVector (const Eigen::Ref< const VectorX< T >> &value)
 Sets the entire continuous state vector from an Eigen expression. More...
 
VectorX< TCopyToVector () const
 Returns a copy of the entire continuous state vector into an Eigen vector. More...
 
 ContinuousState (const ContinuousState &)=delete
 
ContinuousStateoperator= (const ContinuousState &)=delete
 
 ContinuousState (ContinuousState &&)=delete
 
ContinuousStateoperator= (ContinuousState &&)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from ContinuousState< T >
 ContinuousState (std::unique_ptr< VectorBase< T >> state, std::unique_ptr< VectorBase< T >> q, std::unique_ptr< VectorBase< T >> v, std::unique_ptr< VectorBase< T >> z)
 Constructs a continuous state that exposes second-order structure, with no particular constraints on the layout. More...
 

Detailed Description

template<typename T>
class drake::systems::DiagramContinuousState< T >

DiagramContinuousState is a ContinuousState consisting of Supervectors over a set of constituent ContinuousStates.

Template Parameters
TThe type of the output data. Must be a valid Eigen scalar.

Constructor & Destructor Documentation

DiagramContinuousState ( std::vector< ContinuousState< T > * >  substates)
inlineexplicit

Constructs a ContinuousState that is composed of other ContinuousStates, which are not owned by this object and must outlive it.

The DiagramContinuousState vector xc = [q v z] will have the same ordering as the substates parameter, which should be the order of the Diagram itself. This fact is an implementation detail that should only be of interest to framework authors. Everyone else can just use Diagram<T>::GetMutableSubsystemState.

~DiagramContinuousState ( )
inlineoverride

Member Function Documentation

ContinuousState<T>* get_mutable_substate ( int  index)
inline

Returns the continuous state at the given index.

Aborts if index is out-of-bounds.

Here is the call graph for this function:

int get_num_substates ( ) const
inline

Here is the caller graph for this function:

const ContinuousState<T>* get_substate ( int  index) const
inline

Returns the continuous state at the given index.

Aborts if index is out-of-bounds.

Here is the call graph for this function:

DiagramContinuousState& operator= ( const DiagramContinuousState< T > &  )
delete
DiagramContinuousState& operator= ( DiagramContinuousState< T > &&  )
delete

The documentation for this class was generated from the following file: