-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4e7b3e
commit e6db718
Showing
18 changed files
with
150 additions
and
639 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
# enable app support | ||
APP=1 | ||
APP_STACKSIZE=300 | ||
|
||
VPATH += src/ | ||
PROJ_OBJ += app_main.o | ||
|
||
CRAZYFLIE_BASE=.. | ||
include $(CRAZYFLIE_BASE)/Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# API App for Crazyflie 2.X | ||
|
||
This folder contains an app layer application for the Crazyflie that is intended to document which functions that are part of the | ||
app API. This is not an example app with useful code, see the example directroy for examples of how to use functions. | ||
|
||
The app is built by CI servers to make sure we do not modify functions that is part of the official app API by misstake. | ||
Please add any new functions that should be part of the API to it. | ||
|
||
See App layer API guide [here](https://www.bitcraze.io/documentation/repository/crazyflie-firmware/master/userguides/app_layer/) | ||
|
||
## How to use the app | ||
|
||
Do NOT flash and use it! It does not do anything useful and may have unpredictable behaviour, it is only intended to be compiled but not to run. | ||
|
||
## Build | ||
|
||
Make sure that you are in the app_api folder (not the main folder of the crazyflie firmware). Then type the following to build and flash it while the crazyflie is put into bootloader mode: | ||
|
||
``` | ||
make clean | ||
make | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
/** | ||
* ,---------, ____ _ __ | ||
* | ,-^-, | / __ )(_) /_______________ _____ ___ | ||
* | ( O ) | / __ / / __/ ___/ ___/ __ `/_ / / _ \ | ||
* | / ,--´ | / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ | ||
* +------` /_____/_/\__/\___/_/ \__,_/ /___/\___/ | ||
* | ||
* Crazyflie control firmware | ||
* | ||
* Copyright (C) 2020 Bitcraze AB | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, in version 3. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
* api_app.c - App layer application that calls app API functions to make | ||
* sure they are compiled in CI. | ||
*/ | ||
|
||
|
||
#include <string.h> | ||
#include <stdint.h> | ||
#include <stdbool.h> | ||
|
||
#include "app.h" | ||
|
||
#include "FreeRTOS.h" | ||
#include "task.h" | ||
|
||
#include "debug.h" | ||
|
||
#include "ledseq.h" | ||
#include "crtp_commander_high_level.h" | ||
#include "locodeck.h" | ||
#include "mem.h" | ||
#include "log.h" | ||
#include "param.h" | ||
|
||
|
||
#define DEBUG_MODULE "APPAPI" | ||
|
||
void appMain() { | ||
// Do not run this app | ||
ASSERT_FAILED(); | ||
|
||
// LED sequencer | ||
{ | ||
ledseqContext_t ledSeqContext; | ||
ledseqRegisterSequence(&ledSeqContext); | ||
ledseqRun(&ledSeqContext); | ||
ledseqRunBlocking(&ledSeqContext); | ||
ledseqStop(&ledSeqContext); | ||
ledseqStopBlocking(&ledSeqContext); | ||
} | ||
|
||
// High level commander | ||
{ | ||
uint8_t dummyTrajectory[10]; | ||
crtpCommanderHighLevelTakeoff(1.0f, 1.0f); | ||
crtpCommanderHighLevelTakeoffYaw(1.0f, 1.0f, 1.0f); | ||
crtpCommanderHighLevelLand(0.0f, 1.0f); | ||
crtpCommanderHighLevelLandYaw(0.0f, 1.0f, 1.0f); | ||
crtpCommanderHighLevelStop(); | ||
crtpCommanderHighLevelGoTo(1.0f, 0.0f, 0.0f, 0.0f, 1.0f, false); | ||
crtpCommanderHighLevelStartTrajectory(3, 1.0f, true, false); | ||
crtpCommanderHighLevelDefineTrajectory(3, CRTP_CHL_TRAJECTORY_TYPE_POLY4D_COMPRESSED, 0, 17); | ||
crtpCommanderHighLevelTrajectoryMemSize(); | ||
crtpCommanderHighLevelWriteTrajectory(20, 10, dummyTrajectory); | ||
crtpCommanderHighLevelReadTrajectory(20, 10, dummyTrajectory); | ||
crtpCommanderHighLevelIsTrajectoryFinished(); | ||
} | ||
|
||
// LPS | ||
{ | ||
point_t position; | ||
uint8_t unorderedAnchorList[5]; | ||
|
||
locoDeckGetAnchorPosition(0, &position); | ||
locoDeckGetAnchorIdList(unorderedAnchorList, 5); | ||
locoDeckGetActiveAnchorIdList(unorderedAnchorList, 5); | ||
} | ||
|
||
// Memory sub system | ||
{ | ||
static const MemoryHandlerDef_t memDef = {.type = MEM_TYPE_APP,}; | ||
memoryRegisterHandler(&memDef); | ||
} | ||
|
||
// Log | ||
{ | ||
logVarId_t id = logGetVarId("some", "log"); | ||
logGetFloat(id); | ||
logGetInt(id); | ||
logGetUint(id); | ||
} | ||
|
||
// Param | ||
{ | ||
paramVarId_t id = paramGetVarId("some", "param"); | ||
paramGetFloat(id); | ||
paramGetInt(id); | ||
paramGetUint(id); | ||
paramSetInt(id, 0); | ||
paramSetFloat(id, 0.0f); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.