I'm designing a simple autopilot software on top of Ardupilot, my goal is to possibly interface an Raspi on top of ArduPilot Mega (APM). I am stuck on setting up a simulation environment using either V-Rep or Gazebo. The quadcopter will have basic sensors plus advanced sensors. basic sensors talks directly with ArduPilot, while advanced sensors talks with my own autopilot software. I am trying to wrap my head around a feasible setup to test the software while using ArduPilot Mega in the Hardware-In-The-Loop. I am planning on having three stages of Simulation:
Stage 1. Simulate quadcopter physics in Gazebo/V-Rep, run ArduPilot software and my autopilot software in a VM (not sure if it's even do-able)
Stage 2. Simulate quadcopter physics in computer, run my autopilot software in a VM, and run APM in a hardware-in-the-loop fashion.
Stage 3. deploy my autopilot onto Raspi and interface with APM then run both hardwares in Hardware-in-the-loop fashion.