2.9 The Proportional_Derivative class

The Proportional_Derivative class deals with the well known proportional derivative position controller.

Constructor

Syntax
Proportional_Derivative(const short dof = 1);  
Proportional_Derivative(const Robot_basic & robot, const DiagonalMatrix & Kp,  
                        const DiagonalMatrix & Kd);  
Proportional_Derivative(const Proportional_Derivative & x);

Description

Proportional_Derivative object constructor, copy constructor and equal operator.

Return Value

None

torque_cmd

Syntax
ReturnMatrix torque_cmd(Robot_basic & robot, const ColumnVector & qd,  
                        const ColumnVector & qpd);

Description

This function sets the output torque for a desired joint position vector, qd, and a desired joint velocity vector, ˙qd.

Return Value

Matrix

Kd, Kp

Syntax
short set_Kd(const DiagonalMatrix & Kd);  
short set_Kp(const DiagonalMatrix & Kp);

Description

These functions sets the joint position error gain matrix, Kd, and the joint velocity error gain matrix, Kp.

Return Value

Status, as a short int.

  1. 0 successful
  2. WRONG_SIZE (regarding the input vector)