Dynamics and Control of a Rigid Spacecraft with a Control Moment Gyroscope