Text this: Optimal Control of Constrained Piecewise Affine Systems