Exotica
Public Member Functions | Private Member Functions | Private Attributes | List of all members
exotica::ILQRSolver Class Reference

#include <ilqr_solver.h>

Inheritance diagram for exotica::ILQRSolver:
Inheritance graph
Collaboration diagram for exotica::ILQRSolver:
Collaboration graph

Public Member Functions

void Solve (Eigen::MatrixXd &solution) override
 Solves the problem. More...
 
void SpecifyProblem (PlanningProblemPtr pointer) override
 Binds the solver to a specific problem which must be pre-initalised. More...
 
Eigen::VectorXd GetFeedbackControl (Eigen::VectorXdRefConst x, int t) const override
 
- Public Member Functions inherited from exotica::MotionSolver
 MotionSolver ()=default
 
virtual ~MotionSolver ()=default
 
void InstantiateBase (const Initializer &init) override
 
PlanningProblemPtr GetProblem () const
 
std::string Print (const std::string &prepend) const override
 
void SetNumberOfMaxIterations (int max_iter)
 
int GetNumberOfMaxIterations ()
 
double GetPlanningTime ()
 
- Public Member Functions inherited from exotica::Object
 Object ()
 
virtual ~Object ()
 
virtual std::string type () const
 Type Information wrapper: must be virtual so that it is polymorphic... More...
 
std::string GetObjectName ()
 
void InstantiateObject (const Initializer &init)
 
- Public Member Functions inherited from exotica::InstantiableBase
 InstantiableBase ()=default
 
virtual ~InstantiableBase ()=default
 
virtual std::vector< InitializerGetAllTemplates () const =0
 
- Public Member Functions inherited from exotica::Instantiable< ILQRSolverInitializer >
void InstantiateInternal (const Initializer &init) override
 
Initializer GetInitializerTemplate () override
 
std::vector< InitializerGetAllTemplates () const override
 
virtual void Instantiate (const ILQRSolverInitializer &init)
 
const ILQRSolverInitializer & GetParameters () const
 

Private Member Functions

void BackwardPass ()
 !< Reference trajectory for feedback control. More...
 
double ForwardPass (const double alpha, Eigen::MatrixXdRefConst ref_x, Eigen::MatrixXdRefConst ref_u)
 Forward simulates the dynamics using the gains computed in the last BackwardPass;. More...
 

Private Attributes

DynamicTimeIndexedShootingProblemPtr prob_
 
DynamicsSolverPtr dynamics_solver_
 !< Shared pointer to the planning problem. More...
 
std::vector< Eigen::MatrixXd > K_gains_
 !< Shared pointer to the dynamics solver. More...
 
std::vector< Eigen::MatrixXd > Ku_gains_
 
std::vector< Eigen::MatrixXd > Kv_gains_
 
std::vector< Eigen::MatrixXd > vk_gains_
 
Eigen::MatrixXd best_ref_x_
 !< Control gains. More...
 
Eigen::MatrixXd best_ref_u_
 

Additional Inherited Members

- Public Attributes inherited from exotica::Object
std::string ns_
 
std::string object_name_
 
bool debug_
 
- Protected Attributes inherited from exotica::MotionSolver
PlanningProblemPtr problem_
 
double planning_time_ = -1
 
int max_iterations_ = 100
 
- Protected Attributes inherited from exotica::Instantiable< ILQRSolverInitializer >
ILQRSolverInitializer parameters_
 

Member Function Documentation

◆ BackwardPass()

void exotica::ILQRSolver::BackwardPass ( )
private

!< Reference trajectory for feedback control.

Computes the control gains for a the trajectory in the associated DynamicTimeIndexedProblem.

◆ ForwardPass()

double exotica::ILQRSolver::ForwardPass ( const double  alpha,
Eigen::MatrixXdRefConst  ref_x,
Eigen::MatrixXdRefConst  ref_u 
)
private

Forward simulates the dynamics using the gains computed in the last BackwardPass;.

Parameters
alphaThe learning rate.
ref_trajectoryThe reference state trajectory.
Returns
The cost associated with the new control and state trajectory.

◆ GetFeedbackControl()

Eigen::VectorXd exotica::ILQRSolver::GetFeedbackControl ( Eigen::VectorXdRefConst  x,
int  t 
) const
overridevirtual

◆ Solve()

void exotica::ILQRSolver::Solve ( Eigen::MatrixXd &  solution)
overridevirtual

Solves the problem.

Parameters
solutionReturned solution trajectory as a vector of joint configurations.

Implements exotica::MotionSolver.

◆ SpecifyProblem()

void exotica::ILQRSolver::SpecifyProblem ( PlanningProblemPtr  pointer)
overridevirtual

Binds the solver to a specific problem which must be pre-initalised.

Parameters
pointerShared pointer to the motion planning problem
Returns
Successful if the problem is a valid DynamicTimeIndexedProblem

Reimplemented from exotica::MotionSolver.

Member Data Documentation

◆ best_ref_u_

Eigen::MatrixXd exotica::ILQRSolver::best_ref_u_
private

◆ best_ref_x_

Eigen::MatrixXd exotica::ILQRSolver::best_ref_x_
private

!< Control gains.

◆ dynamics_solver_

DynamicsSolverPtr exotica::ILQRSolver::dynamics_solver_
private

!< Shared pointer to the planning problem.

◆ K_gains_

std::vector<Eigen::MatrixXd> exotica::ILQRSolver::K_gains_
private

!< Shared pointer to the dynamics solver.

◆ Ku_gains_

std::vector<Eigen::MatrixXd> exotica::ILQRSolver::Ku_gains_
private

◆ Kv_gains_

std::vector<Eigen::MatrixXd> exotica::ILQRSolver::Kv_gains_
private

◆ prob_

DynamicTimeIndexedShootingProblemPtr exotica::ILQRSolver::prob_
private

◆ vk_gains_

std::vector<Eigen::MatrixXd> exotica::ILQRSolver::vk_gains_
private

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