#include <ObservationModel.h>
Classes | |
struct | Offsets |
Public Member Functions | |
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 | computeObservation (double *state, double *velocity, const MatNd *currentAction, double dt) const =0 |
virtual void | getLimits (double *minState, double *maxState, double *maxVelocity) const |
virtual void | reset () |
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 |
![]() | |
BoxSpaceProvider () | |
virtual | ~BoxSpaceProvider () |
BoxSpaceProvider (const BoxSpaceProvider &)=delete | |
BoxSpaceProvider & | operator= (const BoxSpaceProvider &)=delete |
BoxSpaceProvider (BoxSpaceProvider &&)=delete | |
BoxSpaceProvider & | operator= (BoxSpaceProvider &&)=delete |
const BoxSpace * | getSpace () const |
The ObservationModel encapsulates the computation of the state vector from the current graph state.
Definition at line 45 of file ObservationModel.h.
|
virtualdefault |
MatNd * Rcs::ObservationModel::computeObservation | ( | const MatNd * | currentAction, |
double | dt | ||
) | const |
Create a MatNd for the observation vector, fill it using computeObservation and return it. The caller must take ownership of the returned matrix.
[in] | currentAction | action in current step. May be NULL if not available. |
[in] | dt | time step since the last observation has been taken |
Definition at line 45 of file ObservationModel.cpp.
void Rcs::ObservationModel::computeObservation | ( | MatNd * | observation, |
const MatNd * | currentAction, | ||
double | dt | ||
) | const |
Fill the given matrix with observation data.
[out] | observation | observation output vector |
[in] | currentAction | action in current step. May be NULL if not available. |
[in] | dt | time step since the last observation has been taken |
Definition at line 52 of file ObservationModel.cpp.
|
pure virtual |
Implement to fill the observation vector with the observed values.
[out] | state | state observation vector to fill, has getStateDim() elements. |
[out] | velocity | velocity observation vector to fill, has getVelocityDim() elements. |
[in] | currentAction | action in current step. May be NULL if not available. |
[in] | dt | time step since the last observation has been taken |
Implemented in Rcs::OMPartial, Rcs::OMJointState, Rcs::OMNormalized, Rcs::OMTaskSpaceDiscrepancy, Rcs::OMForceTorque, Rcs::OMManipulabilityIndex, Rcs::OMDynamicalSystemGoalDistance, Rcs::OMCombined, Rcs::OMDynamicalSystemDiscrepancy, Rcs::OMTaskPositions, Rcs::OMTask, Rcs::OMBallPos, Rcs::OMCollisionCostPrediction, Rcs::OMComputedVelocity, and Rcs::OMCollisionCost.
|
inline |
Find a nested observation model of a specified type. If multiple observation models match, the first found in depth-first search order is returned.
OM | observation model type to find |
Definition at line 145 of file ObservationModel.h.
|
inline |
Find a nested observation model of a specified type. If multiple observation models match, the first found in depth-first search order is returned. NOTE: the positions and velovities are done separately. In order to correct for masked state observations use observationModel->getStateDim() + thisOM.vel + i
to get the index.
OM | observation model type to find |
Definition at line 181 of file ObservationModel.h.
|
finalvirtual |
The number of observed variables is twice the number of state variables. Delegates to getStateDim.
Implements Rcs::BoxSpaceProvider.
Definition at line 110 of file ObservationModel.cpp.
|
virtual |
Provides the minimum and maximum observable values. Since the velocity is symmetric, only the maximum needs to be provided. The default implementation uses -inf and inf.
[out] | minState | minimum state vector to fill, has getStateDim() elements. |
[out] | maxState | maximum state vector to fill, has getStateDim() elements. |
[out] | maxVelocity | maximum velocity vector to fill, has getVelocityDim() elements. |
Reimplemented in Rcs::OMPartial, Rcs::OMJointState, Rcs::OMNormalized, Rcs::OMForceTorque, Rcs::OMTaskSpaceDiscrepancy, Rcs::OMDynamicalSystemGoalDistance, Rcs::OMCombined, Rcs::OMTaskPositions, Rcs::OMTask, Rcs::OMCollisionCostPrediction, and Rcs::OMCollisionCost.
Definition at line 70 of file ObservationModel.cpp.
|
finalvirtual |
Provides the minimum and maximum observable values. Delegates to getLimits.
Implements Rcs::BoxSpaceProvider.
Definition at line 116 of file ObservationModel.cpp.
|
finalvirtual |
The velocity names are the state names postfixed with 'd'. Delegates to getStateNames.
Reimplemented from Rcs::BoxSpaceProvider.
Definition at line 129 of file ObservationModel.cpp.
|
virtual |
List directly nested observation models. The default implementation returns an empty list, since there are no nested models.
Reimplemented in Rcs::OMPartial, Rcs::OMNormalized, and Rcs::OMCombined.
Definition at line 138 of file ObservationModel.cpp.
|
pure virtual |
The number of state variables.
Implemented in Rcs::OMPartial, Rcs::OMJointState, Rcs::OMNormalized, Rcs::OMTaskSpaceDiscrepancy, Rcs::OMForceTorque, Rcs::OMManipulabilityIndex, Rcs::OMDynamicalSystemGoalDistance, Rcs::OMCombined, Rcs::OMDynamicalSystemDiscrepancy, Rcs::OMTask, Rcs::OMTaskPositions, Rcs::OMCollisionCostPrediction, and Rcs::OMCollisionCost.
|
virtual |
Provides names for each state entry.
Reimplemented in Rcs::OMPartial, Rcs::OMJointState, Rcs::OMNormalized, Rcs::OMTaskSpaceDiscrepancy, Rcs::OMForceTorque, Rcs::OMCombined, Rcs::OMDynamicalSystemGoalDistance, Rcs::OMDynamicalSystemDiscrepancy, Rcs::OMManipulabilityIndex, Rcs::OMTaskPositions, Rcs::OMTask, Rcs::OMCollisionCostPrediction, and Rcs::OMCollisionCost.
Definition at line 78 of file ObservationModel.cpp.
|
virtual |
The number of velocity variables. The default implementation assumes that for each state there is a velocity.
Reimplemented in Rcs::OMPartial, Rcs::OMJointStatePositions, Rcs::OMJointState, Rcs::OMNormalized, Rcs::OMTaskSpaceDiscrepancy, Rcs::OMForceTorque, Rcs::OMManipulabilityIndex, Rcs::OMDynamicalSystemGoalDistance, Rcs::OMCombined, Rcs::OMDynamicalSystemDiscrepancy, Rcs::OMTaskPositions, Rcs::OMCollisionCostPrediction, and Rcs::OMCollisionCost.
Definition at line 63 of file ObservationModel.cpp.
|
virtual |
Provides names for each velocity entry. The default implementation derives the names from getStateNames(), appending a 'd' to each name.
Reimplemented in Rcs::OMPartial, Rcs::OMNormalized, and Rcs::OMCombined.
Definition at line 92 of file ObservationModel.cpp.
|
virtual |
Reset any internal state. This is called to begin a new episode. It should also reset values depending on modifiable physics parameters. This is an optional operation, so the default implementation does nothing.
Reimplemented in Rcs::OMPartial, Rcs::OMNormalized, Rcs::OMTaskSpaceDiscrepancy, Rcs::OMCombined, Rcs::OMDynamicalSystemDiscrepancy, Rcs::OMBallPos, and Rcs::OMComputedVelocity.
Definition at line 58 of file ObservationModel.cpp.