#include <OMTask.h>
Public Member Functions | |
OMTask (Task *task) | |
virtual | ~OMTask () |
OMTask (const OMTask &)=delete | |
OMTask & | operator= (const OMTask &)=delete |
OMTask (OMTask &&)=delete | |
OMTask & | operator= (OMTask &&)=delete |
virtual unsigned int | getStateDim () const |
virtual void | computeObservation (double *state, double *velocity, const MatNd *currentAction, double dt) const |
virtual void | getLimits (double *minState, double *maxState, double *maxVelocity) const |
virtual std::vector< std::string > | getStateNames () const |
OMTask * | setMinState (double minState) |
OMTask * | setMinState (std::vector< double > minState) |
OMTask * | setMaxState (double maxState) |
OMTask * | setMaxState (std::vector< double > maxState) |
OMTask * | setMaxVelocity (double maxVelocity) |
OMTask * | setMaxVelocity (std::vector< double > maxVelocity) |
Task * | getTask () const |
![]() | |
virtual | ~ObservationModel () |
MatNd * | computeObservation (const MatNd *currentAction, double dt) const |
void | computeObservation (MatNd *observation, const MatNd *currentAction, double dt) const |
virtual unsigned int | getVelocityDim () const |
virtual void | reset () |
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 |
Protected Member Functions | |
void | initTaskBodyNames (const char *effectorName, const char *refBodyName, const char *refFrameName) |
Private Attributes | |
Task * | task |
std::vector< double > | maxVelocity |
ObservationModel wrapping a Rcs Task.
Note: By default, the state min/max is taken from the task, and the maximum velocity is set to infinity. Use the various setters to change these limits. All limit setters return this for chanining.
Rcs::OMTask::OMTask | ( | Task * | task | ) |
Wrap the given task. Takes ownership of the task object.
Definition at line 42 of file OMTask.cpp.
|
virtual |
Definition at line 44 of file OMTask.cpp.
|
delete |
|
delete |
|
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 |
Implements Rcs::ObservationModel.
Reimplemented in Rcs::OMBallPos.
Definition at line 54 of file OMTask.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 from Rcs::ObservationModel.
Definition at line 60 of file OMTask.cpp.
|
virtual |
The number of state variables.
Implements Rcs::ObservationModel.
Definition at line 49 of file OMTask.cpp.
|
virtual |
Provides names for each state entry.
Reimplemented from Rcs::ObservationModel.
Definition at line 69 of file OMTask.cpp.
|
inline |
|
protected |
Initialize the task's effector, refBody and refFrame values by looking up the named bodies from the graph.
effectorName | Name of effector body, a.k.a. the body controlled by the task. |
refBodyName | Name of reference body, a.k.a. the body the task coordinates should be relative to. Set to NULL to use the world origin. |
refFrameName | Name of the reference frame body. The task coordinates will be expressed in this body's frame if set. If this is NULL, refBodyName will be used. |
Definition at line 139 of file OMTask.cpp.
OMTask * Rcs::OMTask::setMaxState | ( | double | maxState | ) |
Set the upper state limit, broadcasting one value to all elements.
Definition at line 109 of file OMTask.cpp.
OMTask * Rcs::OMTask::setMaxState | ( | std::vector< double > | maxState | ) |
Set the upper state limit. The number of elements must match the state dimension.
Definition at line 117 of file OMTask.cpp.
OMTask * Rcs::OMTask::setMaxVelocity | ( | double | maxVelocity | ) |
Set the velocity limit, broadcasting one value to all elements.
Definition at line 126 of file OMTask.cpp.
OMTask * Rcs::OMTask::setMaxVelocity | ( | std::vector< double > | maxVelocity | ) |
Set the velocity limit. The number of elements must match the state dimension.
Definition at line 132 of file OMTask.cpp.
OMTask * Rcs::OMTask::setMinState | ( | double | minState | ) |
Set the lower state limit, broadcasting one value to all elements.
Definition at line 92 of file OMTask.cpp.
OMTask * Rcs::OMTask::setMinState | ( | std::vector< double > | minState | ) |
Set the lower state limit. The number of elements must match the state dimension.
Definition at line 100 of file OMTask.cpp.
|
private |
|
private |