def computePDForces(self, desiredPositions, desiredVelocities, maxForces):
    """Compute torques from the PD controller."""
    if desiredVelocities == None:
      desiredVelocities = [0] * self._totalDofs

    taus = self._stablePD.computePD(bodyUniqueId=self._sim_model,
                                    jointIndices=self._jointIndicesAll,
                                    desiredPositions=desiredPositions,
                                    desiredVelocities=desiredVelocities,
                                    kps=self._kpOrg,
                                    kds=self._kdOrg,
                                    maxForces=maxForces,
                                    timeStep=self._timeStep)
    return taus