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.
This part assumes that you have already set up SITL on your machine. First is necessary to be inside ArduSub folder.
cd ardupilot/ArduSub
To execute SITL with sim_vehicle.py
.
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:
sim_vehicle.py --help
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 rungit checkout add_link
. -
Run BlueRov2 Gazebo model
-
Download bluerov_ros_playground
git clone https://github.com/patrickelectric/bluerov_ros_playground
-
Run Gazebo model
cd bluerov_ros_playground source gazebo.sh 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.
- Check if all dependencies are installed via install some required packages.
- If you are running an Unix OS, it's possible also to install missing dependencies with your package manager or
pip
.
- If you are running an Unix OS, it's possible also to install missing dependencies with your package manager or
- Be sure that mavproxy is installed with
whereis mavproxy
,pip list | grep mavproxy -i
or justmavproxy
.- If mavproxy is not installed, please run the install packages script (described in step 1 of this troubleshooting) or install the packages manually.
- Check if ArduPilot tools are in your system PATH. It's possible to check with
echo $PATH | grep ardupilot
, the result should contains*/ardupilot/Tools/autotest
path.- Check again add some directories to your search path.
- Check if all
ardupilot/modules
folders are populated.- It's necessary to use git and update/sync all submodules after the first installation, check cloning with the command line.