Giter Site home page Giter Site logo

helloclone's Introduction

Clone SDK & Sample Code

What is Clone?

Clone Robot is an Android-based robot designed by Autonomous. It is a 4-foot tall robot, capable of moving around, running Android apps, and being controlled by a smartphone.

Email Duy at [email protected] if you have any questions :)

Develop Apps for Clone

Clone is based on Android, so building a Clone app is the same with building an Android app.

The Clone SDK lets developers:

  • instruct Clone to move at a given speed, direction, and amount of time
  • read Clone's internal sensors including velocity, battery level, bumper, and IMU
  • see and hear what Clone sees & hears

ScreenShot

Build your first Clone app

Import HelloClone project into Android Studio.

/HelloClone/RobotApp/
/HelloClone/PhoneApp/

Update Config.java under /autonomous/sdk/ with the your ROBOT ID.

public static String ROBOT_ID ="YOUR_ROBOT_ID";

Install the RobotApp on the Android tablet on Clone.

Install PhoneApp on your Android phone.

That's it. You now can use your phone to remotely control Clone to move around, capture photos, or record videos.

Clone SDK

Create a new Clone object with your ROBOT ID

clone = new Clone(Config.ROBOT_ID);

Drive forward

clone.moveForward();

Drive backward

clone.moveBackward();

Turn right

clone.turnRight();

Turn left

clone.turnLeft();

Stop

clone.stop();

Auto-charge

clone.autocharge();

Start recording a video

clone.startRecording();

Stop recording a video

clone.stopRecording();

App Ideas & Examples

Example 1: Build your own Telepresence Robot!

// MainActivity.java

// Catch the button press action

private final CompoundButton.OnCheckedChangeListener onChangeDirection = new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (isChecked) {
                String new_command = "";
                switch (buttonView.getId()) {
                    case R.id.btn_top:
                        clone.moveForward();
                        break;
                    case R.id.btn_bottom:
                        clone.moveBackward();
                        break;
                    case R.id.btn_left:
                        clone.turnLeft();
                        break;
                    case R.id.btn_right: 
                        clone.turnRight();
                        break;
                    case R.id.btn_stop_action:
                        if(currentActionView != null){
                            currentActionView.setChecked(false);
                        }
                        clone.stop();
                        break;
                }
                if(currentActionView !=null){
                    currentActionView.setChecked(false);
                }
                currentActionView = buttonView;
            }
        }
    };
    

Example 2: Take a screenshot from thousands of miles away :)

// MainActivity.java

// Catch the button press action

final ImageView button = (ImageView) findViewById(R.id.btnCapture);

button.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {
        if (mSubscriber == null) {
            return;
        }
        ((BasicCustomVideoRenderer) mSubscriber.getRenderer()).saveScreenshot(true);
        Toast.makeText(MainActivity.this, "Screenshot saved.", Toast.LENGTH_LONG).show();
    }
});
// BasicCustomVideoRender.java

// Return the image

decodeYUV420(intArray, yuv, width, height);

Bitmap bmp = Bitmap.createBitmap(intArray, width, height, Bitmap.Config.ARGB_8888);



// TODO: IMPLEMENT YOUR OWN ALGORITHM HERE TO ANALYZE THE CURRENT SCREENSHOT
// AND TELL THE ROBOT TO PERFORM ANY ACTION



Example 3: Write your own algorithm to analyze what Clone sees, frame by frame, and instruct Clone to move accordingly. For example, autonomous navigation app, office security app, etc.

// BasicCustomVideoRender.java

public void displayFrame(Frame frame) {
    mFrameLock.lock();
    if (this.mCurrentFrame != null) {
        this.mCurrentFrame.recycle();
    }
    this.mCurrentFrame = frame;
    mFrameLock.unlock();
            

            
    // TODO: IMPLEMENT YOUR OWN ALGORITHM HERE TO ANALYZE FRAME BY FRAME
    // AND TELL THE ROBOT TO PERFORM ANY ACTION 


Example 4: Send a file from your phone to Clone to present to the audience

Example 5: Office security to notify your phone when a stranger enters the building or your home

Example 6: Clone autonomously moves around a warehouse to count inventory

Hardware specifications

  • Battery time: 3 hours
  • Charging time: 2 hours
  • Maximum velocity: 27 inches per second
  • Maximum rotational velocity: 180 degrees
  • Materials: CNC Aluminum, PP Plastic
  • Dimension: 14 in x 14 in x 43 in
  • Weight: 16 lbs

ScreenShot

helloclone's People

Contributors

duyhtq avatar jacksnow00 avatar

Watchers

 avatar

Forkers

skylight1

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.