SITL autopilot doesn't pilot


I’m trying to make the SITL work and I have some issue. I followed those tutorials (and the linux one), it worked fine. I run the following command :

in the ardupilot/Tools/autotest folder (since the is there now), I then have the alert message : “APM: PreArm: RC not calibrated” which I “solve” by running;

in the terminal. Then I load some waypoint by calling the toff-loop file ( wp load ArduPlane-Missions/CMAC-toff-loop.txt ), it does work. Finally I would like my simulated ArduCopter to go through all the check point so i turn it in auto mode ( which works cause i have the AUTO> prompt ) but then nothing happend. the Alt value stay at 0 so is the rest of value displayed by the GUI.
During the whole time I have the same message displayed ( in my terminal ) over and over :

[code]Traceback (most recent call last):
File “build/bdist.linux-x86_64/egg/MAVProxy/modules/mavproxy_map/”, line 967, in on_mouse

File “build/bdist.linux-x86_64/egg/MAVProxy/modules/mavproxy_map/”, line 825, in update_position

File “build/bdist.linux-x86_64/egg/MAVProxy/modules/mavproxy_map/”, line 44, in GetElevation
File “build/bdist.linux-x86_64/egg/MAVProxy/modules/mavproxy_map/”, line 179, in getTile
IOError: [Errno 2] No such file or directory: ‘/home/samuel/.tilecache/SRTM/filelist_python’[/code]

So i searched a bit and found out that it’s a file generated (downloaded ?) by the but it seems it does create (or download) the file properly (at least for me). (By the way the map doesn’t load aswell but the two thing are related).

Thanks in advance,

PS : if anyone has a better fix for the ARMIN_CHECK thing i’m taking it, i tryied to change it directly in the AP_Arming.cpp file by setting require at 0 :

I also set armed to true in the constructor ( armed(true) ) but i doesn’t seems to work.

hey I don’t know if it can help help anyone but since i’ve solved the issue a while ago i’m gonna post it.

so first of all to arm properly the throttle the command is pretty straight forward : “arm throttle”, then for some reason i can’t manage to make the arducopter take-off using waypoint. So I had to use a function I defined in You could also use this command to simulate a rc signal : “rc 3 1700”

The function I used is something I took from the file.

[code]def cmd_takeoff(args):

alt_min = 20
if mpstate.vehicle_type == ‘copter’:
if not mpstate.master().motors_armed():

  rc = mpstate.module("rc")
  if not rc == None : 
     m = mpstate.master().recv_match(type='VFR_HUD', blocking=True)
     if m.alt < alt_min :
        wait_alt(alt_min, (alt_min+5))
     rc.cmd_rc([3,1370]) #1370 seems to hover the copter
     return True

return False

def wait_alt(alt_min, alt_max, timeout=30):
climb_rate = 0
previous_alt = 0
tstart = time.time()

print(“Waiting for altitude between %u and %u” % (alt_min, alt_max))
while time.time() < tstart + timeout:

  m = mpstate.master().recv_match(type='VFR_HUD', blocking=True)
  climb_rate =  m.alt - previous_alt
  previous_alt = m.alt
  print("Wait Altitude: Cur:%u, min_alt:%u, climb_rate: %u" % (m.alt, alt_min , climb_rate))
  if abs(climb_rate) > 0:
     tstart = time.time();
  if m.alt >= alt_min and m.alt <= alt_max:
     print("Altitude OK")
     return True

print(“Failed to attain altitude range”)
return False[/code]

then i added the cmd takeoff in the command list :

command_map = { 'script' : (cmd_script, 'run a script of MAVProxy commands'), 'setup' : (cmd_setup, 'go into setup mode'), 'reset' : (cmd_reset, 'reopen the connection to the MAVLink master'), 'status' : (cmd_status, 'show status'), 'set' : (cmd_set, 'mavproxy settings'), 'bat' : (cmd_bat, 'show battery levels'), 'alt' : (cmd_alt, 'show relative altitude'), 'link' : (cmd_link, 'show link status'), 'reboot' : (cmd_reboot, 'reboot the autopilot'), 'up' : (cmd_up, 'adjust TRIM_PITCH_CD up by 5 degrees'), 'watch' : (cmd_watch, 'watch a MAVLink pattern'), 'module' : (cmd_module, 'module commands'), 'alias' : (cmd_alias, 'command aliases'), 'time' : (cmd_time, 'Show autopilot time'), 'takeoff' : (cmd_takeoff, 'Drone Takes off'), #added }

well that’s it :slight_smile: I hope it could help someone.


Hi Sam, i’m new in this forum. I have the same problem, so i add the code you posted here. But i don’t understand where i have to call the takeoff function that i created. I can’t call it from the MAV terminal (the page where i put the arm and the wp command). Which command should i write there to call the takeoff command?

Thank you,


Hi Sam, i didn’t rebuild and reinstall MAVProxy. From terminal i went to the MAVProxy folder and i ran this commands:

Now it is working,

Yes I forgot to say that after that you have to rebuild MAVProxy. I’m glad you solved your issue :slight_smile:



I am using the sitl simulator, now it starts correctly and thanks to your function it takes off well, but it still have some trouble during the flight. It often hit the ground, and i don’t understand if it is a simulator’s problem or one my problem (i pass the wrong parameters or whatever else). I would like to solve this problem before i use the true quadcopter. Does your simulator have the same problem? Have you any ideas of what could it be?



Well to be honnest i don’t have those problems… but I know that the message displayed by the simulation : “Hit ground at X m/s” is written by the which is part of the component simulation. I don’t know if it can helps you :s



I checked my MAVProxy folder and it didn’t have file but I had file in pvmavlink folder. Is it the same folder for running the commands ?

python build

python install

The error I am getting is:

MAV> STABILIZE> Received 511 parameters
Process Process-1:
Traceback (most recent call last):
File “/usr/lib/python2.7/multiprocessing/”, line 258, in _bootstrap
File “/usr/lib/python2.7/multiprocessing/”, line 114, in run
self._target(*self._args, **self._kwargs)
File “/usr/local/lib/python2.7/dist-packages/MAVProxy/modules/mavproxy_map/”, line 128, in createFileListHTTP
File “/usr/lib/python2.7/”, line 973, in request
self._send_request(method, url, body, headers)
File “/usr/lib/python2.7/”, line 1007, in _send_request
File “/usr/lib/python2.7/”, line 969, in endheaders
File “/usr/lib/python2.7/”, line 829, in _send_output
File “/usr/lib/python2.7/”, line 791, in send
File “/usr/lib/python2.7/”, line 772, in connect
self.timeout, self.source_address)
File “/usr/lib/python2.7/”, line 571, in create_connection
raise err
error: [Errno 110] Connection timed out
[Errno 2] No such file or directory: ‘/home/shiv/.tilecache/SRTM/filelist_python’
[Errno 2] No such file or directory: ‘/home/shiv/.tilecache/SRTM/filelist_python’

STABILIZE> [Errno 2] No such file or directory: ‘/home/shiv/.tilecache/SRTM/filelist_python’
[Errno 2] No such file or directory: ‘/home/shiv/.tilecache/SRTM/filelist_python’

Exception in thread Thread-1:
Traceback (most recent call last):
File “/usr/lib/python2.7/”, line 810, in __bootstrap_inner
File “/usr/lib/python2.7/”, line 763, in run
self.__target(*self.__args, **self.__kwargs)
File “/usr/local/lib/python2.7/dist-packages/MAVProxy/modules/lib/”, line 62, in watch_thread
msg = self.parent_pipe_recv.recv()


Please help me as I am new to ardupilot.