I would like to understand how to compute the Huber estimator.

As I read, the objective function of Huber estimator is minimizing $\rho (x_i - \theta)$, where the $\rho (t) = 1/2 t^2$ when $|t| < k$ and $\rho (t) = k|t| - 1/2 k^2$ when $|t| > k$.

Anyone know how to compute this estimator? Or any easy reference to follow?

Thanks