solver_lqr
SolverLqr.hpp
Go to the documentation of this file.
1 
9 #pragma once
10 
13 
14 namespace solverlqr {
15 
16  class SolverLqr
17  {
18  public:
19  SolverLqr();
20  virtual ~SolverLqr(){}
21 
22  void initialize(OcpBase* ocp, SolverLqrSetting& setting);
23  void optimize();
24 
25  FiniteDifferences& getFiniteDiff() { return devs_; }
26  const FiniteDifferences& getFiniteDiff() const { return devs_; }
27 
28  void loadSolution(const std::string& load_file);
29 
30  private:
31  void storeSolution();
32 
33  OcpBase& getOcp() { return *ocp_; }
34  ForwardPass& getForwPass() { return fpass_; }
35  BackwardPass& getBackPass() { return bpass_; }
36  LqrInfoPrinter& getPrinter() { return printer_; }
37  SolverLqrSetting& getLqrSetting() { return *setting_; }
38  LqrOptimizationInfo& getLqrInfo() { return lqr_optimization_info_; }
39 
40  const OcpBase& getOcp() const { return *ocp_; }
41  const ForwardPass& getForwPass() const { return fpass_; }
42  const BackwardPass& getBackPass() const { return bpass_; }
43  const LqrInfoPrinter& getPrinter() const { return printer_; }
44  const SolverLqrSetting& getLqrSetting() const { return *setting_; }
45  const LqrOptimizationInfo& getLqrInfo() const { return lqr_optimization_info_; }
46 
47  private:
48  OcpBase* ocp_;
49  ForwardPass fpass_;
50  BackwardPass bpass_;
51  FiniteDifferences devs_;
52  LqrInfoPrinter printer_;
53  SolverLqrSetting* setting_;
54  LqrOptimizationInfo lqr_optimization_info_;
55 
56  bool converged_, devs_flag_, backpass_flag_, forwpass_flag_;
57  double linesearch_coeff_, mult_regularization_change_, expected_improvement_;
58  };
59 
60 }
Definition: SolverLqr.hpp:16
Helper class that contains information about the status of the optimization problem.
Definition: LqrInfoPrinter.hpp:37
Definition: BackwardPass.hpp:17
Definition: FiniteDifferences.hpp:17
Definition: LqrInfoPrinter.hpp:54
Definition: BackwardPass.hpp:15
Optimal Control Problem Description Class.
Definition: OcpDescription.hpp:115
Definition: ForwardPass.hpp:16
Definition: SolverLqrSetting.hpp:18