I have been trying SITL for Ubuntu Linux but I have been having trouble. While I can successfully run the command “sim_vehicle.sh --console --map --aircraft test”, and a GPS map and console opens up, I also get a message “Waiting for heartbeat from tcp:127.0.0.1:5760”, and no plane appears on my map (at least I can’t find any), and the MAV> command prompt does not give me any feedback to my commands.
Could anyone help me out here? I’ve been at this for two days with no success.
Thank you very much!
PS: I hope I’m posting in the correct section. I apologise if I am not.
5760 is the port that ArduPlane (or any other vehicle) and MAVProxy communicate on. Do you have any old running processes i.e is MAVProxy still running from a previous failed start and its now blocking communication on that port?
Thanks, Grant.
I had this issue yesterday after loading ROS KINETIC on LTS 16.04 and when I launched SITL, it showed python error related to “kwag” and No Vehicle on MAP.
I did a tool reinstall-prereqs-ubuntu.sh and then I realized that the script do not set environment variables on .bashrc as we use to work with ROS, but on .profile , so we need to Logout/Login in order to get the new environment set.
No, it didn’t help.
Ubuntu LTS 18.04 ArduCopter 3.5
Sorry. There is a small nuance that I build for copter
volk@vbox:~/ardupilot/ardupilot/ArduCopter$ sim_vehicle.py -j4 --map --console
SIM_VEHICLE: Start
SIM_VEHICLE: Killing tasks
SIM_VEHICLE: Starting up at -35.363261,149.165230,584,353 (CMAC)
SIM_VEHICLE: WAF build
SIM_VEHICLE: Configure waf
SIM_VEHICLE: "/home/volk/ardupilot/ardupilot/modules/waf/waf-light" "configure" "--board" "sitl"
Setting top to : /home/volk/ardupilot/ardupilot
Setting out to : /home/volk/ardupilot/ardupilot/build
Autoconfiguration : enabled
Setting board to : sitl
Checking for 'g++' (C++ compiler) : /usr/lib/ccache/g++
Checking for 'gcc' (C compiler) : /usr/lib/ccache/gcc
Checking for need to link with librt : not necessary
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 program 'python' : /usr/bin/python
Checking for python version >= 2.7.0 : 2.7.15
Checking for program 'python' : /usr/bin/python
Checking for python version >= 2.7.0 : 2.7.15
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
'configure' finished successfully (3.038s)
SIM_VEHICLE: Building
SIM_VEHICLE: "/home/volk/ardupilot/ardupilot/modules/waf/waf-light" "build" "--target" "bin/arducopter" "-j" "4"
Waf: Entering directory `/home/volk/ardupilot/ardupilot/build/sitl'
Waf: Leaving directory `/home/volk/ardupilot/ardupilot/build/sitl'
BUILD SUMMARY
Build directory: /home/volk/ardupilot/ardupilot/build/sitl
Target Text Data BSS Total
----------------------------------------------
bin/arducopter 1569380 56142 36416 1661938
Build commands will be stored in build/sitl/compile_commands.json
'build' finished successfully (5.940s)
SIM_VEHICLE: Using defaults from (/home/volk/ardupilot/ardupilot/Tools/autotest/default_params/copter.parm)
SIM_VEHICLE: Run ArduCopter
SIM_VEHICLE: "/home/volk/ardupilot/ardupilot/Tools/autotest/run_in_terminal_window.sh" "ArduCopter" "/home/volk/ardupilot/ardupilot/build/sitl/bin/arducopter" "-S" "-I0" "--home" "-35.363261,149.165230,584,353" "--model" "+" "--speedup" "1" "--defaults" "/home/volk/ardupilot/ardupilot/Tools/autotest/default_params/copter.parm"
SIM_VEHICLE: Run MavProxy
SIM_VEHICLE: "mavproxy.py" "--master" "tcp:127.0.0.1:5760" "--sitl" "127.0.0.1:5501" "--out" "127.0.0.1:14550" "--out" "127.0.0.1:14551" "--map" "--console"
RiTW: Starting ArduCopter : /home/volk/ardupilot/ardupilot/build/sitl/bin/arducopter -S -I0 --home -35.363261,149.165230,584,353 --model + --speedup 1 --defaults /home/volk/ardupilot/ardupilot/Tools/autotest/default_params/copter.parm
# Option “-e” is deprecated and might be removed in a later version of gnome-terminal.
# Use “-- ” to terminate the options and put the command line to execute after it.
Connect tcp:127.0.0.1:5760 source_system=255
Loaded module console
Loaded module map
Log Directory:
Telemetry log: mav.tlog
Waiting for heartbeat from tcp:127.0.0.1:5760
MAV>
You were right. Xterm wasn’t install. So I install it, but it didn’t help. Now ArduCopter starts in xterm. Information from the window:
Started model + at -35.363261,149.165230,584,353 at speed 1.0
Starting sketch 'ArduCopter'
Starting SITL input
Using Irlock at port : 9005
bind port 5760 for 0
Serial port 0 on TCP port 5760
Waiting for connection ....
Smoothing reset at 0.001
Remaining: 0.250000 litres
Pump: 0.000000 l/s
Spinner: 0.000000 rev/s
position_demand=0.000000 jaw_gap=30.000000 load=0.000000
check_group_info:184: Duplicate group idx 7 for SMART_RTL
Bad var table
I rolled back the version of the project to the previous one and it worked. Very strange, because the current version of the project is compiled. In any case, I am happy, I will try to continue working with the previous version.
Try starting sim_vehicle with “-w” to clear the parameters - but the
problem you see here is usually because parameter specification has been
stuffed up somehow…
I changed the code of one of the libraries, but did not touch any parameters of the specification. I tried to run sim_vehicle with “-w” first, but it did not help.