Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Model Class Reference

The incremental simulator model. More...

#include <model.h>

Inheritance diagram for Model:

Model1D Model2D Model3D ModelLinear ModelND ModelNintegrator Model2DPoint Model2DRigid Model3DRigid Model2DPointCar Model2DRigidCar Model2DRigidChain Model2DRigidDyncar Model2DRigidLander Model2DRigidMulti Model3DRigidChain Model3DRigidHelical Model3DRigidMulti Model3DRigidTree List of all members.

Public Methods

 Model (string path)
 Empty constructor.

virtual ~Model ()
 Empty destructor.

virtual list<vector> GetInputs (const vector &x)
 Return a list of inputs, which may depend on state.

virtual vector StateTransitionEquation (const vector &x, const vector &u) = 0
 The state transition equation, or equations of motion, xdot=f(x,u).

virtual bool Satisfied (const vector &x)
 Test whether global state-space constraints are satisfied.

virtual vector Integrate (const vector &x, const vector &u, const double &h) = 0
 Perform integration from state x, using input u, over time step h.

virtual vector LinearInterpolate (const vector &x1, const vector &x2, const double &a)
 Linearly interpolate two state while respecting topology. More...

virtual vector StateDifference (const vector &x1, const vector &x2)
 Compute a vector based on x2-x1. In R^n, the states are simply subtracted to make the vector. This method exists to make things work correctly for other state-space topologies.

virtual vector StateToConfiguration (const vector &x)
 A method that converts a Model state in to a Geom configuration.

virtual point StateToLedaPoint (const vector &x)
 A method that converts a state into a 2D LEDA point.

virtual double Metric (const vector &x1, const vector &x2)
 A distance metric, which is Euclidean in the base class.

virtual void Partialf_x (const vector &x, const vector &u, matrix & m)
 Partial with respect to x of the state transition equation.

virtual void Partialf_u (const vector &x, const vector &u, matrix & m)
 Partial with respect to u of the state transition equation.

virtual void L (const vector &x, const vector &u, double &l)
 A cost or loss function, to be used in optimization problems.

virtual void PartialL_x (const vector &x, const vector &u, matrix & m)
 Partial of the loss with respect to x.

virtual void PartialL_u (const vector &x, const vector &u, matrix & m)
 Partial of the loss with respect to u.

virtual void Phi (const vector &x, const vector &u, const vector &goalstate, double &phi)
 The final-state cost or loss.

virtual void PartialPhi_x (const vector &x, const vector &u, const vector &goalstate, matrix & m)
 Partial of the final-state loss with respect to x.

virtual void PartialPhi_t (const vector &x, const vector &u, const vector &goalstate, matrix & m)
 Partial of the final-state loss with respect to u.

virtual void Psi (const vector &x, const vector &goalstate, vector& psi)
 An error vector that compares a goal state to a given state.

virtual void PartialPsi_x (const vector &x, const vector &u, matrix & m)
 Partial of the error vector with respect to x.

virtual void PartialPsi_t (const vector &x, const vector &u, matrix & m)
 Partial of the error vector with respect to time.


Public Attributes

string FilePath
 This file path is used for all file reads.

vector LowerState
 Vector of minimum values for each state variable.

vector UpperState
 Vector of maximum values for each state variable.

vector LowerInput
 Vector of minimum values for each input variable.

vector UpperInput
 Vector of maximum values for each input variable.

int StateDim
 The dimension of the state space.

int InputDim
 The dimension of the input space.


Protected Methods

void ReadInputs ()
 Read the inputs from a file named Inputs.

void ReadLowerState ()
 Read the lowest possible state from a file named LowerState.

void ReadUpperState ()
 Read the upper state from a file named UpperState.

vector RungeKuttaIntegrate (const vector &x, const vector &u, const double &h)
 Integrate xdot using 4th-order Runge-Kutta.

vector EulerIntegrate (const vector &x, const vector &u, const double &h)
 Integrate xdot using Euler integration.


Protected Attributes

double ModelDeltaT
 The time interval to use for numerical integration (affects accuracy).

list<vector> Inputs
 The complete set of inputs.


Detailed Description

The incremental simulator model.

The Model classes contain incremental simulators that model the kinematics and dynamics of a variety of mechanical systems. The methods allow planning algorithms to compute the future system state, given the current state, an interval of time, and a control input applied over that interval. (The planning algorithms select the appropriate inputs using this information.) Using object-oriented class derivations, a wide variety of simulators can be included.


Constructor & Destructor Documentation

Model::Model ( string path )
 

Empty constructor.

Model::~Model ( ) [inline, virtual]
 

Empty destructor.


Member Function Documentation

vector Model::EulerIntegrate ( const vector & x,
const vector & u,
const double & h ) [protected]
 

Integrate xdot using Euler integration.

list< vector > Model::GetInputs ( const vector & x ) [virtual]
 

Return a list of inputs, which may depend on state.

vector Model::Integrate ( const vector & x,
const vector & u,
const double & h ) [pure virtual]
 

Perform integration from state x, using input u, over time step h.

Reimplemented in Model2DPoint, Model2DPointCar, Model2DRigid, Model2DRigidCarSmooth, Model2DRigidDyncar, Model2DRigidLander, Model3DRigid, Model1D, ModelLinear, ModelND, ModelNintegrator, and Model3DRigidHelical.

void Model::L ( const vector & x,
const vector & u,
double & l ) [inline, virtual]
 

A cost or loss function, to be used in optimization problems.

vector Model::LinearInterpolate ( const vector & x1,
const vector & x2,
const double & a ) [virtual]
 

Linearly interpolate two state while respecting topology.

If a=0, then x1 is returned; if a=1, then x2 is returned. All intermediate values of $a \in [0,1]$ yield intermediate states. This method is defined by Model.

Reimplemented in Model2DRigid, Model2DRigidDyncar, Model2DRigidMulti, Model2DRigidChain, Model3DRigid, Model3DRigidMulti, Model3DRigidChain, and Model3DRigidTree.

double Model::Metric ( const vector & x1,
const vector & x2 ) [virtual]
 

A distance metric, which is Euclidean in the base class.

Reimplemented in Model2DPoint, Model2DPointCar, Model2DRigid, Model2DRigidCarSmooth, Model2DRigidCarSmoothTrailer, Model2DRigidCarSmooth2Trailers, Model2DRigidCarSmooth3Trailers, Model2DRigidDyncar, Model2DRigidLander, Model2DRigidMulti, Model2DRigidChain, Model3DRigid, Model3DRigidMulti, Model3DRigidChain, Model3DRigidTree, and Model1D.

void Model::PartialL_u ( const vector & x,
const vector & u,
matrix & m ) [inline, virtual]
 

Partial of the loss with respect to u.

void Model::PartialL_x ( const vector & x,
const vector & u,
matrix & m ) [inline, virtual]
 

Partial of the loss with respect to x.

void Model::PartialPhi_t ( const vector & x,
const vector & u,
const vector & goalstate,
matrix & m ) [inline, virtual]
 

Partial of the final-state loss with respect to u.

void Model::PartialPhi_x ( const vector & x,
const vector & u,
const vector & goalstate,
matrix & m ) [inline, virtual]
 

Partial of the final-state loss with respect to x.

void Model::PartialPsi_t ( const vector & x,
const vector & u,
matrix & m ) [inline, virtual]
 

Partial of the error vector with respect to time.

void Model::PartialPsi_x ( const vector & x,
const vector & u,
matrix & m ) [inline, virtual]
 

Partial of the error vector with respect to x.

void Model::Partialf_u ( const vector & x,
const vector & u,
matrix & m ) [inline, virtual]
 

Partial with respect to u of the state transition equation.

void Model::Partialf_x ( const vector & x,
const vector & u,
matrix & m ) [inline, virtual]
 

Partial with respect to x of the state transition equation.

void Model::Phi ( const vector & x,
const vector & u,
const vector & goalstate,
double & phi ) [inline, virtual]
 

The final-state cost or loss.

void Model::Psi ( const vector & x,
const vector & goalstate,
vector & psi ) [inline, virtual]
 

An error vector that compares a goal state to a given state.

void Model::ReadInputs ( ) [protected]
 

Read the inputs from a file named Inputs.

void Model::ReadLowerState ( ) [protected]
 

Read the lowest possible state from a file named LowerState.

void Model::ReadUpperState ( ) [protected]
 

Read the upper state from a file named UpperState.

vector Model::RungeKuttaIntegrate ( const vector & x,
const vector & u,
const double & h ) [protected]
 

Integrate xdot using 4th-order Runge-Kutta.

bool Model::Satisfied ( const vector & x ) [virtual]
 

Test whether global state-space constraints are satisfied.

Reimplemented in Model2DRigidCarSmooth, Model2DRigidCarSmoothTrailer, Model2DRigidCarSmooth2Trailers, Model2DRigidCarSmooth3Trailers, Model2DRigidChain, Model3DRigidChain, and Model3DRigidTree.

vector Model::StateDifference ( const vector & x1,
const vector & x2 ) [virtual]
 

Compute a vector based on x2-x1. In R^n, the states are simply subtracted to make the vector. This method exists to make things work correctly for other state-space topologies.

vector Model::StateToConfiguration ( const vector & x ) [virtual]
 

A method that converts a Model state in to a Geom configuration.

Reimplemented in Model2D, Model2DRigid, Model2DRigidCarSmooth, Model2DRigidCarSmoothTrailer, Model2DRigidCarSmooth2Trailers, Model2DRigidCarSmooth3Trailers, Model2DRigidDyncar, Model2DRigidLander, Model2DRigidMulti, Model2DRigidChain, Model3DRigidChain, Model3DRigidTree, Model1D, ModelLinear, ModelND, and ModelNintegrator.

point Model::StateToLedaPoint ( const vector & x ) [virtual]
 

A method that converts a state into a 2D LEDA point.

Reimplemented in Model2DRigidDyncar, Model1D, ModelLinear, ModelND, and ModelNintegrator.

vector Model::StateTransitionEquation ( const vector & x,
const vector & u ) [pure virtual]
 

The state transition equation, or equations of motion, xdot=f(x,u).

Reimplemented in Model2DPoint, Model2DPointCar, Model2DRigid, Model2DRigidCar, Model2DRigidCarSmooth, Model2DRigidCarSmoothTrailer, Model2DRigidCarSmooth2Trailers, Model2DRigidCarSmooth3Trailers, Model2DRigidDyncar, Model2DRigidDyncarNtire, Model2DRigidLander, Model2DRigidChain, Model3DRigid, Model3DRigidChain, Model3DRigidTree, Model1D, ModelLinear, ModelND, ModelNintegrator, and Model3DRigidHelical.


Member Data Documentation

string Model::FilePath
 

This file path is used for all file reads.

int Model::InputDim
 

The dimension of the input space.

list< vector > Model::Inputs [protected]
 

The complete set of inputs.

vector Model::LowerInput
 

Vector of minimum values for each input variable.

vector Model::LowerState
 

Vector of minimum values for each state variable.

double Model::ModelDeltaT [protected]
 

The time interval to use for numerical integration (affects accuracy).

int Model::StateDim
 

The dimension of the state space.

vector Model::UpperInput
 

Vector of maximum values for each input variable.

vector Model::UpperState
 

Vector of maximum values for each state variable.


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


Web page maintained by Steve LaValle
Partial support provided by NSF CAREER Award IRI-970228 (LaValle), Honda Research, and Iowa State University.
Contributors: Anna Atramentov, Peng Cheng, James Kuffner, Steve LaValle, and Libo Yang.