Launching sim_vehicle.py with Gazebo for another frame configuration than BlueRov2 (ArduSub)

Hello,

I am trying to simulate, in Gazebo, my custom ROV which uses the same motor configuration as SUB_FRAME_SIMPLEROV_4 in ardupilot/libraries/AP_Motors/AP_Motors6DOF.cpp.

I tried following this procedure without success.

I made sure that my simulation was working by launching Gazebo, and then launching sim_vehicle.py with this command line:
sim_vehicle.py -v ArduSub -f gazebo-bluerov2 --out=udp:127.0.0.1:14551 --console
This worked fine with the bluerov2 model, but obviously doesn’t work with my custom ROV model.

I looked into the code and realized that there is no equivalent argument to gazebo-bluerov2 for a gazebo-simplerov frame configuration in this file ardupilot/Tools/autotest/pysim/vehicleinfo.py.

I tried many things to launch sim_vehicle.py with gazebo-simplerov as an argument, but it doesn’t seem to work. Namely, I added the option gazebo-simplerov to vehicleinfo.py file while linking it to a new .parm file. For this new .parm file I copy-pasted the sub-6dof.parm file and changed the FRAME_CONFIG 2 argument to FRAME_CONFIG 5, matching the frame configuration from AP_Motors6DOF.cpp, but the Gazebo simulation still seems to use the default SUB_FRAME_VECTORED to launch.

I tried looking deeper into the code, but I am struggling to understand where the frame configuration is actually selected from the sim_vehicle.py launch.

Thank you,

Hi @chcaya, if you are using a newer version of Gazebo you can launch SITL with a custom parameter set using:

sim_vehicle.py -v ArduSub -f JSON --add-param-file=your-custom-rov.parm --console --map

Where your-custom-rov.parm file will contain the frame details, servo mappings etc for your vehicle. You can start with the basic sub param file, edit the params in MAVProxy then save them ready for the next session.

We don’t have a sub example in out models collection, but for some examples of custom frames running in Gazebo see ArduPilot/SITL_Models, the Quadruped shows how to use Lua scripting.