KrisLibrary
1.0.0
|
Base class for adapting a simulation function by integrating forward dynamics into a ControlSpace. The "base" control set does not contain timing information, while the control set for this space also includes a timestep. More...
#include <ControlSpace.h>
Public Types | |
enum | Integrator { Euler, RK4 } |
typedef void(* | DynamicsFn) (const State &x, const ControlInput &u, State &dx) |
Public Member Functions | |
IntegratedControlSpace (const std::shared_ptr< CSet > &fControlSet, Real dt=0.01, Real dtmax=0.1) | |
IntegratedControlSpace (DynamicsFn f, const std::shared_ptr< CSet > &fControlSet, Real dt=0.01, Real dtmax=0.1) | |
void | SetGeodesicSpace (GeodesicSpace *space) |
void | SetBaseControlSet (std::shared_ptr< CSet > baseControlSet) |
std::shared_ptr< CSet > | GetBaseControlSet () |
virtual std::string | VariableName (int i) |
Returns an identifier for the i'th control variable. | |
virtual InterpolatorPtr | Simulate (const State &x0, const ControlInput &u) |
virtual std::shared_ptr< CSet > | GetControlSet (const Config &x) |
virtual void | Derivative (const State &x, const ControlInput &u, State &dx) |
Compute dx=x'=g(x,u) | |
virtual void | UpdateIntegrationParameters (const State &x) |
Update controlSpace, dt, or dtmax if state-dependent. | |
Public Member Functions inherited from ControlSpace | |
virtual std::shared_ptr< CSet > | GetControlSet (const State &x) |
virtual std::shared_ptr< SteeringFunction > | GetSteeringFunction () |
Returns this space's steering function, if available. | |
virtual void | Successor (const State &x0, const ControlInput &u, State &x1) |
virtual Math::VectorFieldFunction * | SuccessorNumeric () |
virtual void | SampleControl (const State &x, ControlInput &u) |
virtual bool | IsValidControl (const State &x, const ControlInput &u) |
Public Attributes | |
DynamicsFn | myDynamics |
Integrator | type |
GeodesicSpace * | space |
std::shared_ptr< CSet > | controlSet |
Real | dt |
integration time step | |
Real | dtmax |
maximum dt chosen in controls | |
Public Attributes inherited from ControlSpace | |
std::shared_ptr< CSet > | myControlSet |
Dynamically overridable default control set (Note: state independent) | |
std::shared_ptr< SteeringFunction > | mySteeringFunction |
Dynamically overridable default steering function. | |
Base class for adapting a simulation function by integrating forward dynamics into a ControlSpace. The "base" control set does not contain timing information, while the control set for this space also includes a timestep.
Using this as a base class is convenient if you know nothing beyond the system dynamics.
The Derivative() method implements the x'=g(x,u) function where x is a state and u is a "base" control.
The UpdateIntegrationParameters() method can be overloaded to implement state-dependent timestep / control selection.
The resulting control input u contains a timestep parameter and the base control such that u = (timestep,ubase).
|
virtual |
Executes the simulation function f(x0,u) and records its trace in p. The trace is an interpolator between x0 and the successor state
Implements ControlSpace.
Reimplemented in DoubleIntegratorControlSpace.
References Math::Euler(), Math::Euler_step(), and Math::RungeKutta4_step().