Setting up SITL ArduCopter

Hi everyone!

I'm trying to start SITL on Linux Mint to connect it to Mission Planner on Windows. The thing is that I can connect it when I'm simulating with ArduPlane but not when I'm with ArduCopter, in fact it doesn't even start. I would be very grateful if someone helped me, please.

The output error is the following one:

$sim_vehicle.sh -w
+ '[' -z '' ']'
++ basename /home/rub/ardupilot/ArduCopter
+ VEHICLE=ArduCopter
+ EXTRA_PARM=
+ EXTRA_SIM=
+ case $FRAME in
+ '[' 0 == 1 ']'
+++ readlink -e /home/rub/ardupilot/Tools/autotest/sim_vehicle.sh
++ dirname /home/rub/ardupilot/Tools/autotest/sim_vehicle.sh
+ autotest=/home/rub/ardupilot/Tools/autotest
+ '[' 0 == 0 ']'
+ pushd /home/rub/ardupilot/Tools/autotest/../../ArduCopter
~/ardupilot/ArduCopter ~/ardupilot/ArduCopter
+ '[' '!' -f /home/rub/ardupilot/Tools/autotest/../../config.mk ']'
+ '[' 0 == 1 ']'
+ make sitl -j1
// BUILDROOT=/tmp/ArduCopter.build HAL_BOARD=HAL_BOARD_AVR_SITL HAL_BOARD_SUBTYPE=HAL_BOARD_SUBTYPE_NONE TOOLCHAIN=NATIVE EXTRAFLAGS=-DGIT_VERSION="50d2e98a"
building /tmp/ArduCopter.build/ArduCopter.cpp
%% ArduCopter.cpp
%% libraries/AC_AttitudeControl/AC_PosControl.o
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp: In member function 'bool AC_PosControl::is_active_z() const':
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp:220:62: error: 'POSCONTROL_ACTIVE_TIMEOUT_MS' was not declared in this scope
     return ((hal.scheduler->millis() - _last_update_z_ms) <= POSCONTROL_ACTIVE_TIMEOUT_MS);
                                                              ^
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp: In member function 'void AC_PosControl::update_z_controller()':
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp:228:35: error: 'POSCONTROL_ACTIVE_TIMEOUT_MS' was not declared in this scope
     if (now - _last_update_z_ms > POSCONTROL_ACTIVE_TIMEOUT_MS) {
                                   ^
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp: In member function 'bool AC_PosControl::is_active_xy() const':
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp:500:63: error: 'POSCONTROL_ACTIVE_TIMEOUT_MS' was not declared in this scope
     return ((hal.scheduler->millis() - _last_update_xy_ms) <= POSCONTROL_ACTIVE_TIMEOUT_MS);
                                                               ^
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp: In member function 'bool AC_PosControl::is_active_z() const':
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp:221:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp: In member function 'bool AC_PosControl::is_active_xy() const':
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp:501:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make: *** [/tmp/ArduCopter.build/libraries/AC_AttitudeControl/AC_PosControl.o] Error 1
+ make clean
+ make sitl -j1
// BUILDROOT=/tmp/ArduCopter.build HAL_BOARD=HAL_BOARD_AVR_SITL HAL_BOARD_SUBTYPE=HAL_BOARD_SUBTYPE_NONE TOOLCHAIN=NATIVE EXTRAFLAGS=-DGIT_VERSION="50d2e98a"
building /tmp/ArduCopter.build/ArduCopter.cpp
%% ArduCopter.cpp
%% ArduCopter.o
autogenerated:288:14: warning: 'void heli_init()' declared 'static' but never defined [-Wunused-function]
autogenerated:289:17: warning: 'int16_t get_pilot_desired_collective(int16_t)' declared 'static' but never defined [-Wunused-function]
autogenerated:290:14: warning: 'void check_dynamic_flight()' declared 'static' but never defined [-Wunused-function]
autogenerated:291:14: warning: 'void update_heli_control_dynamics()' declared 'static' but never defined [-Wunused-function]
autogenerated:292:14: warning: 'void heli_update_landing_swash()' declared 'static' but never defined [-Wunused-function]
autogenerated:293:14: warning: 'void heli_update_rotor_speed_targets()' declared 'static' but never defined [-Wunused-function]
autogenerated:294:14: warning: 'bool heli_acro_init(bool)' declared 'static' but never defined [-Wunused-function]
autogenerated:295:14: warning: 'void heli_acro_run()' declared 'static' but never defined [-Wunused-function]
autogenerated:296:14: warning: 'void get_pilot_desired_yaw_rate(int16_t, float&)' declared 'static' but never defined [-Wunused-function]
autogenerated:297:14: warning: 'bool heli_stabilize_init(bool)' declared 'static' but never defined [-Wunused-function]
autogenerated:298:14: warning: 'void heli_stabilize_run()' declared 'static' but never defined [-Wunused-function]
%% libraries/AC_AttitudeControl/AC_AttitudeControl.o
%% libraries/AC_AttitudeControl/AC_AttitudeControl_Heli.o
%% libraries/AC_AttitudeControl/AC_PosControl.o
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp: In member function 'bool AC_PosControl::is_active_z() const':
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp:220:62: error: 'POSCONTROL_ACTIVE_TIMEOUT_MS' was not declared in this scope
     return ((hal.scheduler->millis() - _last_update_z_ms) <= POSCONTROL_ACTIVE_TIMEOUT_MS);
                                                              ^
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp: In member function 'void AC_PosControl::update_z_controller()':
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp:228:35: error: 'POSCONTROL_ACTIVE_TIMEOUT_MS' was not declared in this scope
     if (now - _last_update_z_ms > POSCONTROL_ACTIVE_TIMEOUT_MS) {
                                   ^
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp: In member function 'bool AC_PosControl::is_active_xy() const':
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp:500:63: error: 'POSCONTROL_ACTIVE_TIMEOUT_MS' was not declared in this scope
     return ((hal.scheduler->millis() - _last_update_xy_ms) <= POSCONTROL_ACTIVE_TIMEOUT_MS);
                                                               ^
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp: In member function 'bool AC_PosControl::is_active_z() const':
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp:221:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp: In member function 'bool AC_PosControl::is_active_xy() const':
/home/rub/ardupilot/libraries/AC_AttitudeControl/AC_PosControl.cpp:501:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make: *** [/tmp/ArduCopter.build/libraries/AC_AttitudeControl/AC_PosControl.o] Error 1
+ popd
~/ardupilot/ArduCopter
++ cut -d= -f2
++ grep -i '^CMAC='
++ cat /home/rub/ardupilot/Tools/autotest/locations.txt
+ SIMHOME=-35.363261,149.165230,584,353
+ '[' -z -35.363261,149.165230,584,353 ']'
+ echo 'Starting up at CMAC : -35.363261,149.165230,584,353'
Starting up at CMAC : -35.363261,149.165230,584,353
++ cut -d= -f2
++ grep -i '^CMAC_PILOTSBOX='
++ cat /home/rub/ardupilot/Tools/autotest/locations.txt
+ TRACKER_HOME=-35.362734,149.165300,586,270
+ '[' -z -35.362734,149.165300,586,270 ']'
+ '[' 0 == 1 ']'
+ cmd='/tmp/ArduCopter.build/ArduCopter.elf -I0'
+ '[' 1 == 1 ']'
+ cmd='/tmp/ArduCopter.build/ArduCopter.elf -I0 -w'
+ case $VEHICLE in
+ RUNSIM='nice /home/rub/ardupilot/Tools/autotest/pysim/sim_multicopter.py --home=-35.363261,149.165230,584,353 --simin=127.0.0.1:5502 --simout=127.0.0.1:5501 --fgout=127.0.0.1:5503 '
+ PARMS=copter_params.parm
+ '[' 0 == 0 ']'
+ '[' 0 == 1 ']'
+ '[' 0 == 1 ']'
+ /home/rub/ardupilot/Tools/autotest/run_in_terminal_window.sh ardupilot /tmp/ArduCopter.build/ArduCopter.elf -I0 -w
Starting ardupilot : /tmp/ArduCopter.build/ArduCopter.elf -I0 -w
Window access not found, logging to /tmp/ardupilot.log
+ trap kill_tasks SIGINT
+ sleep 2
+ rm -f
+ '[' 0 == 0 ']'
+ /home/rub/ardupilot/Tools/autotest/run_in_terminal_window.sh Simulator nice /home/rub/ardupilot/Tools/autotest/pysim/sim_multicopter.py --home=-35.363261,149.165230,584,353 --simin=127.0.0.1:5502 --simout=127.0.0.1:5501 --fgout=127.0.0.1:5503
Starting Simulator : nice /home/rub/ardupilot/Tools/autotest/pysim/sim_multicopter.py --home=-35.363261,149.165230,584,353 --simin=127.0.0.1:5502 --simout=127.0.0.1:5501 --fgout=127.0.0.1:5503
Window access not found, logging to /tmp/Simulator.log
+ sleep 2
+ options=
+ '[' 0 == 0 ']'
+ options='--master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501'
+ '[' rub == vagrant ']'
+ options='--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'
+ extra_cmd1=
+ '[' 1 == 1 ']'
+ extra_cmd='param forceload /home/rub/ardupilot/Tools/autotest/copter_params.parm; ; param fetch'
+ '[' 0 == 1 ']'
+ '[' 0 == 1 ']'
+ '[' 0 == 1 ']'
+ 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 '--cmd=param forceload /home/rub/ardupilot/Tools/autotest/copter_params.parm; ; param fetch'
Connect tcp:127.0.0.1:5760 source_system=255
(error(111, 'Connection refused'), 'sleeping')
(error(111, 'Connection refused'), 'sleeping')
Failed to connect to tcp:127.0.0.1:5760 : [Errno 111] Connection refused
+ kill_tasks
+ '[' 0 -eq 0 ']'
+ killall -q JSBSim lt-JSBSim ArduPlane.elf ArduCopter.elf APMrover2.elf AntennaTracker.elf
+ pkill -f runsim.py
+ pkill -f sim_tracker.py
+ pkill -f sim_rover.py
+ pkill -f sim_multicopter.py

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • I have SITL running in Mint now, though I had a problem like yours at first. Mint's package manager sometimes lacks packages that are available in Ubuntu. I had to use this procedure (http://stackoverflow.com/questions/12991401/how-to-install-gcc-4-7-...) to install the correct compiler. I also ran "apt-get upgrade" to bring the rest of the packages up to date. I recommend that you verify that all of the packages required for SITL were actually installed and are upgraded to the current versions. Then reboot just in case.

  • My guess, either:

    a) you have outdated source in /tmp it is trying to compile. I find clean does not get rid of this.

    b) You have the wrong tools versions installed (I am running on ubuntu and ran the setup script and this all works fine for me).

    c) You have some github problems. Be worth trying a stable branch just to verify.

This reply was deleted.

Activity