Best android open-source packages and libraries.

Android robot camera

Android application that controls a robot using mqtt. On the main screen the use will see the video streamed by the robot.
Updated 1 year ago

Android robot camera

This is the frontend of a mobile camera robot. The robot will stream the video using UV4l and the application will display the stream using a webview.

Full tutorial on instructables

A video demo is available on youtube

The raspberry pi and arduino project are located here

The application has only a main screen, in the left of the screen the streamming image is displayed. On the right there are the controls. The main control is a steering wheel, touch the steering wheel in the direction you wish the robot to move. Below the steering wheel there is a headlight button, touch it to toggle the light.

On the left side of the screen is a webview with the streammed image, you can adjust the image size in the webview by pinch.

In the top right corner there is a text like : "- Batt Connected".

  • First dash means no obstacles, if there is an obstacle in front or in the back of the robot it will be signaled with a small arrow pointing in front or in the back.

  • The "Batt" status is not implemented yet.

  • "Connected" means that mqtt server is connected so the robot can be used, the other possible value is "Disconnected"

Screenshots

main.jpg

Working diagram

flow-diagram.jpg

Configuration

  1. passwords.xml
        <!--In the next lines mqttconfiguration needed-->
        <string name="mqtt_endpoint">tcp://host:port</string>
        <string name="mqtt_username">username</string>
        <string name="mqtt_password">password</string>
        <!--Next 3 lines containt endpoint and credentials for UV4l video streamming-->
        <string name="stream_endpoint">http://host:port/stream</string>
        <string name="stream_username">username</string>
        <string name="stream_password">password</string>
  1. strings.xml

This "transmit_command_interval" value is a default and it's ok to leave it to 100 ms.

    <!--how long between motor commands next transmissions (in milliseconds)-->
    <string name="transmit_command_interval">100</string>

Troubleshooting

If the steering wheel appears to scale up or down after touching it , try playing with the WheelRotate

and modify the postScale values