RcsPySim
A robot control and simulation library
Rcs::OMComputedVelocity Class Referenceabstract

#include <OMComputedVelocity.h>

Inheritance diagram for Rcs::OMComputedVelocity:
Collaboration diagram for Rcs::OMComputedVelocity:

Public Member Functions

 OMComputedVelocity ()
 
virtual ~OMComputedVelocity ()
 
void computeObservation (double *state, double *velocity, const MatNd *currentAction, double dt) const final
 
virtual void reset ()
 
virtual void computeState (double *state, const MatNd *currentAction, double dt) const =0
 
- Public Member Functions inherited from Rcs::ObservationModel
virtual ~ObservationModel ()
 
MatNd * computeObservation (const MatNd *currentAction, double dt) const
 
void computeObservation (MatNd *observation, const MatNd *currentAction, double dt) const
 
virtual unsigned int getStateDim () const =0
 
virtual unsigned int getVelocityDim () const
 
virtual void getLimits (double *minState, double *maxState, double *maxVelocity) const
 
virtual std::vector< std::string > getStateNames () const
 
virtual std::vector< std::string > getVelocityNames () const
 
virtual void getMinMax (double *min, double *max) const final
 
virtual unsigned int getDim () const final
 
virtual std::vector< std::string > getNames () const final
 
template<typename OM >
OM * findModel ()
 
template<typename OM >
Offsets findOffsets ()
 
virtual std::vector< ObservationModel * > getNested () const
 
- Public Member Functions inherited from Rcs::BoxSpaceProvider
 BoxSpaceProvider ()
 
virtual ~BoxSpaceProvider ()
 
 BoxSpaceProvider (const BoxSpaceProvider &)=delete
 
BoxSpaceProvideroperator= (const BoxSpaceProvider &)=delete
 
 BoxSpaceProvider (BoxSpaceProvider &&)=delete
 
BoxSpaceProvideroperator= (BoxSpaceProvider &&)=delete
 
const BoxSpacegetSpace () const
 

Private Attributes

MatNd * lastState
 

Detailed Description

An observation model that computes the velocity using finite differences. Use this observation model if the velocity can not be or is not observed directly from the simulation.

Definition at line 43 of file OMComputedVelocity.h.

Constructor & Destructor Documentation

◆ OMComputedVelocity()

Rcs::OMComputedVelocity::OMComputedVelocity ( )

Definition at line 38 of file OMComputedVelocity.cpp.

◆ ~OMComputedVelocity()

Rcs::OMComputedVelocity::~OMComputedVelocity ( )
virtual

Definition at line 40 of file OMComputedVelocity.cpp.

Member Function Documentation

◆ computeObservation()

void Rcs::OMComputedVelocity::computeObservation ( double *  state,
double *  velocity,
const MatNd *  currentAction,
double  dt 
) const
finalvirtual

Implement to fill the observation vector with the observed values.

Parameters
[out]statestate observation vector to fill, has getStateDim() elements.
[out]velocityvelocity observation vector to fill, has getVelocityDim() elements.
[in]currentActionaction in current step. May be NULL if not available.
[in]dttime step since the last observation has been taken

Implements Rcs::ObservationModel.

Definition at line 47 of file OMComputedVelocity.cpp.

◆ computeState()

virtual void Rcs::OMComputedVelocity::computeState ( double *  state,
const MatNd *  currentAction,
double  dt 
) const
pure virtual

Implement to fill the observation vector with the observed state values. The velocity will be computed automatically.

Parameters
[out]statestate observation vector to fill, has getStateDim() elements.
[in]currentActionaction in current step. May be NULL if not available.
[in]dttime step since the last observation has been taken. Will be 0 if called during reset().

◆ reset()

void Rcs::OMComputedVelocity::reset ( )
virtual

Overridden to initialize lastState. If a subclass wants to override this, make sure to call the base method. Since this method has to call computeState, make sure any relevant initialization is done before.

Reimplemented from Rcs::ObservationModel.

Definition at line 60 of file OMComputedVelocity.cpp.

Member Data Documentation

◆ lastState

MatNd* Rcs::OMComputedVelocity::lastState
private

Definition at line 70 of file OMComputedVelocity.h.


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