Git Product home page Git Product logo

Comments (8)

3efischer avatar 3efischer commented on September 28, 2024 2

That is actually an error raised by the SDK: COMMAND_DENIED when you called arm(). You could try... catch around arm() and do something when this error is raised.

So it seems like it is working: the drone (here Gazebo) is just refusing to arm for some reason (not ready?) :-). What does the telemetry.py example say?

I actually don't know why, but it works fine today :)

@efischer91: Are you sure you installed it with pip3.6, by the way?

Definitely. Everything's working fine now. Thank you!

from mavsdk-python.

JonasVautherin avatar JonasVautherin commented on September 28, 2024

/home/eve/.local/lib/python3.5

You are on Ubuntu 16.04, I presume? You will need Python3.6+, and it seems to me that you have Python3.5.

from mavsdk-python.

3efischer avatar 3efischer commented on September 28, 2024

You are on Ubuntu 16.04, I presume? You will need Python3.6+, and it seems to me that you have Python3.5.

I'm on Ubuntu 16.04 and have both Python 3.5.2 since it's the pre-installed version and 3.6.7

from mavsdk-python.

JonasVautherin avatar JonasVautherin commented on September 28, 2024

./other/tools/run_protoc.sh is running python3, which in your case defaults to 3.5. Can you try to edit all occurences of python3 and pip3 in proto.sh?

python3 -> python3.6
pip3 -> pip3.6

from mavsdk-python.

3efischer avatar 3efischer commented on September 28, 2024

This helped with running the shell script, thanks! Now, the next problem is that none of the examples seem to work:

eve@eve-ThinkPad-X1-Carbon-3rd:~/Downloads/DronecodeSDK-Python$ python3.6 examples/takeoff_and_land.py 
-- Arming
Traceback (most recent call last):
  File "examples/takeoff_and_land.py", line 25, in <module>
    loop.run_until_complete(run())
  File "/usr/lib/python3.6/asyncio/base_events.py", line 473, in run_until_complete
    return future.result()
  File "examples/takeoff_and_land.py", line 13, in run
    await drone.action.arm()
  File "/home/eve/Downloads/DronecodeSDK-Python/dronecode_sdk/plugins/action.py", line 167, in arm
    raise ActionError(result, "arm()")
dronecode_sdk.plugins.action.ActionError: COMMAND_DENIED: 'Command denied'; origin: arm(); params: ()
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "examples/takeoff_and_land.py", line 25, in <module>
    loop.run_until_complete(run())
  File "/usr/lib/python3.6/asyncio/base_events.py", line 473, in run_until_complete
    return future.result()
  File "examples/takeoff_and_land.py", line 13, in run
    await drone.action.arm()
  File "/home/eve/Downloads/DronecodeSDK-Python/dronecode_sdk/plugins/action.py", line 167, in arm
    raise ActionError(result, "arm()")
dronecode_sdk.plugins.action.ActionError: COMMAND_DENIED: 'Command denied'; origin: arm(); params: ()

Gazebo simulation is running, backend is running as well. Examples unfortunately don't, even though I did install python3-apt.

from mavsdk-python.

JonasVautherin avatar JonasVautherin commented on September 28, 2024

dronecode_sdk.plugins.action.ActionError: COMMAND_DENIED: 'Command denied'; origin: arm(); params: ()

That is actually an error raised by the SDK: COMMAND_DENIED when you called arm(). You could try... catch around arm() and do something when this error is raised.

So it seems like it is working: the drone (here Gazebo) is just refusing to arm for some reason (not ready?) :-). What does the telemetry.py example say?

from mavsdk-python.

julianoes avatar julianoes commented on September 28, 2024

@JonasVautherin what's this about?

ModuleNotFoundError: No module named 'apt_pkg'

from mavsdk-python.

JonasVautherin avatar JonasVautherin commented on September 28, 2024

No clue 😅.

Examples unfortunately don't, even though I did install python3-apt.

@efischer91: Are you sure you installed it with pip3.6, by the way?

from mavsdk-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.