Sorry for taking so long to reply. I did a small documentation to help you with your simulation environment, this same documentation will be added in ardusub.com in the future.
S.I.T.L (Software In The Loop)
SITL is a simulator that allows you to run ArduSub without any hardware. It is a build of the autopilot code using an ordinary C++ compiler, giving you a native executable that allows you to test the behaviour of the vehicle.
To configure and run SITL for the first time in your computer, take a look in Running SITL ArduPilot documentation.
Running ArduSub SITL
This part assumes that you have already set up SITL on your machine.
First is necessary to be inside ArduSub folder.
To execute SITL with
sim_vehicle.py -L RATBeach --out=udp:0.0.0.0:14550 --map --console
After that, ArduSub SITL will compile and start to run, you’ll be able to connect it with QGroundControl and control it.
For more information about
sim_vehicle.py and the options available, check:
Running ArduSub SITL with Gazebo
To run ArduSub SITL with Gazebo, it’s necessary to:
Install freebuoyancy_gazebo plugin for buoyancy simulation.
Install ardupilot_gazebo/add_link plugin for ardupilot-gazebo communication. add_link is a branch that provides actuation over sdf links, after the
git clone, it’s necessary to run
git checkout add_link.
Run BlueRov2 Gazebo model
git clone https://github.com/patrickelectric/bluerov_ros_playground
Run Gazebo model
gazebo worlds/underwater.world -u
# Start the simulation
Execute ArduPilot SITL
sim_vehicle.py -f gazebo-bluerov2 -L RATBeach --out=udp:0.0.0.0:14550 --console
The console will start to display the output if the connection was successful.