Is there any way to make a python script run automatically as soon as a telemetry link is established? I am trying to control data collection from my script, and would like to toggle when that begins and ends as hands-off as possible.

Here's the skeleton of what I will want to run:

print 'Beginning data collection...'

file = open("somepath\output.txt", "w+")

num = 0

while num in range(50):
   file.write("lat: %0.8f\n" %cs.lat)
   file.write("lng: %0.8f\n" %cs.lng)
   file.write("alt: %0.8f\n" %cs.alt)
   file.write("sonar: %0.2f\n" %cs.sonarrange)
   num += 1
   print 'new point, num: ', num
   Script.Sleep(62)
else:
   print 'done'

file.close()

(Pardon me if this looks janky, I'm new to python)

Is there any way to start this script without selecting it in the "Scripts" tab?

Also, I don't know why it would, but I haven't tested this in the air yet--this script won't block normal functionality, right?

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

Join diydrones

Email me when people reply –

Replies

  • you mean to bridge the script while booting ? if so,you need to edit .bashrc file....if it is in linux, type sudo nano .bashrc and write the name of your file at the bottom of the page . type reboot then,,,all done ....

This reply was deleted.

Activity