-
Notifications
You must be signed in to change notification settings - Fork 0
Home
The Robotic Simulator Controller App was born as a UNI project for the Android practical course at the Technical University of Munich. It show cases Kotlin, Dagger, MVP, Bluetooth and Sensory input data usage. The function of this APP is to control a Robotic ARM in a simulation using the V-REP education Simulator.
The dagger folder contains the paths, modules and components for the dependency injection using Dagger2.
The MainActivity acts as the entry point of the app and provides Bluetooth functionality like displaying the available devices. Using the MainPresenter, it starts the Bluetooth Device Discovery, registers a broadcast receiver for Bluetooth changes and has 4 different states depending on the current Bluetooth status.
The MyBluetoothManager class wraps the BluetoothAdapter and offers basic Bluetooth functionality. The ConnectThread is used used to establish a connection given a UUID and the devices mac address. The BluetoothService class is created by the ConnectThread on a successful connection and is used to send and receive data from an established connection through an open Bluetooth socket. It is set as a reference to the MyBluetoothManger class which is accessible for the controller through DI.
With the controller part of the app it is possible to control the robotic arm. The activity for the controller is the ControllerActivity. It provides a Interface for the user to move different parts of the robotic arm. The logic to move the robotic arm instead is placed in the ControllerPresenter. Because of the MVP we separated the view and the business logic.
The ControllerPresenter itself gets the data from the view and processes this data. If the presenter gets data from the buttons it passes the data on to the ButtonManager. The ButtonManager evaluates the data and send it back to the presenter in a clear format. Other input data are motions which get recognized from the MotionDetector. The MotionDetector recognizes the motions through the gravity-sensor and notifies the presenter.
The data which the presenter receives from the ButtonManager and the MotionDetector it sends to the simulator through Bluetooth. The presenter gets from the previous activity an established Bluetooth-connection as BluetoothService with which he can communicate with the simulator.
If the user closes the activity or the Bluetooth-connection is closed, the app will return to the MainActivity.