Currently used wireless capsule endoscopy (WCE) is limited in terms of inspection time and flexibility since the capsule is passively moved by peristalsis and cannot be accurately positioned. Different methods have been proposed to facilitate active locomotion of WCE based on simultaneous magnetic actuation and localization technologies. In this work, we first investigate the trajectory following (TF) problem of a robotic capsule under reciprocally rotating magnetic actuation in a tubular environment, in order to safely, efficiently and accurately perform inspection of the intestine at given points. Specifically, four TF strategies are proposed and analyzed based on the PD controller, adaptive controller, model predictive controller and robust multi-stage model predictive controller. Moreover, we take into consideration the intestinal peristalsis and friction in our controller design by explicitly modeling the interdigestive migrating motor complex (MMC) mechanism in the intestine. We validate our methods in real-world experiments in various tubular environments including phantoms with different shapes and an ex-vivo pig colon. The results show that our approach can effectively actuate a reciprocally rotating capsule to follow a desired trajectory in complex tubular environments, thereby enabling repeated and accurate inspection of the intestine for high-quality diagnosis.