wbc
|
The JointPosPDController class implements a PD Controller with feed forward on the base-Joints type. The following control schemes are available: More...
#include <JointPosPDController.hpp>
Public Member Functions | |
JointPosPDController (uint dim) | |
const Eigen::VectorXd & | update (const Eigen::VectorXd &ref_pos, const Eigen::VectorXd &ref_vel, const Eigen::VectorXd &pos) |
Compute velocity level control output. | |
const Eigen::VectorXd & | update (const Eigen::VectorXd &ref_pos, const Eigen::VectorXd &ref_vel, const Eigen::VectorXd &ref_acc, const Eigen::VectorXd &pos, const Eigen::VectorXd &vel) |
Compute acceleration level control output. | |
void | setPGain (const Eigen::VectorXd &gain) |
const Eigen::VectorXd & | pGain () |
void | setDGain (const Eigen::VectorXd &gain) |
const Eigen::VectorXd & | dGain () |
void | setMaxCtrlOutput (const Eigen::VectorXd &max_ctrl_out) |
const Eigen::VectorXd & | maxCtrlOutput () |
void | applySaturation (const Eigen::VectorXd &in, const Eigen::VectorXd &max, Eigen::VectorXd &out) |
Apply Saturation on the control output. If one or more values of <in> are bigger than the Corrresponding entry of <max>, all values will be scaled down according to the biggest ratio eta = in_i / max,i. | |
Protected Attributes | |
uint | dim_controller |
Eigen::VectorXd | p_gain |
Eigen::VectorXd | d_gain |
Eigen::VectorXd | u_max |
Eigen::VectorXd | u |
The JointPosPDController class implements a PD Controller with feed forward on the base-Joints type. The following control schemes are available:
where \( \mathbf{e} = \mathbf{q}_r-\mathbf{q} \), \( \dot{\mathbf{e}} = \dot{\mathbf{q}}_r-\dot{\mathbf{q}} \) and \( \ddot{\mathbf{e}} = \ddot{\mathbf{q}}_r-\ddot{\mathbf{q}} \)
\( \mathbf{q},\mathbf{q}_r \) - Actual and reference joint position
\( \dot{\mathbf{q}},\dot{\mathbf{q}}_r \) - Actual and reference joint velocity
\( \ddot{\mathbf{q}},\ddot{\mathbf{q}}_r \) - Actual and reference joint acceleration
\( \mathbf{K}_d,\mathbf{K}_p \) - Derivative and proportial gain matrices
\( \mathbf{K}_{ff} \) - Feed forward gain matrix
\( \ddot{\mathbf{q}}_d,\dot{\mathbf{q}}_d \) - Control output, desired acceleration or velocity
Note: If an input is NaN, it might be ignored by the controller. E.g. if the reference or actual velocity is none, the velocity error will be set to zero in the controller
wbc::JointPosPDController::JointPosPDController | ( | uint | dim | ) |
void wbc::JointPosPDController::applySaturation | ( | const Eigen::VectorXd & | in, |
const Eigen::VectorXd & | max, | ||
Eigen::VectorXd & | out ) |
Apply Saturation on the control output. If one or more values of <in> are bigger than the Corrresponding entry of <max>, all values will be scaled down according to the biggest ratio eta = in_i / max,i.
in | Input vector. Size has to be same as max. |
max | Maximum allowed value for input vector. Size has to be same as in. |
out | Output vector. Will be resized if out.size() != in.size() |
|
inline |
Get derivative/velocity gain
|
inline |
Get controller saturation
|
inline |
Get proportional/position gain
void wbc::JointPosPDController::setDGain | ( | const Eigen::VectorXd & | gain | ) |
Set derivative/velocity gain. Size has to be the same dimension of the controller
void wbc::JointPosPDController::setMaxCtrlOutput | ( | const Eigen::VectorXd & | max_ctrl_out | ) |
Set controller saturation. Size has to be the same dimension of the controller
void wbc::JointPosPDController::setPGain | ( | const Eigen::VectorXd & | gain | ) |
Set proportional/position gain. Size has to be the same dimension of the controller
const Eigen::VectorXd & wbc::JointPosPDController::update | ( | const Eigen::VectorXd & | ref_pos, |
const Eigen::VectorXd & | ref_vel, | ||
const Eigen::VectorXd & | pos ) |
Compute velocity level control output.
const Eigen::VectorXd & wbc::JointPosPDController::update | ( | const Eigen::VectorXd & | ref_pos, |
const Eigen::VectorXd & | ref_vel, | ||
const Eigen::VectorXd & | ref_acc, | ||
const Eigen::VectorXd & | pos, | ||
const Eigen::VectorXd & | vel ) |
Compute acceleration level control output.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |