This paper addresses the problem of computing the sequence of positions in space (inspection script) from which a robot-mounted sensor can perform a given inspection task optimally. We present the design and partial realisation of a sensor planning system, GASP, capable of generating inspection scripts for a variety of tasks, objects and sensors. The treatment of detection uncertainty is discussed with reference to the problem of detecting line features; the generalised sensor is introduced, and novel results in a simulated environment are reported.