python - How to use dronekit with SITL vagrant VM from dev Wiki -


i following getting started instructions in dronekit-python set dronekit in vm. make things easier myself started setting sitl using vagrant. can't work out how have sitl running , talk example scripts.

what did:

  1. ran sitl vagrant script , got sitl working (tested connection mission planner running on windows).
  2. tested discussed in "setting on linux" doing:

    param load ../tools/autotest/copter_params.parm

    param set arming_check 0

note - not "stabilize>" prompt visible in mavproxy prompt. these ran (what appeared be) successfully

  1. then did ctrl+d exit sitl simulation, , vagrant ssh open prompt virtual machine.
  2. i installed dependencies described here (after fixing 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 installed using "sudo")

sudo pip install droneapi 

then command prompt (vagrant@vagrant-ubuntu-trusty-32:/vagrant/arducopter$) got git clone , navigated demo:

git clone http://github.com/diydrones/droneapi-python.git cd droneapi-python/example/small_demo 

i started mavproxy using "mavproxy.py" (correct type linux vm communicating usb). got following:

auto-detected serial ports are: /dev/ttys31 /dev/ttys30 ... /dev/ttys1 /dev/ttys0 logging mav.tlog libdc1394 error: failed initialize libdc1394 

finally, despite error above tried load , use 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>" listed in docs.

the question "why has failed, , need work?" guessing problem sitl not running.

thanks!

starting fresh checkout of ardupilot code, in host os.

droneapi-python installed, lets sample scripts:

ardupilot$ git clone http://github.com/diydrones/droneapi-python.git 

bring vagrant box:

ardupilot$ vagrant 

start sitl described in "setting sitl using vagrant":

ardupilot$ vagrant ssh -c "sim_vehicle.sh -j 2" 

there lot of output, @ end see this:

+ mavproxy.py --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --out 10.0.2.2:14550 --out 127.0.0.1:14550 --out 127.0.0.1:14551 --cmd= connect tcp:127.0.0.1:5760 source_system=255 logging mav.tlog libdc1394 error: failed initialize libdc1394 mav>   init apm:copter v3.3-dev (e1be8148) free ram: 4096 fw ver: 120 ----------------------------------------  firmware change: erasing eeprom... done. 0 0 0 online system 1 stabilize> mode stabilize apm: apm:copter v3.3-dev (e1be8148) apm: frame: quad apm: calibrating barometer apm: initialising apm... apm: barometer calibration complete apm: ground start init gyro** ins ---------------------------------------- g_off: 0.00, 0.00, 0.00 a_off: 0.00, 0.00, 0.00 a_scale: 1.00, 1.00, 1.00  ready fly  ublox received 473 parameters fence breach gps lock @ 0 meters apm: prearm: rc not calibrated 

load droneapi module. see "loading dronekit" information on how automatically when mavproxy starts.

stabilize> module load droneapi.module.api stabilize> droneapi loaded 

run dronekit small_demo.py script:

stabilize> api start ../droneapi-python/example/small_demo/small_demo.py  

output:

stabilize> mode: vehiclemode:stabilize location: location:lat=-35.3632609,lon=149.1652299,alt=-0.280000001192,is_relative=false attitude: attitude:pitch=-0.0046319803223,yaw=-0.571676075459,roll=-0.00480426847935 velocity: [0.11, -0.06, -0.06] gps: gpsinfo:fix=3,num_sat=10 armed: false groundspeed: 0.0 airspeed: 0.0 requesting 0 waypoints t=fri may  1 02:18:50 2015 now=fri may  1 02:18:50 2015 home wp: mission_item {target_system : 255, target_component : 0, seq : 0, frame : 0, command : 16, current : 0, autocontinue : 1, param1 : 0.0, param2 : 0.0, param3 : 0.0, param4 : 0.0, x : -35.3632621765, y : 149.165237427, z : 584.33001709} current dest: 0 disarming... arming... overriding rc channel current overrides are: {'1': 900, '4': 1000} rc readback: {'1': 1500, '3': 1000, '2': 1500, '5': 1800, '4': 1500, '7': 1000, '6': 1000, '8': 1800} cancelling override apithread-0 exiting... got mavlink msg: command_ack {command : 400, result : 0} apm: prearm: rc not calibrated got mavlink msg: command_ack {command : 400, result : 4} got mavlink msg: command_ack {command : 11, result : 0} auto> mode auto 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -