#include <ExperimentConfig.h>
Public Types | |
typedef ExperimentConfig *(* | ExperimentConfigCreateFunction) () |
Public Member Functions | |
ExperimentConfig () | |
virtual | ~ExperimentConfig () |
virtual ActionModel * | createActionModel ()=0 |
virtual ObservationModel * | createObservationModel ()=0 |
virtual InitStateSetter * | createInitStateSetter () |
virtual ForceDisturber * | createForceDisturber () |
PhysicsParameterManager * | createPhysicsParameterManager () |
virtual void | populatePhysicsParameters (PhysicsParameterManager *manager) |
virtual void | getHUDText (std::vector< std::string > &linesOut, double currentTime, const MatNd *currentObservation, const MatNd *currentAction, PhysicsBase *simulator, PhysicsParameterManager *physicsManager, ForceDisturber *forceDisturber) |
std::string | getHUDText (double currentTime, const MatNd *currentObservation, const MatNd *currentAction, PhysicsBase *simulator, PhysicsParameterManager *physicsManager, ForceDisturber *forceDisturber) |
virtual void | initViewer (Rcs::Viewer *viewer) |
Static Public Member Functions | |
static void | registerType (const char *name, ExperimentConfigCreateFunction creator) |
static ExperimentConfig * | create (PropertySource *properties) |
Public Attributes | |
PropertySource * | properties |
RcsGraph * | graph |
ActionModel * | actionModel |
ObservationModel * | observationModel |
RcsCollisionMdl * | collisionMdl |
double | dt |
bool | checkJointLimits |
Protected Member Functions | |
virtual void | load (PropertySource *properties) |
Defines the experiment setup. There should be one subclass per experiment type, IE BallOnPlate or QuanserQube.
Definition at line 72 of file ExperimentConfig.h.
typedef ExperimentConfig*(* Rcs::ExperimentConfig::ExperimentConfigCreateFunction) () |
Definition at line 77 of file ExperimentConfig.h.
Rcs::ExperimentConfig::ExperimentConfig | ( | ) |
Definition at line 191 of file ExperimentConfig.cpp.
|
virtual |
Definition at line 199 of file ExperimentConfig.cpp.
|
static |
Create the experiment configuration from the given property source. This will load the "type" property, use that to select a ExperimentConfig implementation, and then call init() to populate it.
properties | property source to read configuration from. Takes ownership, even on error. |
Definition at line 152 of file ExperimentConfig.cpp.
|
pure virtual |
Create the action model. Read any configuration from this->properties.
Implemented in Rcs::ECPlanar3Link, Rcs::ECPlanarInsert, Rcs::ECBoxLifting, Rcs::ECMiniGolf, Rcs::ECBallInTube, Rcs::ECBoxShelving, Rcs::ECBallOnPlate, Rcs::ECMPblending, and Rcs::ECQuanserQube.
|
virtual |
Create a model for artificial external disturbing forces. The default implementation returns NULL to ignore this.
Reimplemented in Rcs::ECBallInTube, Rcs::ECBoxLifting, Rcs::ECPlanar3Link, Rcs::ECBoxShelving, Rcs::ECPlanarInsert, Rcs::ECMPblending, Rcs::ECBallOnPlate, and Rcs::ECQuanserQube.
Definition at line 301 of file ExperimentConfig.cpp.
|
virtual |
Create the init state setter. Read any configuration from this->properties. Since the init state setter is only needed for the simulation, it is not stored in the ExperimentConfig. Instead, the simulation calls this method and manages the object on it's own. The default implementation returns NULL to use the state from the graph file.
Reimplemented in Rcs::ECBallInTube, Rcs::ECBoxLifting, Rcs::ECPlanar3Link, Rcs::ECBoxShelving, Rcs::ECPlanarInsert, Rcs::ECMiniGolf, Rcs::ECMPblending, Rcs::ECBallOnPlate, and Rcs::ECQuanserQube.
Definition at line 295 of file ExperimentConfig.cpp.
|
pure virtual |
Create the observation model. Read any configuration from this->properties.
Implemented in Rcs::ECBallInTube, Rcs::ECBoxLifting, Rcs::ECPlanar3Link, Rcs::ECBoxShelving, Rcs::ECPlanarInsert, Rcs::ECMPblending, Rcs::ECMiniGolf, Rcs::ECBallOnPlate, and Rcs::ECQuanserQube.
Definition at line 289 of file ExperimentConfig.cpp.
PhysicsParameterManager * Rcs::ExperimentConfig::createPhysicsParameterManager | ( | ) |
Create the physics parameter manager. Read any configuration from this->properties. Since the physics parameter manager is only needed for the simulation, it is not stored in the ExperimentConfig. Instead, the simulation calls this method and manages the object on it's own. This method calls populatePhysicsParameters to populate the parameter descriptors.
Definition at line 307 of file ExperimentConfig.cpp.
|
virtual |
Called to update the HUD text for the viewer. The default implementation will show the physics engine name, the current time.
[out] | linesOut | vector of HUD lines. initially empty. |
[in] | currentTime | simulation time |
[in] | currentObservation | latest observation |
[in] | currentAction | latest action |
[in] | simulator | physics simulator or NULL if none |
[in] | physicsManager | physics parameter manager or NULL if none |
[in] | forceDisturber | distruber which applies the forces to a given body |
Reimplemented in Rcs::ECBallInTube, Rcs::ECBoxLifting, Rcs::ECPlanar3Link, Rcs::ECBoxShelving, Rcs::ECPlanarInsert, Rcs::ECMiniGolf, Rcs::ECBallOnPlate, Rcs::ECMPblending, and Rcs::ECQuanserQube.
Definition at line 347 of file ExperimentConfig.cpp.
std::string Rcs::ExperimentConfig::getHUDText | ( | double | currentTime, |
const MatNd * | currentObservation, | ||
const MatNd * | currentAction, | ||
PhysicsBase * | simulator, | ||
PhysicsParameterManager * | physicsManager, | ||
ForceDisturber * | forceDisturber | ||
) |
Returns the concatenated HUD lines.
[in] | currentTime | simulation time |
[in] | currentObservation | latest observation |
[in] | currentAction | latest action |
[in] | simulator | physics simulator or NULL if none |
[in] | physicsManager | physics parameter manager or NULL if none |
[in] | forceDisturber | distruber which applies the forces to a given body |
Definition at line 370 of file ExperimentConfig.cpp.
|
virtual |
Perform additional initialization on the viewer. This could, for example, change the camera position or add additional visualization. The default implementation does nothing.
Reimplemented in Rcs::ECBallInTube, Rcs::ECBoxLifting, Rcs::ECPlanar3Link, Rcs::ECBoxShelving, Rcs::ECPlanarInsert, Rcs::ECMiniGolf, Rcs::ECMPblending, Rcs::ECBallOnPlate, and Rcs::ECQuanserQube.
Definition at line 337 of file ExperimentConfig.cpp.
|
protectedvirtual |
Called to load data from the given properties. You can override this to load additional data, but be sure to call the parent implementation.
properties | property source to read configuration from. Takes ownership. |
Definition at line 213 of file ExperimentConfig.cpp.
|
virtual |
Add the physics parameter descriptors to the given physics parameter manager.
manager | parameter manager to populate. |
Reimplemented in Rcs::ECBallInTube, Rcs::ECBoxLifting, Rcs::ECPlanar3Link, Rcs::ECBoxShelving, Rcs::ECPlanarInsert, Rcs::ECMiniGolf, Rcs::ECMPblending, Rcs::ECBallOnPlate, and Rcs::ECQuanserQube.
Definition at line 342 of file ExperimentConfig.cpp.
|
static |
Register a named experiment.
name | experiment name |
creator | ExperimentConfig factory function |
Definition at line 146 of file ExperimentConfig.cpp.
ActionModel* Rcs::ExperimentConfig::actionModel |
Action model (pluggable)
Definition at line 203 of file ExperimentConfig.h.
bool Rcs::ExperimentConfig::checkJointLimits |
Flag to enable joint limit checking.
Definition at line 215 of file ExperimentConfig.h.
RcsCollisionMdl* Rcs::ExperimentConfig::collisionMdl |
Collision model to use. Is based on the graph, so take care when using with IK etc.
Definition at line 209 of file ExperimentConfig.h.
double Rcs::ExperimentConfig::dt |
The time step [s].
Definition at line 212 of file ExperimentConfig.h.
RcsGraph* Rcs::ExperimentConfig::graph |
Graph description.
Definition at line 200 of file ExperimentConfig.h.
ObservationModel* Rcs::ExperimentConfig::observationModel |
Observation model (pluggable) used to create the observation which will be returned from step()
Definition at line 206 of file ExperimentConfig.h.
PropertySource* Rcs::ExperimentConfig::properties |
Property source (owned)
Definition at line 197 of file ExperimentConfig.h.