# Why is the command of the PID class defined as the negative summation of the gains?

In reference to this: https://github.com/arpg/Gazebo/blob/m...

The command of the PID controller is defined as follows:

this->cmd = -pTerm - iTerm - dTerm;


this->cmd = pTerm + iTerm + dTerm;

I assume it takes the error as e = current_value - desired_value, but why does it seem to go against the convention which is e = desired_value - current_value?