  In this paper we consider an obstacle problem for a generalization of the
p-elastic energy among graphical curves with fixed ends. Taking into account
that the Euler--Lagrange equation has a degeneracy, we address the question
whether solutions have a flat part, i.e. an open interval where the curvature
vanishes. We also investigate which is the main cause of the loss of
regularity, the obstacle or the degeneracy. Moreover, we give several
conditions on the obstacle that assure existence and nonexistence of solutions.
The analysis can be refined in the special case of the p-elastica functional,
where we obtain sharp existence results and uniqueness for symmetric
minimizers.
