Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
8131e3a
chore: add typescript support
Mar 16, 2022
42aced4
chore: add post install script for running tsc
Mar 16, 2022
3449632
chore: convert flow to typescript
Mar 16, 2022
86bdd76
feat: add observer methods for connection, battery and drone location
Mar 18, 2022
2531d74
chore: bump rxjs version
Mar 18, 2022
106e65a
fix: update package-lock.json
Mar 18, 2022
185eebf
refactor: update typing
Mar 22, 2022
18b550b
feat: isHomeLocationSet listener
Mar 22, 2022
f543e79
chore: add typing for waypoint mission
Mar 28, 2022
9e974e1
feat: improve waypoint mission state observables
Mar 29, 2022
93b8697
feat: expose upload and start waypoint mission as separate methods
Mar 30, 2022
8d0f760
feat: add shootPhotoDistanceInterval and shootPhotoTimeInterval props…
Mar 30, 2022
3ef9c2c
fix: stability improvements to waypoint mission listener
Apr 1, 2022
02a1de5
fix: handle incorrect state update events
Apr 5, 2022
14bcd25
fix: null checks for key manager
Apr 6, 2022
5f1042e
feat: add camera observables
nhanders Apr 6, 2022
8452771
feat: add finishedAction to waypoint missions
Apr 6, 2022
88fc090
Merge remote-tracking branch 'origin/chore/typescript_support' into c…
Apr 6, 2022
da2c8a0
feat: handle corner radius edge cases
nhanders Apr 7, 2022
910c9f4
Merge pull request #272 from Aerobotics/feat/corner-radius-edge-cases
nhanders Apr 7, 2022
3dc4e89
feat: add dji diagnostics observer
nhanders Apr 11, 2022
f5f9fe2
Merge pull request #274 from Aerobotics/feat/add-diagnostics/observer
nhanders Apr 11, 2022
d4a31e1
perf: only send diagnostics event if diagnostics update
nhanders Apr 14, 2022
6ed3c42
Merge pull request #275 from Aerobotics/perf/diagnostics
nhanders Apr 14, 2022
840dfb1
fix: fix types for home location
nhanders Apr 19, 2022
e517069
Merge pull request #276 from Aerobotics/fix/home-location
nhanders Apr 19, 2022
0cee0c3
chore: bump sdk -> 4.16.1
nhanders Apr 20, 2022
d71ffb9
Merge pull request #277 from Aerobotics/chore/sdk-4.16.1
nhanders Apr 20, 2022
b21c35d
refactor: rename start new media file method
nhanders May 13, 2022
e5ae71d
Merge pull request #280 from Aerobotics/refactor/rename-method
nhanders May 13, 2022
a697bf9
feat: add more pre-flight check listener methods
nhanders May 18, 2022
a8a2e54
feat: send intitial value when starting listeners
nhanders May 19, 2022
39d50f8
Merge pull request #281 from Aerobotics/feat/add-listeners
nhanders May 20, 2022
899cd8f
feat: get initial GPS value on listener start
nhanders May 20, 2022
f82e2cc
Merge pull request #283 from Aerobotics/feat/add-listeners
nhanders May 20, 2022
8baf0ee
fix: use mission operator as state update source of truth
nhanders May 20, 2022
28a2278
Merge pull request #282 from Aerobotics/fix/mission-state-updates
MikeWoots May 20, 2022
abea68c
feat: add flight mode listener
nhanders Jun 1, 2022
eb5a9db
Merge pull request #284 from Aerobotics/feat/add-flight-mode
nhanders Jun 1, 2022
55a90a7
feat: add camera wrapper methods
nhanders Jun 6, 2022
00819ec
feat: add camera methods
nhanders Jun 7, 2022
f772379
Merge pull request #285 from Aerobotics/feat/add-camera-methods
nhanders Jun 7, 2022
058fc6e
feat: add cancel go home action
nhanders Jun 14, 2022
ec781fe
Merge pull request #286 from Aerobotics/feat/cancel-go-home
nhanders Jun 14, 2022
9cff06f
feat: add waypoint mission V2 support
nhanders Jul 4, 2022
c162c52
refactor: clean up debug code
nhanders Jul 4, 2022
69eadfd
feat: choose primary video feed for connected drone
nhanders Jul 5, 2022
e3ef64a
Merge pull request #288 from Aerobotics/feat/m300-video-feed
nhanders Jul 5, 2022
a325c28
Merge branch 'chore/typescript_support' into feat/waypoint-mission-v2
nhanders Jul 5, 2022
12d47df
Merge pull request #287 from Aerobotics/feat/waypoint-mission-v2
nhanders Jul 5, 2022
d050bc2
feat: add LED control methods
nhanders Nov 22, 2022
2082955
Merge pull request #290 from Aerobotics/feat/led-control
nhanders Nov 22, 2022
b590c12
feat: add hot fetch of aircraft home location altitude
nhanders Jul 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
build
dist
storybook-static
scripts
src/types
22 changes: 22 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
root: true,
extends: ['@react-native-community', 'prettier'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 13,
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'react', 'react-native'],
env: {
jest: true,
'react-native/react-native': true,
browser: true,
es2021: true,
},
rules: {
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/no-unused-vars': ['warn'],
},
globals: { fetch: false, NodeJS: true },
};
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ node_modules/
npm-debug.log
yarn-error.log

# Typescript
dist/

# Xcode
#
build/
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/erbium
lts/gallium
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
7 changes: 7 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
bracketSpacing: true,
bracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
arrowParens: 'avoid',
};
13 changes: 9 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"javascript.validate.enable": false,
"typescript.validate.enable": false,
"flow.enabled": true,
"javascript.validate.enable": true,
"typescript.validate.enable": true,
"editor.formatOnSave": true,
"eslint.format.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.enable": true,
"flow.pathToFlow": "${workspaceFolder}/node_modules/.bin/flow"
"eslint.validate": ["javascript", "typescript"],
"cSpell.words": ["ADSB", "ATTI", "DCINELIKE", "DLOG", "PANO"]
}
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ dependencies {
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+' // From node_modules

implementation ('com.dji:dji-sdk:4.16', {
implementation ('com.dji:dji-sdk:4.16.1', {
// Uncomment the following line if your app does not need Anti Distortion for
// Mavic 2 Pro and Mavic 2 Zoom. It will greatly reducing the size of the APK:
exclude module: 'library-anti-distortion'
// Uncomment the following line if your APP does not need network RTK
exclude module: 'library-networkrtk-helper'
})
compileOnly 'com.dji:dji-sdk-provided:4.16'
compileOnly 'com.dji:dji-sdk-provided:4.16.1'

implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ public void onFailure(@NonNull DJIError djiError) {
}

@ReactMethod
public void getWhiteBalance(final Promise promise) {
public void getWhiteBalancePreset(final Promise promise) {
DJIKey whiteBalanceKey = CameraKey.create(CameraKey.WHITE_BALANCE);
DJISDKManager.getInstance().getKeyManager().getValue(whiteBalanceKey, new GetCallback() {
@Override
public void onSuccess(@NonNull Object value) {
if (value instanceof SettingsDefinitions.WhiteBalancePreset) {
promise.resolve(value.toString());
}
if (value instanceof Integer) {
promise.resolve(value);
if (!(value instanceof WhiteBalance)) {
promise.reject(new Throwable("getWhiteBalance error: Unexpected whitebalance returned"));
}

WhiteBalance whiteBalance = (WhiteBalance) value;
promise.resolve(whiteBalance.getWhiteBalancePreset().toString());
}

@Override
Expand Down Expand Up @@ -633,4 +633,22 @@ public void onFailure(DJIError djiError) {
});
}

@ReactMethod
public void setPhotoFileFormat(String format, final Promise promise) {
DJIKey key = CameraKey.create(CameraKey.PHOTO_FILE_FORMAT);
DJISDKManager.getInstance().getKeyManager().setValue(key,
SettingsDefinitions.PhotoFileFormat.valueOf((format)),
new SetCallback() {
@Override
public void onSuccess() {
promise.resolve("setPhotoFileFormat: photo file format set successfully");
}

@Override
public void onFailure(DJIError djiError) {
promise.reject(new Throwable("setPhotoFileFormat error: " + djiError.getDescription()));
}
});
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,22 @@ public void onFailure(@NonNull DJIError djiError) {
});
}

@ReactMethod
public void cancelGoHome(final Promise promise) {
DJIKey key = FlightControllerKey.create(FlightControllerKey.CANCEL_GO_HOME);
DJISDKManager.getInstance().getKeyManager().performAction(key, new ActionCallback() {
@Override
public void onSuccess() {
promise.resolve("DJI Mission Control: Cancel go home");
}

@Override
public void onFailure(@NonNull DJIError djiError) {
promise.reject(new Throwable("cancelGoHome error: " + djiError.getDescription()));
}
});
}

@ReactMethod
public void unscheduleEverything(Promise promise) {
DJISDKManager.getInstance().getMissionControl().unscheduleEverything();
Expand Down
Loading