— The control approaches based on tasks, and particularly based on a hierarchy of tasks, enable to build complex behaviors with some nice properties of robustness and portability. However it is difficult to consider directly unilateral constraints in such a framework. Unilateral constraints presents some strong irregularities (in particular at the level of their derivative) that prevents the insertion of unilateral-based tasks at the high-priority level of a hierarchy. In this paper, we present an original method to generalize the hierarchy-based control schemes to take unilateral constraint into account at the toppriority level. We develop our method first at the kinematic level then directly at the dynamic level using the operational space. The method is then validated on a various set of robots by realizing a visual servoing under the constraint of joint limits.