Mission
Seems like this makes a symlink or something. If I were to manually clone HelloDrone, where would I clone it? Inside /airsdk/products?
Once you have completed this step (cloning-the-workspace) you should have the following structure in your workspace:
build/
build.sh
packages/
└── airsdk-samples
├── README.md
└── hello
├── atom.mk
├── autopilot-plugins
├── messages
├── product
└── services
products/
README
The HelloDrone mission is situated in packages/airsdk-samples/hello
directory. For the rest of this post it is assumed that our current working directory is packages/airsdk-samples/hello
.
Should you want to make changes to this mission you can:
- edit
messages/protobuf/parrot/missions/samples/hello/airsdk/messages.proto
to specify your custom messages that can get exchanged between your mission and your ground application (GroundSdkDemo, OpenFlight, etc…)
- edit
autopilot-plugins/fsup
and/or autopilot-plugins/guidance
to specify custom stages. This is for a full type mission.
- edit
services/native/sample.cpp
(for a C++) service. The HelloDrone mission service is written in C++ but you can have services written in python (python service skeleton). If you add C++ files to the mission you should update atom.mk
file to include those files.
Here is a atom.mk
for a python service living in services/python/python_skeleton.py
:
LOCAL_PATH := $(call my-dir)
mission.name := my-mission
mission.package := org.exemple.$(subst _,-,$(mission.name))
mission.uid := org.$(mission.package)
mission.mission-dir := missions/$(mission.uid)
mission.payload-dir := $(mission.mission-dir)/payload
mission.services-dir := $(mission.payload-dir)/services
include $(CLEAR_VARS)
LOCAL_MODULE := airsdk-$(mission.name)-service
LOCAL_DESCRIPTION := mission description
LOCAL_CATEGORY_PATH := airsdk/missions/$(mission.name)
LOCAL_SRC_FILES := $(call all-files-under,python,.py)
LOCAL_CODECHECK_PYTHON := flake8
LOCAL_COPY_FILES := python/python_skeleton.py:$(mission.services-dir)/$(LOCAL_MODULE)
LOCAL_COPY_DIRS := python/uploader:$(mission.services-dir)/uploader
LOCAL_LIBRARIES := \
libarsdk-pbpy \
include $(BUILD_CUSTOM)
You can have more information in the packages/airsdk-samples/hello/README.md
.
Mission inspection
Additionally, if I want to inspect missions as suggested via the REST API, this instruction is given
GET /api/v1/mission/missions
with no additional context.
Once you have your computer connected to the drone’s Wifi you can run on a terminal :
curl -X GET http://192.168.42.1/api/v1/mission/missions
or
You can go to the drone web server address at http://192.168.42.1/#/ or http://anafi-ai.local/#/ using your browser and select the Missions tab, to see what missions are installed in your drone.