robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
control_policy.hpp
Go to the documentation of this file.
1#ifndef ROBOTOC_CONTROL_POLICY_HPP_
2#define ROBOTOC_CONTROL_POLICY_HPP_
3
4#include <iostream>
5
6#include "Eigen/Core"
7
9
10
11namespace robotoc {
12
23 ControlPolicy(const OCPSolver& ocp_solver, const double t);
24
29
33 ~ControlPolicy() = default;
34
38 ControlPolicy(const ControlPolicy&) = default;
39
44
48 ControlPolicy(ControlPolicy&&) noexcept = default;
49
53 ControlPolicy& operator=(ControlPolicy&&) noexcept = default;
54
60 void set(const OCPSolver& ocp_solver, const double t);
61
65 double t;
66
70 Eigen::VectorXd tauJ;
71
75 Eigen::VectorXd qJ;
76
80 Eigen::VectorXd dqJ;
81
85 Eigen::MatrixXd Kp;
86
90 Eigen::MatrixXd Kd;
91
92 static ControlPolicy FromOCPSolver(const OCPSolver& ocp_solver);
93
94 void disp(std::ostream& os) const;
95
96 friend std::ostream& operator<<(std::ostream& os,
97 const ControlPolicy& control_policy);
98
99};
100
101} // namespace robotoc
102
103#endif // ROBOTOC_CONTROL_POLICY_HPP_
Optimal control problem solver by Riccati recursion.
Definition: ocp_solver.hpp:41
Definition: constraint_component_base.hpp:17
Control pocily constructed for the MPC solution.
Definition: control_policy.hpp:17
ControlPolicy(ControlPolicy &&) noexcept=default
Default move constructor.
void disp(std::ostream &os) const
ControlPolicy(const OCPSolver &ocp_solver, const double t)
Constructs the policy from the OCP solver.
ControlPolicy()
Default constructor.
ControlPolicy(const ControlPolicy &)=default
Default copy constructor.
Eigen::VectorXd dqJ
Joint velocities. Size must be Robot::dimu().
Definition: control_policy.hpp:80
Eigen::MatrixXd Kp
Joint position gain. Size must be Robot::dimu() x Robot::dimu().
Definition: control_policy.hpp:85
Eigen::VectorXd tauJ
Joint torques. Size must be Robot::dimu().
Definition: control_policy.hpp:70
double t
Inquired time of the control.
Definition: control_policy.hpp:65
void set(const OCPSolver &ocp_solver, const double t)
Sets the control policy from the OCP solver.
static ControlPolicy FromOCPSolver(const OCPSolver &ocp_solver)
Eigen::VectorXd qJ
Joint positions. Size must be Robot::dimu().
Definition: control_policy.hpp:75
ControlPolicy & operator=(const ControlPolicy &)=default
Default copy assign operator.
Eigen::MatrixXd Kd
Joint velocity gain. Size must be Robot::dimu() x Robot::dimu().
Definition: control_policy.hpp:90
~ControlPolicy()=default
Default destructor.