Hello. I am trying to do a SITL simulation with SITL for linux.I was able to run SITL successfully with the file I cloned from GitHub (GitHub - ArduPilot/ardupilot: ArduPlane, ArduCopter, ArduRover, ArduSub source), but the Ardupilot file I am using in my experiments (an Ardupilot file from about a year ago I have edited the controller program and parameters a bit in the ArduPlane file section), the SITL simulation does not work, and the following error message appears.
SIM_VEHICLE: Start
SIM_VEHICLE: Killing tasks
SIM_VEHICLE: Starting up at SITL location
SIM_VEHICLE: WAF build
SIM_VEHICLE: Configure waf
SIM_VEHICLE: “/home/username/orange/modules/waf/waf-light” “configure” “–board” “sitl”
Setting top to : /home/username/orange
Setting out to : /home/username/orange/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++ 11.4.0
Checking for need to link with librt : not necessary
Checking for feenableexcept : 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.10.12
Checking for program ‘python’ : /usr/bin/python
Checking for python version >= 2.7.0 : 3.10.12
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 (6.883s)
{‘waf_target’: ‘bin/arduplane’, ‘default_params_filename’: ‘models/plane.parm’, ‘model’: ‘plane’, ‘sitl-port’: True}
SIM_VEHICLE: Building
SIM_VEHICLE: “/home/username/orange/modules/waf/waf-light” “build” “–target” “bin/arduplane”
Waf: Entering directory /home/username/orange/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/katsuakitakeuchi/orange/build/sitl’
BUILD SUMMARY
Build directory: /home/username/orange/build/sitl
Target Text (B) Data (B) BSS (B) Total Flash Used (B) Free Flash (B)
bin/arduplane 3751026 181885 198728 3932911 Not Applicable
Build commands will be stored in build/sitl/compile_commands.json
‘build’ finished successfully (5.049s)
SIM_VEHICLE: Using defaults from (Tools/autotest/models/plane.parm)
SIM_VEHICLE: Run ArduPlane
SIM_VEHICLE: “/home/katsuakitakeuchi/orange/Tools/autotest/run_in_terminal_window.sh” “ArduPlane” “/home/username/orange/build/sitl/bin/arduplane” “-S” “-w” “–model” “plane” “–speedup” “1” “–slave” “0” “–defaults” “Tools/autotest/models/plane.parm” “–sim-address=127.0.0.1” “-I0”
RiTW: Starting ArduPlane : /home/username/orange/build/sitl/bin/arduplane -S -w --model plane --speedup 1 --slave 0 --defaults Tools/autotest/models/plane.parm --sim-address=127.0.0.1 -I0
SIM_VEHICLE: Run MavProxy
SIM_VEHICLE: “mavproxy.py” “–out” “172.22.0.1:14550” “–master” “tcp:127.0.0.1:5760” “–sitl” “127.0.0.1:5501”
xterm: cannot load font “10x20”
xterm: cannot load font “-misc-fixed-medium-r-normal–20-200-75-75-c-100-iso10646-1”
Connect tcp:127.0.0.1:5760 source_system=255
Log Directory:
Telemetry log: mav.tlog
Waiting for heartbeat from tcp:127.0.0.1:5760
MAV> Connection reset or closed by peer on TCP socket
Attempting reconnect
[Errno 111] Connection refused sleeping
[Errno 111] Connection refused sleeping
Attempting reconnect
[Errno 111] Connection refused sleeping
[Errno 111] Connection refused sleeping
link 1 down
Attempting reconnect
[Errno 111] Connection refused sleeping
[Errno 111] Connection refused sleeping
Attempting reconnect
[Errno 111] Connection refused sleeping
[Errno 111] Connection refused sleeping
Attempting reconnect
[Errno 111] Connection refused sleeping
[Errno 111] Connection refused sleeping
Attempting reconnect
[Errno 111] Connection refused sleeping
[Errno 111] Connection refused sleeping
Attempting reconnect
[Errno 111] Connection refused sleeping
[Errno 111] Connection refused sleeping
Attempting reconnect
[Errno 111] Connection refused sleeping
[Errno 111] Connection refused sleeping
Attempting reconnect
[Errno 111] Connection refused sleeping
[Errno 111] Connection refused sleeping
In the other one.
Setting SIM_SPEEDUP=1.000000
Starting sketch ‘ArduPlane’
Starting SITL input
Using Irlock at port : 9005
bind port 5760 for 0
Serial port 0 on TCP port 5760
Waiting for connection …
Connection on serial port 5760
Loaded defaults from Tools/autotest/default_params/plane.parm
Home: -35.363262 149.165237 alt=584.000000m hdg=353.000000
Smoothing reset at 0.001
bind port 5762 for 2
Serial port 2 on TCP port 5762
bind port 5763 for 3
Serial port 3 on TCP port 5763
validate_structures:469: Validating structures
ERROR: segmentation fault - aborting
Running: sh Tools/scripts/dumpstack.sh 8230 >dumpstack.sh_arduplane.8230.out 2>&1
dumpstack.sh has been run. Output was:
-------------- begin dumpstack.sh output ----------------
[Thread debugging using libthread_db enabled]
Using host libthread_db library “/lib/x86_64-linux-gnu/libthread_db.so.1”.
0x00007fa1869ce45a in __GI___wait4 (pid=8231, stat_loc=stat_loc@entry=0x7ffc888ded48, options=options@entry=0, usage=usage@entry=0x0) at …/sysdeps/unix/sysv/linux/wait4.c:30
30 …/sysdeps/unix/sysv/linux/wait4.c: No such file or directory.
#0 0x00007fa1869ce45a in __GI___wait4 (pid=8231, stat_loc=stat_loc@entry=0x7ffc888ded48, options=options@entry=0, usage=usage@entry=0x0) at …/sysdeps/unix/sysv/linux/wait4.c:30
sc_ret = -512
sc_ret =
#1 0x00007fa1869ce41b in __GI___waitpid (pid=, stat_loc=stat_loc@entry=0x7ffc888ded48, options=options@entry=0) at ./posix/waitpid.c:38
No locals.
#2 0x00007fa186934bcb in do_system (line=) at …/sysdeps/posix/system.c:171
__result = 1:18 2023/08/08 1:24 2023/08/081:24 2023/08/0866666666666666666
_cleanup_start_doit = true
_buffer = {__routine = 0x7fa186934c50 <cancel_handler>, __arg = 0x7ffc888ded50, __canceltype = 0, __prev = 0x0}
_cleanup_routine = 0x7fa186934c50 <cancel_handler>
cancel_args = {quit = 0x7fa186aff7a0 , intr = 0x7fa186aff840 , pid = 8231}
status = -1
ret = 0
pid = 8231
sa = {__sigaction_handler = {sa_handler = 0x1, sa_sigaction = 0x1}, sa_mask = {__val = {65536, 0, 0, 0, 0, 0, 0, 0, 0, 2141192192, 0, 18446744073709551615, 0, 18446744073709551615, 0, 18446744073709551615}}, sa_flags = 0, sa_restorer = 0x7fa00000ffffffff}
omask = {__val = {1024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 140722599490208, 3473174956023346023, 13239181903880427520, 140722599490208, 2}}
reset = {__val = {6, 199, 140722599489136, 94338285314413, 140722599489520, 140331724490010, 140722599489536, 140722599489376, 140724530937857, 140722599490208, 140722599490208, 140722599490208, 140722599490208, 140722599490280, 140722599490407, 140722599490208}}
spawn_attr = {__flags = 12, __pgrp = 0, __sd = {__val = {6, 199, 140722599489136, 94338285314413, 140722599489520, 140331724490010, 140722599489536, 140722599489376, 140724530937857, 140722599490208, 140722599490208, 140722599490208, 140722599490208, 140722599490280, 140722599490407, 140722599490208}}, __ss = {__val = {1024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 140722599490208, 3473174956023346023, 13239181903880427520, 140722599490208, 2}}, __sp = {sched_priority = 0}, __policy = 0, __pad = {0 <repeats 16 times>}}
#3 0x000055ccd7ea43f1 in AP_HAL::run_command_on_ownpid(char const*) ()
No symbol table info available.
#4 0x000055ccd7ea4e2c in _sig_segv(int) ()
No symbol table info available.
#5
No locals.
#6 __strnlen_avx2 () at …/sysdeps/x86_64/multiarch/strlen-avx2.S:74
No locals.
#7 0x000055ccd7de311a in AP_Logger::validate_structure(LogStructure const*, short) ()
#10 0x000055ccd7d367e7 in Plane::init_ardupilot() ()
No symbol table info available.
#11 0x000055ccd7ddf929 in AP_Vehicle::setup() ()
No symbol table info available.
#12 0x000055ccd7e9e69d in HAL_SITL::run(int, char* const*, AP_HAL::HAL::Callbacks*) const ()
No symbol table info available.
#13 0x000055ccd7cf9f54 in main ()
No symbol table info available.
Thread 1 (Thread 0x7fa1868df740 (LWP 8230) “arduplane”):
#0 0x00007fa1869ce45a in __GI___wait4 (pid=8231, stat_loc=stat_loc@entry=0x7ffc888ded48, options=options@entry=0, usage=usage@entry=0x0) at …/sysdeps/unix/sysv/linux/wait4.c:30
sc_ret = -512
sc_ret =
#1 0x00007fa1869ce41b in __GI___waitpid (pid=, stat_loc=stat_loc@entry=0x7ffc888ded48, options=options@entry=0) at ./posix/waitpid.c:38
No locals.
#2 0x00007fa186934bcb in do_system (line=) at …/sysdeps/posix/system.c:171
__result =
_cleanup_start_doit = true
_buffer = {__routine = 0x7fa186934c50 <cancel_handler>, __arg = 0x7ffc888ded50, __canceltype = 0, __prev = 0x0}
_cleanup_routine = 0x7fa186934c50 <cancel_handler>
cancel_args = {quit = 0x7fa186aff7a0 , intr = 0x7fa186aff840 , pid = 8231}
status = -1
ret = 0
pid = 8231
sa = {__sigaction_handler = {sa_handler = 0x1, sa_sigaction = 0x1}, sa_mask = {__val = {65536, 0, 0, 0, 0, 0, 0, 0, 0, 2141192192, 0, 18446744073709551615, 0, 18446744073709551615, 0, 18446744073709551615}}, sa_flags = 0, sa_restorer = 0x7fa00000ffffffff}
omask = {__val = {1024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 140722599490208, 3473174956023346023, 13239181903880427520, 140722599490208, 2}}
reset = {__val = {6, 199, 140722599489136, 94338285314413, 140722599489520, 140331724490010, 140722599489536, 140722599489376, 140724530937857, 140722599490208, 140722599490208, 140722599490208, 140722599490208, 140722599490280, 140722599490407, 140722599490208}}
spawn_attr = {__flags = 12, __pgrp = 0, __sd = {__val = {6, 199, 140722599489136, 94338285314413, 140722599489520, 140331724490010, 140722599489536, 140722599489376, 140724530937857, 140722599490208, 140722599490208, 140722599490208, 140722599490208, 140722599490280, 140722599490407, 140722599490208}}, __ss = {__val = {1024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 9196350441231745024, 140722599490208, 3473174956023346023, 13239181903880427520, 140722599490208, 2}}, __sp = {sched_priority = 0}, __policy = 0, __pad = {0 <repeats 16 times>}}
#3 0x000055ccd7ea43f1 in AP_HAL::run_command_on_ownpid(char const*) ()
No symbol table info available.
#4 0x000055ccd7ea4e2c in _sig_segv(int) ()
No symbol table info available.
#5
No locals.
#6 __strnlen_avx2 () at …/sysdeps/x86_64/multiarch/strlen-avx2.S:74
No locals.
#7 0x000055ccd7de311a in AP_Logger::validate_structure(LogStructure const*, short) ()
No symbol table info available.
#8 0x000055ccd7de3641 in AP_Logger::validate_structures(LogStructure const*, unsigned char) ()
No symbol table info available.
#9 0x000055ccd7de392d in AP_Logger::Init(LogStructure const*, unsigned char) ()
No symbol table info available.
#10 0x000055ccd7d367e7 in Plane::init_ardupilot() ()
No symbol table info available.
#11 0x000055ccd7ddf929 in AP_Vehicle::setup() ()
No symbol table info available.
#12 0x000055ccd7e9e69d in HAL_SITL::run(int, char* const*, AP_HAL::HAL::Callbacks*) const ()
No symbol table info available.
#13 0x000055ccd7cf9f54 in main ()
No symbol table info available.
A debugging session is active.
Inferior 1 [process 8230] will be detached.
Quit anyway? (y or n) [answered Y; input not from terminal]
[Inferior 1 (process 8230) detached]
-------------- end dumpstack.sh output ----------------
Running: sh Tools/scripts/dumpcore.sh 8230 >dumpcore.sh_arduplane.8230.out 2>&1
dumpcore.sh has been run. Output was:
-------------- begin dumpcore.sh output ----------------
[Thread debugging using libthread_db enabled]
Using host libthread_db library “/lib/x86_64-linux-gnu/libthread_db.so.1”.
0x00007fa1869ce45a in __GI___wait4 (pid=8249, stat_loc=stat_loc@entry=0x7ffc888ded48, options=options@entry=0, usage=usage@entry=0x0) at …/sysdeps/unix/sysv/linux/wait4.c:30
30 …/sysdeps/unix/sysv/linux/wait4.c: No such file or directory.
warning: target file /proc/8230/cmdline contained unexpected null characters
Saved corefile ap-8250.core
A debugging session is active.
Inferior 1 [process 8230] will be detached.
Quit anyway? (y or n) [answered Y; input not from terminal]
[Inferior 1 (process 8230) detached]
-------------- end dumpcore.sh output ----------------
No symbol table info available.
#8 0x000055ccd7de3641 in AP_Logger::validate_structures(LogStructure const*, unsigned char) ()
No symbol table info available.
#9 0x000055ccd7de392d in AP_Logger::Init(LogStructure const*, unsigned char) ()
No symbol table info available.
I would like some advice on how to deal with this error and make SITL simulation work well.