You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following test code returns and error that AttributeError: MPFakeState instance has no attribute 'vehicle' when I try to access Vehicle.commands.clear. Actually downloading of commands and reading home location works fine.
Test code:
from dronekit import connect
import time
import math
from dronekit.lib import VehicleMode, Location, Command
from pymavlink import mavutil
#Set up option parsing to get connection string
import argparse
parser = argparse.ArgumentParser(description='Print out vehicle state information. Connects to SITL on local PC by default.')
parser.add_argument('--connect', default='127.0.0.1:14550',
help="vehicle connection target. Default '127.0.0.1:14550'")
args = parser.parse_args()
# Connect to the Vehicle
print 'Connecting to vehicle on: %s' % args.connect
vehicle = connect(args.connect, await_params=True)
cmds = vehicle.commands
cmds.download()
cmds.wait_valid()
print "About to test clear"
vehicle.commands.clear()
vehicle.flush()
print "Clear succeeded"
Output of test code
About to test clear
Traceback (most recent call last):
File "E:\deleteme\dronekit-python\examples\mission_basic\test_mission_clear.py", line 29, in <module>
vehicle.commands.clear()
File "build\bdist.win-amd64\egg\dronekit\module\api.py", line 95, in clear
AttributeError: MPFakeState instance has no attribute 'vehicle'
This causes the mission_basic.py and flight_replay.py examples to fail in dkpy2.0
Activity
Updates mission examples/docs/guide to DKPY2. Further testing/update …
hamishwillee commentedon Oct 21, 2015
@tcr3dr When you have time, I've marked this as urgent because it breaks two examples.
Fix up flight_replay.py doc/example to DKPY2. Note, still has bug #355
Updates mission examples/docs/guide to DKPY2. Further testing/update …
Fix up flight_replay.py doc/example to DKPY2. Note, still has bug #355
Merge pull request #360 from dronekit/hgw_flight_replay_example_docs
tcr3dr commentedon Oct 27, 2015
See #374 for the fix.
hamishwillee commentedon Oct 27, 2015
@tcr3dr Thanks - agreed fixed. Unfortunately now we can't upload waypoints - see #376