Comments (15)
@julianoes @xvzf 👌 thanks!
from mavsdk-python.
Just to make sure:
Did you run pip install -r requirements.txt -r requirements-dev.txt
?
Also, which python version are you running?
And please try it inside an virtual environment:
$ python -m venv venv
$ . ./venv/bin/activate
from mavsdk-python.
Hi!
You have to generate the plugins and then install the SDK, e.g. by executing pip install -e .
inside the project root
from mavsdk-python.
@xvzf I just did that, but problem still, here is the project tree and full log
➜ DronecodeSDK-Python git:(master) ✗ tree
.
├── README.md
├── docs
│ └── TODO.md
├── dronecode_sdk
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-36.pyc
│ │ └── async_plugin_manager.cpython-36.pyc
│ ├── _base.py
│ ├── async_plugin_manager.py
│ ├── generated
│ │ ├── __init__.py
│ │ ├── action_pb2.py
│ │ ├── action_pb2_grpc.py
│ │ ├── calibration_pb2.py
│ │ ├── calibration_pb2_grpc.py
│ │ ├── camera_pb2.py
│ │ ├── camera_pb2_grpc.py
│ │ ├── core_pb2.py
│ │ ├── core_pb2_grpc.py
│ │ ├── discovery_pb2.py
│ │ ├── discovery_pb2_grpc.py
│ │ ├── gimbal_pb2.py
│ │ ├── gimbal_pb2_grpc.py
│ │ ├── info_pb2.py
│ │ ├── info_pb2_grpc.py
│ │ ├── mission_pb2.py
│ │ ├── mission_pb2_grpc.py
│ │ ├── telemetry_pb2.py
│ │ └── telemetry_pb2_grpc.py
│ └── plugins
│ ├── __init__.py
│ └── __pycache__
│ └── __init__.cpython-36.pyc
├── dronecode_sdk.egg-info
│ ├── PKG-INFO
│ ├── SOURCES.txt
│ ├── dependency_links.txt
│ ├── requires.txt
│ └── top_level.txt
├── examples
│ ├── mission.py
│ ├── takeoff_and_land.py
│ ├── telemetry_flight_mode.py
│ ├── telemetry_is_armed_is_in_air.py
│ └── telemetry_takeoff_and_land.py
├── other
│ ├── docker
│ │ └── testing
│ │ ├── Dockerfile
│ │ ├── build_python.sh
│ │ └── test.sh
│ ├── templates
│ │ ├── call.j2
│ │ ├── enum.j2
│ │ ├── file.j2
│ │ ├── request.j2
│ │ ├── stream.j2
│ │ ├── struct.j2
│ │ └── type_conversions
│ └── tools
│ ├── run_protoc.sh
│ └── run_tests.sh
├── proto
│ ├── README.md
│ ├── pb_plugins
│ │ ├── README.rst
│ │ ├── dcsdkgen
│ │ │ ├── __init__.py
│ │ │ ├── __main__.py
│ │ │ ├── autogen.py
│ │ │ ├── autogen_file.py
│ │ │ ├── enum.py
│ │ │ ├── methods.py
│ │ │ ├── name_parser.py
│ │ │ ├── struct.py
│ │ │ ├── type_info.py
│ │ │ └── utils.py
│ │ ├── dcsdkgen.egg-info
│ │ │ ├── PKG-INFO
│ │ │ ├── SOURCES.txt
│ │ │ ├── dependency_links.txt
│ │ │ ├── entry_points.txt
│ │ │ ├── requires.txt
│ │ │ └── top_level.txt
│ │ ├── requirements.txt
│ │ ├── setup.py
│ │ └── test
│ │ ├── __init__.py
│ │ ├── test_name_parser.py
│ │ └── test_type_info.py
│ └── protos
│ ├── action
│ │ └── action.proto
│ ├── calibration
│ │ └── calibration.proto
│ ├── camera
│ │ └── camera.proto
│ ├── core
│ │ └── core.proto
│ ├── discovery
│ │ └── discovery.proto
│ ├── gimbal
│ │ └── gimbal.proto
│ ├── info
│ │ └── info.proto
│ ├── mission
│ │ └── mission.proto
│ └── telemetry
│ └── telemetry.proto
├── requirements-dev.txt
├── requirements-test.txt
├── requirements.txt
├── setup.cfg
├── setup.py
├── tests
└── tox.ini
29 directories, 88 files
➜ DronecodeSDK-Python git:(master) ✗ ./other/tools/run_protoc.sh
[+] Installing the DronecodeSDK autogenerator
Obtaining file:///Users/huibean/Work/DronecodeSDK-Python/proto/pb_plugins
Requirement already satisfied: protobuf in /Users/huibean/anaconda3/lib/python3.6/site-packages (from dcsdkgen==0.1a0) (3.6.1)
Requirement already satisfied: jinja2 in /Users/huibean/anaconda3/lib/python3.6/site-packages (from dcsdkgen==0.1a0) (2.9.6)
Requirement already satisfied: setuptools in /Users/huibean/anaconda3/lib/python3.6/site-packages (from protobuf->dcsdkgen==0.1a0) (36.5.0.post20170921)
Requirement already satisfied: six>=1.9 in /Users/huibean/anaconda3/lib/python3.6/site-packages (from protobuf->dcsdkgen==0.1a0) (1.11.0)
Requirement already satisfied: MarkupSafe>=0.23 in /Users/huibean/anaconda3/lib/python3.6/site-packages (from jinja2->dcsdkgen==0.1a0) (1.0)
Installing collected packages: dcsdkgen
Found existing installation: dcsdkgen 0.1a0
Uninstalling dcsdkgen-0.1a0:
Successfully uninstalled dcsdkgen-0.1a0
Running setup.py develop for dcsdkgen
Successfully installed dcsdkgen
[+] Done
[+] Generating plugins from
-> [+] Generated protobuf and gRPC bindings for gimbal
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/huibean/Work/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Gimbal.py to /Users/huibean/Work/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/gimbal.py: No such file or directory
-> [+] Generated plugin for gimbal
-> [+] Generated protobuf and gRPC bindings for core
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/huibean/Work/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Core.py to /Users/huibean/Work/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/core.py: No such file or directory
-> [+] Generated plugin for core
-> [+] Generated protobuf and gRPC bindings for calibration
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/huibean/Work/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Calibration.py to /Users/huibean/Work/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/calibration.py: No such file or directory
-> [+] Generated plugin for calibration
-> [+] Generated protobuf and gRPC bindings for camera
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/huibean/Work/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Camera.py to /Users/huibean/Work/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/camera.py: No such file or directory
-> [+] Generated plugin for camera
-> [+] Generated protobuf and gRPC bindings for discovery
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/huibean/Work/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Discovery.py to /Users/huibean/Work/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/discovery.py: No such file or directory
-> [+] Generated plugin for discovery
-> [+] Generated protobuf and gRPC bindings for mission
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/huibean/Work/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Mission.py to /Users/huibean/Work/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/mission.py: No such file or directory
-> [+] Generated plugin for mission
-> [+] Generated protobuf and gRPC bindings for info
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/huibean/Work/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Info.py to /Users/huibean/Work/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/info.py: No such file or directory
-> [+] Generated plugin for info
-> [+] Generated protobuf and gRPC bindings for action
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/huibean/Work/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Action.py to /Users/huibean/Work/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/action.py: No such file or directory
-> [+] Generated plugin for action
-> [+] Generated protobuf and gRPC bindings for telemetry
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/huibean/Work/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Telemetry.py to /Users/huibean/Work/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/telemetry.py: No such file or directory
-> [+] Generated plugin for telemetry
[+] Done
➜ DronecodeSDK-Python git:(master) ✗ pip3 install -e .
Obtaining file:///Users/huibean/Work/DronecodeSDK-Python
Requirement already satisfied: protobuf>=3.5.1 in /Users/huibean/anaconda3/lib/python3.6/site-packages (from dronecode-sdk==0.1.0a0) (3.6.1)
Requirement already satisfied: aiogrpc>=1.5 in /Users/huibean/anaconda3/lib/python3.6/site-packages (from dronecode-sdk==0.1.0a0) (1.5)
Requirement already satisfied: grpcio>=1.11.0 in /Users/huibean/anaconda3/lib/python3.6/site-packages (from dronecode-sdk==0.1.0a0) (1.17.1)
Requirement already satisfied: setuptools in /Users/huibean/anaconda3/lib/python3.6/site-packages (from protobuf>=3.5.1->dronecode-sdk==0.1.0a0) (36.5.0.post20170921)
Requirement already satisfied: six>=1.9 in /Users/huibean/anaconda3/lib/python3.6/site-packages (from protobuf>=3.5.1->dronecode-sdk==0.1.0a0) (1.11.0)
Installing collected packages: dronecode-sdk
Found existing installation: dronecode-sdk 0.1.0a0
Uninstalling dronecode-sdk-0.1.0a0:
Successfully uninstalled dronecode-sdk-0.1.0a0
Running setup.py develop for dronecode-sdk
Successfully installed dronecode-sdk
➜ DronecodeSDK-Python git:(master) ✗ examples/takeoff_and_land.py
Traceback (most recent call last):
File "examples/takeoff_and_land.py", line 5, in <module>
from dronecode_sdk import connect as dronecode_sdk_connect
File "/Users/huibean/Work/DronecodeSDK-Python/dronecode_sdk/__init__.py", line 38, in <module>
from .plugins import *
File "/Users/huibean/Work/DronecodeSDK-Python/dronecode_sdk/plugins/__init__.py", line 3, in <module>
from .gimbal import *
ModuleNotFoundError: No module named 'dronecode_sdk.plugins.gimbal'
from mavsdk-python.
pip install -r requirements.txt -r requirements-dev.txt
was executed while following readme.md, would try venv later
from mavsdk-python.
Please use pip3 install -r requirements.txt -r requirements-dev.txt
, unless your distribution brings Python 3 by default.
@xvzf we should use pip3
and python3
everywhere in all comments, docs etc.!
from mavsdk-python.
@julianoes Agreed. I'll do that right away!
Also I'd strongly advice we opt in for venv because it setups all the path needed to execute the autogenerator! (we just cannot do python3 -m dcsdkgen
, protobuf doesn't like it at all )
from mavsdk-python.
@Huibean Please come back with the result! :-)
from mavsdk-python.
@xvzf @julianoes In fact, I am using pip3 all the time, but it not seems to be the problem here, by the way I more likely to figure out how message is generated
from mavsdk-python.
@xvzf @julianoes I just solved this, ./other/tools/run_protoc.sh could not handle the dcsdkgen path well, so I give a fix path to it and python3 -m grpc_tools.protoc run through
➜ DronecodeSDK-Python git:(master) ✗ which dcsdkgen
dcsdkgen not found
python3 -m grpc_tools.protoc -I$(dirname ${PROTO_FILE}) \
--plugin=protoc-gen-custom=$('/Users/huibean/.local/bin/dcsdkgen') \ #replace which dcsdkgen
--custom_out=${PLUGIN_DIR} \
--custom_opt=py \
${PROTO_FILE}
from mavsdk-python.
maybe --user is not necessary while install dcsdkgen in this case, I made a pr for this fix #39
from mavsdk-python.
➜ DronecodeSDK-Python git:(master) ✗ which dcsdkgen
dcsdkgen not found
This is likely because your PATH
is not set correctly! Are you using a venv?
Can you post the output of echo $PATH
?
from mavsdk-python.
@xvzf when use --user in pip install, it would install to ~/.local/bin, I don't have ~/.local/bin in my $PATH, I haven't remove this manually before, not sure install anaconda would affected this
from mavsdk-python.
@Huibean what about adding ~/.local/bin
to your $PATH
? Isn't that common practice?
from mavsdk-python.
@Huibean You have to add it to your path or use a virtual environment as described above which setups the path for you!
from mavsdk-python.
Related Issues (20)
- drone.info.get_version() INFORMATION_NOT_RECEIVED_YET HOT 8
- FILE_DOES_NOT_EXIST on calling the drone.ftp.list_directory() to fetch internal directories file HOT 13
- The use of drone.offboard.set_position_ned HOT 9
- Unable to upload rally_items through MAVSDK HOT 10
- Error when uploading mission: INVALID_PARAM1 HOT 6
- `aiogrpc` RuntimeError HOT 35
- Running missions in ArduPilot HOT 12
- How to use mavsdk-python to takeoff without GPS HOT 4
- How do I use `telemetry_server` correctly? HOT 4
- Analyzing log files or Distance travelled data from mavsdk python HOT 5
- Geofence crashes with the only information being "Error" HOT 1
- connectivity HOT 5
- Support custom COMMAND_LONG listeners and be able to ACK HOT 6
- can't connect to QGC via UDP connection using mavsdk HOT 3
- Get HEARTBEAT message from MAVSDK HOT 5
- How to use Mavsdk to call Led_control to control LED lights? HOT 2
- MAVSDK server not connecting with JMAVSIM - Windows WSL HOT 2
- How can I set flight mode - manual mode? HOT 1
- Altitude error while doing swarming using mavsdk-python ? HOT 1
- RuntimeError: Task pending got Future attached to a different loop during Offboard control with FastAPI and MAVSDK HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mavsdk-python.