solver_lqr
ForwardPass.hpp
Go to the documentation of this file.
1 
9 #pragma once
10 
13 
14 namespace solverlqr {
15 
17  {
18  public:
19  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
20 
21  public:
22  ForwardPass(){}
23  virtual ~ForwardPass(){}
24 
25  void initialize(OcpBase* ocp, const SolverLqrSetting& stgs);
26  void applyController(const StateSequence& nom_state_seq, const ControlSequence& nom_control_seq);
27 
28  const double& newCost() const { return new_cost_; }
29  const bool& hasDiverged() const { return has_diverged_; }
30  const double& timestepCost(int time_id) const { return timestep_cost_[time_id]; }
31 
32  StateSequence& stateSeq() { return new_state_seq_; }
33  ControlSequence& controlSeq() { return new_control_seq_; }
34  const StateSequence& stateSeq() const { return new_state_seq_; }
35  const ControlSequence& controlSeq() const { return new_control_seq_; }
36 
37  private:
38  OcpBase& getOcp() { return *ocp_; }
39  const OcpBase& getOcp() const { return *ocp_; }
40  const SolverLqrSetting& getLqrSetting() const { return *stgs_; }
41 
42  private:
43  OcpBase* ocp_;
44  const SolverLqrSetting* stgs_;
45 
46  StateBase dx_;
47  StateSequence new_state_seq_;
48  ControlSequence new_control_seq_;
49 
50  double new_cost_;
51  bool has_diverged_;
52  Eigen::VectorXd timestep_cost_;
53  };
54 
55 }
Definition: BackwardPass.hpp:15
Definition: OcpDescription.hpp:44
Optimal Control Problem Description Class.
Definition: OcpDescription.hpp:115
Definition: OcpDescription.hpp:88
Definition: ForwardPass.hpp:16
Definition: SolverLqrSetting.hpp:18
Class to define State of OCP.
Definition: OcpDescription.hpp:18