GithubHelp home page GithubHelp logo

skyeofbreeze / letsrobot-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from runmyrobot/runmyrobot_android

1.0 3.0 0.0 19.17 MB

Unofficial LetsRobot controller that runs on a phone instead of a Raspberry Pi. Development has been abandoned on this, but lives on at https://github.com/remotv/controller-for-android

License: Apache License 2.0

Java 29.05% Kotlin 64.81% Makefile 0.11% C 6.04%
android robotics letsrobot

letsrobot-android's Introduction

Maintainability

letsrobot-android

android code to run on robots via LetsRobot api

Development

Required software

Android Studio

  • Version 3.2 or higher. May not be buildable on lower versions

Branches

master

The most stable code in the repo. Can be used for testing and is known to work

devel

The latest code, mostly stable, but might have issues. Sometimes this code may not be buildable

Device Limitations

  • Setup to be capable of running on Android 4.1 (API 16) or higher. Some devices may run into issues, so feel free to report them

  • Android Things not tested

  • Raspberry PI not tested

Setup

Robot and Camera Ids

When the app is started, and permissions have been accepted (API > 23), a setup screen will pop up with settings that can be changed. RobotID is the only id required to get it connected to the API.

User Configurable Settings

  • RobotID

  • Enable Camera Toggle

  • CameraID (Disabled if enable camera is false)

  • Camera Password (Disabled if enable camera is false)

  • Resolution (Disabled if enable camera is false)

  • Enable Microphone Toggle

  • Text to speech toggle

  • Error reporting toggle (Disabled for now)

  • Fake black screen to save power (Not really needed that much now that the screen can be turned off)

  • Bluetooth device setup

  • Scanning a QR Code that was exported with this app.

Running the robot

To make the robot operational and connected:

  1. Click build and run to deploy to phone (Play button)
  2. Open App if not opened already
  3. Accept permissions if they pop up
  4. Configure robot settings
  5. Hit POWER - Button will be disabled until fully connected
  6. Robot will now be connected to letsrobot website. POWER button will be green

Supported Commands

Table mode

Only the owner can use this. Turns on table top mode, not allowing 'f' and 'b' commands, but allows everything else. Not case sensitive

On: '.table on'

Off: '.table off'

Disable All Control

Only the owner can use this. Disables all commands, even for the owner.

Disable: '.motors off' Enable: '.motors on'

Battery Level

Only the owner can use this. '.battery level'

Robot says the phone battery level 'Internal battery 80%'

TTS Language

'.locale en-US' Sets the locale of the TTS (System TTS Only)

Language must be installed for it to speak using it. This only changes the accent, and does not translate.

Ways to stop the robot:

  • A notification will appear that states that the app is active. Use the "Terminate App" Button to kill the app from anywhere

  • Hit the POWER button again when it is green to disable

  • Swipe app away from recents

App Permissions

Location

Needed for bluetooth device scanning. Not requested or used otherwise

Camera

Needed to stream the camera. Only requested if camera is enabled in settings

Microphone

Needed to stream the microphone. Only requested if the mic is enabled in settings

Storage

Required on some devices for importing a QR Code from a photo on the device. Only requested when that feature is used

Troubleshooting issues

Flickering Camera and Microphone indicators

Reload the robot page on LetsRobot.tv

Also check that the robotId, cameraId, and cameraPass match with the site. If your camera password on the site is empty, your password is "hello"

Most indicators immediately go red

Check the phone's internet connection

Most indicators go red after being yellow for some time

  • Check the phone's internet connection.

  • Connection may be too slow or connected to a WiFi router with no internet.

  • Also could potentially be a site issue, but most of the time it would be internet related

Robot turns off after some time if I turn the screen off

This only applies to Android 6.0 and above

  • Go to the app settings and turn battery optimization off for this app

Adding separate components

Make a class that extends and implements methods of Component

Then add to the Builder's externalComponents list

See PlayAudioComponentExample.kt See MainRobotController.kt for an example of CustomComponentExample being added

Devices supported

  • SaberTooth Motor Controllers (Simplified Serial), 9600 BAUD
  • Arduino via raw commands (f, b, l, r, stop, etc), 9600 BAUD, USB or Bluetooth Classic
  • Any device that has the same protocol as SaberTooth
  • Lego Mindstorms NXT (JoystickDriver or equivalent. Most commonly used with older FIRST Tech Challenge robots that ran RobotC and Labview)

Connection Options

Error reporting

Errors do not get reported at the moment

Some known issues

  • Battery optimization has to be disabled if OS version is 6.0 or above if you want to turn the screen off on the phone.

  • Currently no code to use a USB webcam. Also currently not sure if the Raspberry Pi with camera functions as is

  • BluetoothClassic currently not hooked up to handle input from the connected device. It can output to it just fine

Supported or broken devices

Feel free to add your device to this list if you have tested it via a pull request

Broken devices:

Verified functional devices:

  • Casio G'zOne CA-201L (4.1.2 JellyBean). Tested with 512kbps bitrate and bluetooth. Might not support USB OTG

  • ZTE Speed (4.4 Kitkat), might not be fast enough on high bitrates, some weird bluetooth issues possible (#45)

  • Motorola Moto Z (8.0.0 Oreo)

  • Galaxy S4 (5.0.1 Lollipop)

  • Pixel 2 XL (9 Pie)

  • Samsung Galaxy J5 (tested with 768x432, 512kb/s)

This software uses code of FFmpeg licensed under the LGPLv2.1 and its source can be downloaded here

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.