I am following the getting started instructions in DroneKit-Python to set up DroneKit in a VM. To make things easier for myself I started by Setting up SITL using Vagrant. However I can't work out how to have SITL running and talk to it from the example scripts.
What I did:
- Ran SITL vagrant script and got SITL working (tested connection to Mission Planner running on Windows).
Tested it as discussed in "Setting up on Linux" by doing:
param load ../Tools/autotest/copter_params.parm
param set ARMING_CHECK 0
NOTE - not "STABILIZE>" prompt visible in my MAVProxy prompt. These ran (what appeared to be) successfully
- Then I did Ctrl+D to exit the SITL simulation, and
vagrant ssh
to open my prompt to the virtual machine. I installed the dependencies as described here (after fixing up the pip specification):
sudo apt-get install python-pip python-numpy python-opencv python-serial python-pyparsing python-wxgtk2.8
Then MAVProxy
sudo pip install MAVProxy
Then droneapi (note, had to be installed using "sudo")
sudo pip install droneapi
Then from command prompt (vagrant@vagrant-ubuntu-trusty-32:/vagrant/ArduCopter$) I got the git clone and navigated to the demo:
git clone http://github.com/diydrones/droneapi-python.git
cd droneapi-python/example/small_demo
I started MavProxy using "mavproxy.py" (correct type for Linux VM communicating by USB). Got the following:
Auto-detected serial ports are:
/dev/ttyS31
/dev/ttyS30
...
/dev/ttyS1
/dev/ttyS0
Logging to mav.tlog
libdc1394 error: Failed to initialize libdc1394
Finally, despite error above I tried to load and use the module.
MAV> module load droneapi.module.api
MAV> DroneAPI loaded
Loaded module droneapi.module.api
api start small_demo.py
MAV> Exception in APIThread-0:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/droneapi/module/api.py", line 322, in run
self.fn()
File "/usr/local/lib/python2.7/dist-packages/droneapi/module/api.py", line 593, in <lambda>
APIThread(self, lambda: execfile(args[1], g), args[1])
...
NOTE "MAV>" prompt not "MANUAL>" as listed in the docs.
The question is "why has this failed, and what do I need to get it to work?" I am guessing the problem is that SITL is not actually running.
Thanks!