When are the services executed? How can we manage to create files and save them in the internal memory of the drone?
We have tried to create a simple service with the airsdk-cli tool and adding a few simple lines for the debugging in the main.py
file, to write to a file and save it to the drone’s internal memory, to write to a file and save it in the directory indicated by the environment variables MISSION_DATA
and MISSION_DATA_TMP
(both have been tested), as indicated by the documentation in the Storage and persistence section. And these lines have been introduced in the main
and run
functions. After the compilation and installation in the drone with the CLI we tried to perform a takeoff of a few seconds, enough to give time to the service to run, but we have not had any result, there is no test.log
file in the internal memory, test.log file does not exist in the Drone. The code used for this is shown below:
import os
##dataRoot = os.getenv(‘MISSION_DATA’)
dataRoot = os.getenv(‘MISSION_DATA_TMP’)
if dataRoot is not None:
f = open(dataRoot+”/test.log”, “w+”)
f.write(“Testing”)
f.close()
With this we want to make sure that any facial recognition code we add is going to be executed, since it is one of the few ways we have to know it.
Thank you in advance!