Quantcast
Channel: ArduPilot Discourse - Latest topics
Viewing all articles
Browse latest Browse all 45672

Dronekit: OSError: [Errno 8] Exec format error

$
0
0

@Artur_K wrote:

Hi! I have a problem with dronekit. I use python 2.7.9 and Raspberry Pi2mB (raspbian). When I try to run an example from this site http://python.dronekit.io/guide/quick_start.html
I get an error

APM:Copter V3.3.3 (acf2e10c)
PX4: 34e1d543 NuttX: 7c5ef883
Frame: HEXA
PX4v2 002C0023 31334704 39343031
PreArm: Throttle below Failsafe
Starting copter simulator (SITL)
SITL already Downloaded and Extracted.
Ready to boot.
Traceback (most recent call last):
File "simple_goto.py", line 33, in
sitl = dronekit_sitl.start_default()
File "/usr/local/lib/python2.7/dist-packages/dronekit_sitl/__init__.py", line 341, in start_default
sitl.launch(sitl_args, await_ready=True, restart=True)
File "/usr/local/lib/python2.7/dist-packages/dronekit_sitl/__init__.py", line 271, in launch
p = Popen([self.path] + args, cwd=wd, shell=sys.platform == 'win32', stdout=PIPE, stderr=PIPE)
File "/usr/lib/python2.7/subprocess.py", line 710, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1335, in executechild
raise child_exception
OSError: [Errno 8] Exec format error
I did connection by RC.
How I can resolve it? Thanks for any help!
P.S. Bellow is my code (simple_goto)

!/usr/bin/env python

-- coding: utf-8 --

"""
© Copyright 2015-2016, 3D Robotics.
simple_goto.py: GUIDED mode "simple goto" example (Copter Only)

Demonstrates how to arm and takeoff in Copter and how to navigate to points using Vehicle.simple_goto.

Full documentation is provided at http://python.dronekit.io/examples/simple_goto.html
"""

from dronekit import connect, VehicleMode, LocationGlobalRelative
import time

Set up option parsing to get connection string

import argparse
parser = argparse.ArgumentParser(description='Commands vehicle using vehicle.simple_goto.')
parser.add_argument('--connect',
help="Vehicle connection target string. If not specified, SITL automatically started and used.")
args = parser.parse_args()

connection_string = args.connect
sitl = None

vehicle = connect('127.0.0.1:14550' , wait_ready=True)

vehicle = connect('/dev/ttyUSB0' , baud=57600, wait_ready=True)

Start SITL if no connection string specified

if not connection_string:
import dronekit_sitl
sitl = dronekit_sitl.start_default()
connection_string = sitl.connection_string()

Connect to the Vehicle

print 'Connecting to vehicle on: %s' % connection_string
vehicle = connect(connection_string, wait_ready=True)

def arm_and_takeoff(aTargetAltitude):
"""

Posts: 5

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 45672

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>