When you execute the origin setting under an environment having obstacles in the
workspace that may be hit by the robot in its movements, and at the time you set
the sequence of origin, you should set it in the sequency making Z axis execute the
origin setting first, and then the remaining axes follow.