Loading...
Searching...
No Matches
ompl::control::ODEErrorSolver< Solver > Class Template Reference

Solver for ordinary differential equations of the type q' = f(q, u), where q is the current state of the system and u is a control applied to the system. StateType defines the container object describing the state of the system. Solver is the numerical integration method used to solve the equations. The default is a fifth order Runge-Kutta Cash-Karp method with a fourth order error bound. This class wraps around the error stepper concept from boost::numeric::odeint. More...

#include <ompl/control/ODESolver.h>

Inheritance diagram for ompl::control::ODEErrorSolver< Solver >:

Public Member Functions

 ODEErrorSolver (const SpaceInformationPtr &si, const ODESolver::ODE &ode, double intStep=1e-2)
 Parameterized constructor. Takes a reference to the SpaceInformation, an ODE to solve, and the integration step size - default is 0.01.
 
ODESolver::StateType getError ()
 Retrieves the error values from the most recent integration.
 
- Public Member Functions inherited from ompl::control::ODESolver
 ODESolver (SpaceInformationPtr si, ODE ode, double intStep)
 Parameterized constructor. Takes a reference to SpaceInformation, an ODE to solve, and the integration step size.
 
virtual ~ODESolver ()=default
 Destructor.
 
void setODE (const ODE &ode)
 Set the ODE to solve.
 
double getIntegrationStepSize () const
 Return the size of a single numerical integration step.
 
void setIntegrationStepSize (double intStep)
 Set the size of a single numerical integration step.
 
const SpaceInformationPtrgetSpaceInformation () const
 Get the current instance of the space information.
 

Protected Member Functions

void solve (StateType &state, const Control *control, double duration) const override
 Solve the ODE using boost::numeric::odeint. Save the resulting error values into error_.
 
- Protected Member Functions inherited from ompl::control::ODESolver

Protected Attributes

ODESolver::StateType error_
 The error values calculated during numerical integration.
 
- Protected Attributes inherited from ompl::control::ODESolver
const SpaceInformationPtr si_
 The SpaceInformation that this ODESolver operates in.
 
ODE ode_
 Definition of the ODE to find solutions for.
 
double intStep_
 The size of the numerical integration step. Should be small to minimize error.
 

Additional Inherited Members

- Public Types inherited from ompl::control::ODESolver
using StateType = std::vector<double>
 Portable data type for the state values.
 
using ODE = std::function<void(const StateType &, const Control *, StateType &)>
 Callback function that defines the ODE. Accepts the current state, input control, and output state.
 
using PostPropagationEvent
 Callback function to perform an event at the end of numerical integration. This functionality is optional.
 
- Static Public Member Functions inherited from ompl::control::ODESolver
static StatePropagatorPtr getStatePropagator (ODESolverPtr solver, const PostPropagationEvent &postEvent=nullptr)
 Retrieve a StatePropagator object that solves a system of ordinary differential equations defined by an ODESolver. An optional PostPropagationEvent can also be specified as a callback after numerical integration is finished for further operations on the resulting state.
 

Detailed Description

template<class Solver = odeint::runge_kutta_cash_karp54<ODESolver::StateType>>
class ompl::control::ODEErrorSolver< Solver >

Solver for ordinary differential equations of the type q' = f(q, u), where q is the current state of the system and u is a control applied to the system. StateType defines the container object describing the state of the system. Solver is the numerical integration method used to solve the equations. The default is a fifth order Runge-Kutta Cash-Karp method with a fourth order error bound. This class wraps around the error stepper concept from boost::numeric::odeint.

Definition at line 226 of file ODESolver.h.

Constructor & Destructor Documentation

◆ ODEErrorSolver()

template<class Solver = odeint::runge_kutta_cash_karp54<ODESolver::StateType>>
ompl::control::ODEErrorSolver< Solver >::ODEErrorSolver ( const SpaceInformationPtr & si,
const ODESolver::ODE & ode,
double intStep = 1e-2 )
inline

Parameterized constructor. Takes a reference to the SpaceInformation, an ODE to solve, and the integration step size - default is 0.01.

Definition at line 231 of file ODESolver.h.

Member Function Documentation

◆ getError()

template<class Solver = odeint::runge_kutta_cash_karp54<ODESolver::StateType>>
ODESolver::StateType ompl::control::ODEErrorSolver< Solver >::getError ( )
inline

Retrieves the error values from the most recent integration.

Definition at line 237 of file ODESolver.h.

◆ solve()

template<class Solver = odeint::runge_kutta_cash_karp54<ODESolver::StateType>>
void ompl::control::ODEErrorSolver< Solver >::solve ( StateType & state,
const Control * control,
double duration ) const
inlineoverrideprotectedvirtual

Solve the ODE using boost::numeric::odeint. Save the resulting error values into error_.

Implements ompl::control::ODESolver.

Definition at line 244 of file ODESolver.h.

Member Data Documentation

◆ error_

template<class Solver = odeint::runge_kutta_cash_karp54<ODESolver::StateType>>
ODESolver::StateType ompl::control::ODEErrorSolver< Solver >::error_
mutableprotected

The error values calculated during numerical integration.

Definition at line 263 of file ODESolver.h.


The documentation for this class was generated from the following file: