Cuspidal robots are robots with at least two inverse kinematic solutions that can be connected by a singularity-free path. Deciding the cuspidality of a generic 3R robots has been studied in the past, but extending the study to six-degree-of-freedom robots can be a challenging problem. Many robots can be modeled as a polynomial map together with a real algebraic set so that the notion of cuspidality can be extended to these data.In this paper we design an algorithm that, on input a polynomial map in n indeterminates, and s polynomials in the same indeterminates describing a real algebraic set of dimension d, decides the cuspidality of the restriction of the map to the real algebraic set under consideration. Moreover, if D and τ are respectively the maximum degree and a bound on the bit size of the coefficients of the input polynomials, this algorithm runs in time log-linear in τ and polynomial in ((s + d)nD) O(n 2 ) .It relies on many high-level algorithms in computer algebra which use advanced methods on real algebraic sets and critical loci of polynomial maps. As far as we know, this is the first algorithm that tackles the cuspidality problem from a general point of view.