Skip to content

Commit

Permalink
Update app to 33
Browse files Browse the repository at this point in the history
  • Loading branch information
msgtn committed Nov 6, 2019
1 parent 5a7d448 commit 862012a
Show file tree
Hide file tree
Showing 59 changed files with 27,323 additions and 17,093 deletions.
8 changes: 7 additions & 1 deletion BlossomApp/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ import { GenerationScreen } from './screens/generation_screen';
import { SettingsScreen } from './screens/settings_screen';
import { NavButton } from "./components/nav_button";
import { Text, Icon, Button } from "native-base";
import { AppRegistry } from 'react-native';
import {name as appName} from './app.json';

AppRegistry.registerComponent('BlossomApp', () => App);



export default StackNavigator({
Home: {
Expand Down Expand Up @@ -42,7 +48,7 @@ export default StackNavigator({
swipeEnabled: false,
}),
navigationOptions: ({navigation}) => ({
title: "Blossom App",
title: "BlossomApp",
headerRight: <NavButton navigation={navigation} />,
}),
},
Expand Down
31 changes: 19 additions & 12 deletions BlossomApp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,40 @@ React Native app for interfacing with Blossom robot. Currently using a wrapper c
## Installation
The app can be installed on [Android](https://play.google.com/store/apps/details?id=host.exp.exponent) or [iOS](https://itunes.apple.com/us/app/expo-client/id982107779?mt=8) via the Expo Client app.

To build the app yourself, you must have either `npm` or `yarn` installed on your computer. On OSX, `watchman` must be installed with `brew` (`brew install watchman`).

### Android
If you want to use the last internally-published version, search for `https://exp.host/@hrc2/blossom-app`.
If you want to use the last internally-published version, search for `https://exp.host/@michaelhu/blossom-app`.

Alternatively, you can use either yarn (`yarn install` -> `yarn start`) or npm (`npm install` -> `npm run start`) to install and run the app locally, then either enter the generated project URL or scan the QR code.
Alternatively, you can use either `npm` (`npm install` -> `npm run start`) or `yarn` (`yarn install` -> `yarn start`) to install and run the app locally, then either enter the generated project URL or scan the QR code.

### iOS
Searching for apps is [not available on iOS](https://blog.expo.io/upcoming-limitations-to-ios-expo-client-8076d01aee1a) so you will have to publish the app under your own Expo account for it to be accessible through the Expo app.

After downloading the [iOS app](https://itunes.apple.com/us/app/expo-client/id982107779?mt=8), [create an Expo account](https://expo.io/).

Then, [download the Expo CLI](https://github.com/expo/exp) with `npm install -g exp`.
Then, [download the Expo CLI](https://github.com/expo/exp) with `npm install -g expo-cli`.

In this `BlossomApp` directory, run `exp publish` to publish the app under your username.
In the `BlossomApp` directory, run `expo publish` to publish the app under your username.

Once the process is complete, you can find the app in the phone application under the `Profile` tab.

### Controlling the robot
**TODO: Have screenshots**

After starting the CLI from the main directory, the IP address should have been displayed:
In the app, tap the `Settings` icon in the top right.

Enter the IP address of the host computer; this is listed under "Starting server on *IP_address*:8000" when first starting `start.py` or can be found other ways.

Once the IP address is entered, go back to the controller and toggle on `Control Robot`.

This allows you to control the robot's orientation (pitch, yaw, roll) by moving the phone and use sliders for the center height and ears.

_Android: If Blossom is not controllable at first, unfocus and refocus the app._

+-------------------+
| IP ADDRESS |
+-------------------+
| 10.132.3.171:8000 |
+-------------------+
### Troubleshooting
Until we eject from Expo, the app may break due to external updates.

The IP address in this case is `10.132.3.171`. Enter your unique IP address into the `Host` field and toggle `Control robot`.
Keeping the dependencies in `package.json`, particularly for `expo` and `react-native`, are important. [This table](https://docs.expo.io/versions/latest/sdk/overview/#sdk-version) is useful for determining the approriate SDK versions.

By default, the robot will copy the phone's orientation identically, i.e. the robot should be facing _away_ from you. To control the robot as it's facing you, toggle `Mirror` to be `On` and the robot will gaze at the top end of the phone (like a cat looking at a laser pointer, emitting from the top of the phone).
Otherwise, the `npm` and `yarn` CLI error messages are usually helpful to determine which packages to download or fix.
14 changes: 14 additions & 0 deletions BlossomApp/__tests__/App-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @format
*/

import 'react-native';
import React from 'react';
import App from '../App';

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';

it('renders correctly', () => {
renderer.create(<App />);
});
59 changes: 59 additions & 0 deletions BlossomApp/_package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"name": "BlossomApp",
"version": "0.1.0",
"private": true,
"devDependencies": {
"jest-expo": "34.0.0",
"react-test-renderer": "16.8.3"
},
"main": "./node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"eject": "expo eject",
"android": "expo android",
"ios": "expo ios",
"test": "node node_modules/jest/bin/jest.js"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/vector-icons": "^10.0.6",
"@unimodules/core": "^3.0.2",
"@unimodules/react-native-adapter": "^3.0.0",
"eslint": "3.14.1",
"expo": "^34.0.1",
"expo-font": "~5.0.1",
"native-base": "^2.12.1",
"npm": "^5.10.0",
"process": "^0.11.10",
"react": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz",
"react-native-modal": "^5.3.0",
"react-native-scripts": "^2.0.1",
"react-native-slider": "^0.11.0",
"react-navigation": "^1.6.1",
"react-redux": "^5.1.1",
"readable-stream": "^1.0.33",
"redux": "^3.7.2",
"stream-browserify": "^1.0.0",
"unimodules": "^1.0.0",
"util": "^0.10.4"
},
"react-native": {
"_stream_transform": "readable-stream/transform",
"_stream_readable": "readable-stream/readable",
"_stream_writable": "readable-stream/writable",
"_stream_duplex": "readable-stream/duplex",
"_stream_passthrough": "readable-stream/passthrough",
"stream": "stream-browserify"
},
"browser": {
"_stream_transform": "readable-stream/transform",
"_stream_readable": "readable-stream/readable",
"_stream_writable": "readable-stream/writable",
"_stream_duplex": "readable-stream/duplex",
"_stream_passthrough": "readable-stream/passthrough",
"stream": "stream-browserify"
}
}
55 changes: 55 additions & 0 deletions BlossomApp/android/app/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# To learn about Buck see [Docs](https://buckbuild.com/).
# To run your application with Buck:
# - install Buck
# - `npm start` - to start the packager
# - `cd android`
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
# - `buck install -r android/app` - compile, install and run application
#

load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")

lib_deps = []

create_aar_targets(glob(["libs/*.aar"]))

create_jar_targets(glob(["libs/*.jar"]))

android_library(
name = "all-libs",
exported_deps = lib_deps,
)

android_library(
name = "app-code",
srcs = glob([
"src/main/java/**/*.java",
]),
deps = [
":all-libs",
":build_config",
":res",
],
)

android_build_config(
name = "build_config",
package = "com.blossomapp",
)

android_resource(
name = "res",
package = "com.blossomapp",
res = "src/main/res",
)

android_binary(
name = "app",
keystore = "//android/keystores:debug",
manifest = "src/main/AndroidManifest.xml",
package_type = "debug",
deps = [
":app-code",
],
)
Loading

0 comments on commit 862012a

Please sign in to comment.