Communication Problem Between SITL and Gazebo

Hi, I have set up SITL on my QGroundControl. I need to provide communication between SITL and Gazebo. However, I encounter some issues while connecting QGroundControl with Gazebo. I can run QGroundControl with SITL, but when I enter “sim_vehicle.py -f gazebo-bluerov2 -L RATBeach - -out=udp:0.0.0.0:14550 - -console” the communication can’t be done wit+h gazebo and also I lose communication between QGroundControl and SITL. I have “link 1 down” on the console as an output.
As far as I figured, the ‘-f’ option in ‘sim.py’ is causing the problem.

The output for SITL:

SIM_VEHICLE: Start
SIM_VEHICLE: Killing tasks
SIM_VEHICLE: Starting up at [33.810313, -118.393867, 0.0, 270.0] (RATBeach)
SIM_VEHICLE: WAF build
SIM_VEHICLE: Configure waf
SIM_VEHICLE: “/home/kedy/ardupilot/modules/waf/waf-light” “configure” “–board” “sitl”
Setting top to : /home/kedy/ardupilot
Setting out to : /home/kedy/ardupilot/build
Autoconfiguration : enabled
Setting board to : sitl
Using toolchain : native
Checking for ‘g++’ (C++ compiler) : /usr/lib/ccache/g++
Checking for ‘gcc’ (C compiler) : /usr/lib/ccache/gcc
Checking for c flags ‘-MMD’ : yes
Checking for cxx flags ‘-MMD’ : yes
CXX Compiler : g++ 9.4.0
Checking for need to link with librt : not necessary
Checking for feenableexcept : yes
Enabled OpenDroneID : no
Enabled firmware ID checking : no
GPS Debug Logging : no
Enabled custom controller : yes
Checking for HAVE_CMATH_ISFINITE : yes
Checking for HAVE_CMATH_ISINF : yes
Checking for HAVE_CMATH_ISNAN : yes
Checking for NEED_CMATH_ISFINITE_STD_NAMESPACE : yes
Checking for NEED_CMATH_ISINF_STD_NAMESPACE : yes
Checking for NEED_CMATH_ISNAN_STD_NAMESPACE : yes
Checking for header endian.h : yes
Checking for header byteswap.h : yes
Checking for HAVE_MEMRCHR : yes
Configured VSCode Intellisense: : no
Checking for program ‘python’ : /usr/bin/python
Checking for python version >= 2.7.0 : 3.8.10
Checking for program ‘python’ : /usr/bin/python
Checking for python version >= 2.7.0 : 3.8.10
DSDL compiler : /home/kedy/ardupilot/modules/uavcan/libuavcan/dsdl_compiler/libuavcan_dsdlc
Source is git repository : yes
Update submodules : yes
Checking for program ‘git’ : /usr/bin/git
Checking for program ‘size’ : /usr/bin/size
Benchmarks : disabled
Unit tests : enabled
Scripting : enabled
Scripting runtime checks : enabled
Debug build : disabled
Coverage build : disabled
SITL 32-bit build : disabled
Checking for program ‘rsync’ : /usr/bin/rsync
‘configure’ finished successfully (0.722s)
{‘waf_target’: ‘bin/ardusub’, ‘default_params_filename’: ‘default_params/sub.parm’, ‘model’: ‘gazebo-bluerov2’, ‘sitl-port’: True}
SIM_VEHICLE: Building
SIM_VEHICLE: “/home/kedy/ardupilot/modules/waf/waf-light” “build” “–target” “bin/ardusub”
Waf: Entering directory /home/kedy/ardupilot/build/sitl' Embedding file locations.txt:Tools/autotest/locations.txt Embedding file models/Callisto.json:Tools/autotest/models/Callisto.json Embedding file models/plane-3d.parm:Tools/autotest/models/plane-3d.parm Embedding file models/plane.parm:Tools/autotest/models/plane.parm Embedding file models/xplane_heli.json:Tools/autotest/models/xplane_heli.json Embedding file models/xplane_plane.json:Tools/autotest/models/xplane_plane.json Waf: Leaving directory /home/kedy/ardupilot/build/sitl’

BUILD SUMMARY
Build directory: /home/kedy/ardupilot/build/sitl
Target Text (B) Data (B) BSS (B) Total Flash Used (B) Free Flash (B)

bin/ardusub 3480036 140477 202824 3620513 Not Applicable

Build commands will be stored in build/sitl/compile_commands.json
‘build’ finished successfully (1.498s)
SIM_VEHICLE: Using defaults from (…/Tools/autotest/default_params/sub.parm)
SIM_VEHICLE: Run ArduSub
SIM_VEHICLE: “/home/kedy/ardupilot/Tools/autotest/run_in_terminal_window.sh” “ArduSub” “/home/kedy/ardupilot/build/sitl/bin/ardusub” “-S” “–model” “gazebo-bluerov2” “–speedup” “1” “–slave” “0” “–defaults” “…/Tools/autotest/default_params/sub.parm” “–sim-address=127.0.0.1” “-I0” “–home” “33.810313,-118.39386700000001,0.0,270.0”
RiTW: Starting ArduSub : /home/kedy/ardupilot/build/sitl/bin/ardusub -S --model gazebo-bluerov2 --speedup 1 --slave 0 --defaults …/Tools/autotest/default_params/sub.parm --sim-address=127.0.0.1 -I0 --home 33.810313,-118.39386700000001,0.0,270.0
SIM_VEHICLE: Run MavProxy
SIM_VEHICLE: “mavproxy.py” “–out” “127.0.0.1:14550” “–out” “127.0.0.1:14551” “–master” “tcp:127.0.0.1:5760” “–sitl” “127.0.0.1:5501” “–out” “udp:0.0.0.0:14550” “–console”
Connect tcp:127.0.0.1:5760 source_system=255
Loaded module console
Log Directory:
Telemetry log: mav.tlog
Waiting for heartbeat from tcp:127.0.0.1:5760
MAV>

The output for Gazebo:

Loading freebuoyancy_gazebo plugin…
Loaded freebuoyancy_gazebo plugin.

I couldn’t understand the problem. How can I solve this issue?

Hi,

I would recommend to have an udp output dedicated to QGC, 14550 is probably being used by gazebo already.

2 Likes

Merhaba,
çözebildin mi problemi

Merhaba, çözemedim maalesef :frowning: ArduSub’ın kendi sitesindeki modellerle deneyince böyle bir bağlantı hatası verdi. Anlamadım da.

Sorunu çözdüm buraya da yazayım belki aynısını yaşayan olur, trajikomik bir şekilde gazebo simülasyonu sol alttaki tuştan başlatmak gerekiyormuş, eğer kurulumlar doğru ise (gazebo 7 veya 8 olmasına gerek yok 9 da çalıştırdım ben) sitl ve gazebo sorunsuz bir şekilde senkronize çalışıyor.

1 Like

Gerçekten trajikomikmiş. Çözüm için teşekkürler :slight_smile: