Comments (8)
Import issue was caused by PATH issues and file permission issues. This has be resolved. Still curious about command line arguments though.
from dronekit-python.
Ok so I just figured out that "api start script.py" takes its arguments from "mavproxy.py [args]".
from dronekit-python.
@djnugent Is this still an issue? Should this be documented better?
from dronekit-python.
@tcr3dr @djnugent This is still an issue because I haven't documented command line arguments to api start (at all) and I don't understand enough from this post to do so :-(
- When you say
this takes its arguments from "mavproxy.py [args]"
do you mean that when you run a script withapi start filename.py
the arguments recieved will be whatever you already passed when you started mavproxy? In most cases that will just be the id of the master/connection?- If so, can you pass arbitrary commands to mavproxy and still pick them up in your script (ie launch mavproxy with parameters that mean nothing to mavproxy but which are relevant to the script?
- The full question here is "how to interact with the script" - both with command line arguments and by making the script interactive - ie able to wait on and take some form of input. I might (for example) want to be able to send a message to my script from a GCS telling it to change behaviour in some way. Is this reasonable, and if so, can we have a separate issue for it?
from dronekit-python.
So I believe the issue is more specifically, "What is sys.argv populated with?" and the answer for this is "The sys.argv visible to mavproxy.py".
To pass "arguments" to your script in the current configuration, the best choice would be environment variables. We could extend api start
to fix this.
However, I think punting on this issue is preferable, as in a post-MAVProxy scenario we'd be able to control sys.argv
and stdin
, leaving it implementation-specific. As such, I'm marking this wontfix.
from dronekit-python.
@tcr3dr Makes sense to me. #188 will make a lot of things more "sensible".
from dronekit-python.
@tcr3dr Reopening to continue discussion.
Just found that in theory at least you can pass arguments to the script! See http://python.dronekit.io/examples/flight_replay.html
mission_id = int(local_arguments[0])
Any ideas of best place to document this in our current structure? We don't (yet) have best practices or programming idioms doc. Maybe a stand alone doc "Communicating with the script". WOuld be a bit "thin".
from dronekit-python.
We can now close this, since a public build of DKPY2 is in the wild.
Recommendation: use sys.argv
!
from dronekit-python.
Related Issues (20)
- Can I use sbus in dronekit? HOT 3
- Interested in becoming a maintainer HOT 7
- DroneKit using any flight controller HOT 2
- problem with the simolation HOT 1
- problem with the heartbeat HOT 2
- Sending Velocity and Yaw command in same message in guided mode HOT 10
- Copter not responding to `set_position_target_local_ned` mavlink commands
- I want to commit to this project HOT 3
- How can I get connection strings when connect multi vehicles by Radio? HOT 2
- Warning: "got MISSION_REQUEST; use MISSION_REQUEST_INT!" when requesting missions with DroneKit
- @morzack I have facing this issue HOT 2
- Greetings & guidance with running drone indoors HOT 1
- Failing to arm motors HOT 2
- cd
- Unable to Change VehicleMode to "GUIDED" in Python DroneKit Script
- Yaw don`t updated properly HOT 3
- Unable to Update a Specific Mission Item in DroneKit: Seeking Guidance on a Workaround
- DroneKit condition_yaw() and NED_Velocity() not working
- Drone kit SITL issue
- Dronekit Python QuadCopter Kamikaze Drone Pitch Settings HOT 3
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 dronekit-python.