Hi,

While using Mission Planner 1.2.97 to run a python script on an Ardupilot 2.6, I am having trouble running the python script. Running any script causes Mission Planner to become unresponsive. I have the Mission planner console open, which still keeps running when Mission Planner is not responding. It does not seem to matter what script is run, the outcome is the same. Could this be a Mavlink issue?

Thanks for any help you can give.

EDIT: I realised I haven't given you guys much to go on, below is the exact simple script I'm trying to run, have no previous programming experience so if I am doing something fundamentally wrong it would be great to know. Is there anywhere in particular i have to save the notepad file to (saved as Buggy.py at the moment). I just press select script, find Buggy.py and then if i press 'Edit Script' I am able to edit it in notepad, does not work if set to open with ironpython/python, but if i try to 'Run Script', it does not respond, program effectively crashes. 

print 'Start Script'


for chan in range(3,5): #Sets the Channel range of 3-5
Script.SendRC(chan, 1500, False) #Sets Channel range pwm to 1500
Script.SendRC(3, Script.GetParam('RC3_MIN'), True) #Sets Throttle pwm to min value


####Travel for 5s in straight line####
Script.Sleep(4000) #Script waits 4000ms before starting
Script.SendRC(3, 1100, True) #Sets Throttle pwm to 1100
Script.Sleep(5000) #Script waits 5000ms

####Turn clockwise corner####
Script.ChangeParam(yaw, 0) #Sets Yaw value to 0
Script.SendRC(3, 1050, True) #Sets Throttle pwm to 1050
Script.SendRC(4, 1750, True) #Sets Wheel Servo pwm to 1750
While cs.yaw < 180: #While loop for yaw being less than 180
Script.Sleep(5) #Script waits 5ms before checking again

####Travel for 5s in straight line####
Script.Sleep(4000) #Script waits 4000ms before starting
Script.SendRC(3, 1100, True) #Sets Throttle pwm to 1100
Script.Sleep(5000) #Script waits 5000ms

####Turn clockwise corner####
Script.ChangeParam(yaw, 0) #Sets Yaw value to 0
Script.SendRC(3, 1050, True) #Sets Throttle pwm to 1050
Script.SendRC(4, 1750, True) #Sets Wheel Servo pwm to 1750
While cs.yaw < 180: #While loop for yaw being less than 180
Script.Sleep(5) #Script waits 5ms before checking again

####Stop Buggy####
Script.SendRC(4, 1500, True) #Sets Wheel servo pwm to 1500
Script.SendRC(3, Script.GetParam('RC3_MIN'), True) #Sets Throttle pwm to min value


print 'End Script'

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • have the same problem

    • Developer

      please try the latest version

      • Thanks for the update, no longer have to use the fix that we discovered, before the update spamming the 'Edit Script' button till the client froze, then pressing 'Run Script' before it become operational again allowed the script to run and program to not crash. Don't ask how we figured it out, long story. Glad we can just run it now, thanks again!

This reply was deleted.

Activity