Loading...
Searching...
No Matches

Abstract base class for an object that can solve ordinary differential equations (ODE) of the type q' = f(q,u) using numerical integration. Classes deriving from this must implement the solve method. The user must supply the ODE to solve. More...

#include <ompl/control/ODESolver.h>

Inheritance diagram for ompl::control::ODESolver:

Public Types

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.
 

Public Member Functions

 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.
 

Static Public Member Functions

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.
 

Protected Member Functions

virtual void solve (StateType &state, const Control *control, double duration) const =0
 Solve the ODE given the initial state, and a control to apply for some duration.
 

Protected Attributes

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.
 

Detailed Description

Abstract base class for an object that can solve ordinary differential equations (ODE) of the type q' = f(q,u) using numerical integration. Classes deriving from this must implement the solve method. The user must supply the ODE to solve.

Definition at line 73 of file ODESolver.h.

Member Typedef Documentation

◆ ODE

using ompl::control::ODESolver::ODE = std::function<void(const StateType &, const Control *, StateType &)>

Callback function that defines the ODE. Accepts the current state, input control, and output state.

Definition at line 81 of file ODESolver.h.

◆ PostPropagationEvent

Initial value:
std::function<void(const base::State *, const Control *, double, base::State *)>

Callback function to perform an event at the end of numerical integration. This functionality is optional.

Definition at line 85 of file ODESolver.h.

◆ StateType

using ompl::control::ODESolver::StateType = std::vector<double>

Portable data type for the state values.

Definition at line 77 of file ODESolver.h.

Constructor & Destructor Documentation

◆ ODESolver()

ompl::control::ODESolver::ODESolver ( SpaceInformationPtr si,
ODE ode,
double intStep )
inline

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

Definition at line 90 of file ODESolver.h.

Member Function Documentation

◆ getIntegrationStepSize()

double ompl::control::ODESolver::getIntegrationStepSize ( ) const
inline

Return the size of a single numerical integration step.

Definition at line 105 of file ODESolver.h.

◆ getSpaceInformation()

const SpaceInformationPtr & ompl::control::ODESolver::getSpaceInformation ( ) const
inline

Get the current instance of the space information.

Definition at line 117 of file ODESolver.h.

◆ getStatePropagator()

static StatePropagatorPtr ompl::control::ODESolver::getStatePropagator ( ODESolverPtr solver,
const PostPropagationEvent & postEvent = nullptr )
inlinestatic

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.

Definition at line 127 of file ODESolver.h.

◆ setIntegrationStepSize()

void ompl::control::ODESolver::setIntegrationStepSize ( double intStep)
inline

Set the size of a single numerical integration step.

Definition at line 111 of file ODESolver.h.

◆ setODE()

void ompl::control::ODESolver::setODE ( const ODE & ode)
inline

Set the ODE to solve.

Definition at line 99 of file ODESolver.h.

◆ solve()

virtual void ompl::control::ODESolver::solve ( StateType & state,
const Control * control,
double duration ) const
protectedpure virtual

Solve the ODE given the initial state, and a control to apply for some duration.

Implemented in ompl::control::ODEAdaptiveSolver< Solver >, ompl::control::ODEBasicSolver< Solver >, and ompl::control::ODEErrorSolver< Solver >.

Member Data Documentation

◆ intStep_

double ompl::control::ODESolver::intStep_
protected

The size of the numerical integration step. Should be small to minimize error.

Definition at line 170 of file ODESolver.h.

◆ ode_

ODE ompl::control::ODESolver::ode_
protected

Definition of the ODE to find solutions for.

Definition at line 167 of file ODESolver.h.

◆ si_

const SpaceInformationPtr ompl::control::ODESolver::si_
protected

The SpaceInformation that this ODESolver operates in.

Definition at line 164 of file ODESolver.h.


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