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.

Installation

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.

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

Running ArduSub SITL with Gazebo

To run ArduSub SITL with Gazebo, it's necessary to:

  1. Install Gazebo-7 or Gazebo-8
  2. Install freebuoyancy_gazebo plugin for buoyancy simulation.
  3. 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.
  4. Run BlueRov2 Gazebo model

    1. Download bluerov_ros_playground

       git clone https://github.com/patrickelectric/bluerov_ros_playground
      
    2. Run Gazebo model

       cd bluerov_ros_playground
       source gazebo.sh
       gazebo worlds/underwater.world -u
       # Start the simulation
      
  5. 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.

Troubleshooting

  1. 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.
  2. Be sure that mavproxy is installed with whereis mavproxy, pip list | grep mavproxy -i or just mavproxy.
    • If mavproxy is not installed, please run the install packages script (described in step 1 of this troubleshooting) or install the packages manually.
  3. 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.
  4. Check if all ardupilot/modules folders are populated.
  5. If using SITL's --speedup command you need to set MAVProxy's heartbeat output to match the speedup rate
    • Example set heartbeat 8

results matching ""

    No results matching ""