Skip to content

Latest commit

 

History

History

flutter

Flutter Controller App

English | 简体中文 | Deutsch | Français | Español | 한국어

This Controller app serves as a remote controller for the OpenBot vehicle similar as a BT controller (e.g. PS3/4 or Xbox). It runs on another Android/iOS device and supports live video/audio streaming in addition to control.

Getting Started

Begin by installing Flutter on your system. Choose the appropriate download for your operating system, which includes options for Windows, macOS, Linux, and ChromeOS. Follow the official Flutter installation guide for detailed instructions: Flutter Installation Guide

Using Terminal

  • Once Flutter is installed successfully, open your terminal or command prompt.

  • Change your current directory to the location where the OpenBot project is stored and then navigate to OpenBot/controller/flutter.

  • Use the following commands to run the Flutter application from the terminal.

    Install Dependencies:

     flutter pub get 

    Run the project:

     flutter run

    If you encounter any issues, run the following command:

     flutter doctor

Using Editor

  • Follow the official Flutter guide for setting up an editor: Set up an editor

  • Ensure that your editor is configured for Flutter development. Install any required plugins or extensions, following the editor-specific instructions in the Flutter documentation for the best development experience.

  • Once you open your project in the editor after the setup, it will appear as shown in the following image.

  • Please follow the instructions similar to the ones mentioned above for running Flutter in the terminal and directly run using the run button for future repetitions.

Connection

When the controller app is started, it immediately tries to connect to the robot and shows the following screen:

To connect the controller to the robot, set the robot's control mode to Phone. For example, in the FreeRoamFragment the phone mode is activated like this:

Once connected, the controller app will look like this:

Here you can select to drive the robot by tilting the phone, or by using the on-screen controls.

Note: This should be sufficient to connect, but if the connection cannot be established after 30 seconds, toggle the Control setting on the bot app to Gamepad and then to Phone again to re-initiate the connection. If that fails, exit the controller app and start it again. Toggle the control mode again on the robot app.

Operation

On-screen controls

This mode allows the user to control the robot car via two sliders in Dual Drive mode. You can turn left/right by moving the slider thumb up and down on each side. The wheels on each side turn forward/backward when moving the thumb above/below the center of the slider.

  • Indicators: You can also set the left/right turn indicators by clicking on the arrows on the top-left of the screen.

  • Switch Camera: switch between the front and back camera modes.

  • Mute: enable/disable audio transmission.

  • Mirror view: mirror the the video feed.

Tilt to drive

The controller can also use its accelerometer motion sensor to drive the robot. If you select this option, the controller will enter a full-screen (Zen) mode with only the video showing and brake and accelerator pedals. To exit this mode, double-tap on the screen.

Here is a picture of the tilt mode screen:

Use the accelerator and brake buttons to move forward/backward.

  • Pressing the accelerator will accelerate the robot to full speed within 2 seconds. When you release the button, the robot will slow down to a stop (stop speed set to 0% of the maximum speed, can be adjusted).
  • Pressing the brake button will immediately stop the robot. If we hold the brake for another second, the robot will start moving backwards until it reaches the maximum reverse speed in one second. When we let go of the brake, the robot will come to a stop.
  • The robot is steered by tilting the controller phone left or right.

Here is a Technical Overview of the controller app.