Clone SDK

What is Clone?

Clone 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.

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:

Build your first Clone app

Import HelloClone project into Android Studio.
/HelloClone/RobotApp/
/HelloClone/PhoneApp/
Update Config.java 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:  Tell Clone to take a picture and send it back to your phone
// 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


Example 2:  Drive Clone around with your phone
// 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 3:  Write your own algorithm to analyze what Clone sees and instruct Clone to move accordingly
// BasicCustomVideoRender.java
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




Rest API

Create new Session & Token
//call to API 
public static String HOST = "http://54.208.60.183";
//Api create new session & token.
{HOST}/session/create
resuts:
    {
      "session_id": "2_MX40NTgzNzUxMn5-MTQ5NDYyMTg3NTI2Nn5LdjZrUDJBa0VJQTVjVS9URkU1SSticFV-fg",
      "token": "T1==cGFydG5lcl9pZD00NTgzNzUxMiZzaWc9OWM2NDMxMGExMThjMzI0Y2YzNjYzNzFmNWI3NjlmYjljNjNhMGVlNjpub25jZT0xNTY1NTkmY29ubmVjdGlvbl9kYXRhPU5vbmUmY3JlYXRlX3RpbWU9MTQ5NDYyMTg3OCZyb2xlPXB1Ymxpc2hlciZleHBpcmVfdGltZT0xNDk0NzA4Mjc4JnNlc3Npb25faWQ9Ml9NWDQwTlRnek56VXhNbjUtTVRRNU5EWXlNVGczTlRJMk5uNUxkalpyVURKQmEwVkpRVFZqVlM5VVJrVTFTU3RpY0ZWLWZn"
    }
Create only Token from already exits Session
//call to API
{HOST}/token/create?session_id=<Your_session_id>
results:
     {
      "session_id": "2_MX40NTgzNzUxMn5-MTQ5NDYyMTg3NTI2Nn5LdjZrUDJBa0VJQTVjVS9URkU1SSticFV-fg",
      "token": "T1==cGFydG5lcl9pZD00NTgzNzUxMiZzaWc9OWM2NDMxMGExMThjMzI0Y2YzNjYzNzFmNWI3NjlmYjljNjNhMGVlNjpub25jZT0xNTY1NTkmY29ubmVjdGlvbl9kYXRhPU5vbmUmY3JlYXRlX3RpbWU9MTQ5NDYyMTg3OCZyb2xlPXB1Ymxpc2hlciZleHBpcmVfdGltZT0xNDk0NzA4Mjc4JnNlc3Npb25faWQ9Ml9NWDQwTlRnek56VXhNbjUtTVRRNU5EWXlNVGczTlRJMk5uNUxkalpyVURKQmEwVkpRVFZqVlM5VVJrVTFTU3RpY0ZWLWZn"
    }
To Start Record.
//call to API or use already wrapped on clone Class.
{{HOST}}/session/start-archive?session_id=<your-session-id>
results:
    {
    "status": "started",
    "output_mode": null,
    "name": null,
    "url": null,
    "created_at": "2017-05-12T20:54:52+00:00",
    "has_video": true,
    "session_id": "1_MX40NTgzNzUxMn5-MTQ5NDYwNTgzMzc3OX5kNWprUktaeVhsb1hLdUFRN05SNStwRnl-fg",
    "id": "e30a8c18-e981-46ee-9afc-5902f1d1cb32",
    "duration": 0,
    "partner_id": 45837512,
    "has_audio": true,
    "size": 0
}
to stop Record
//call to API or use already wrapped on clone Class.
{{HOST}}/session/stop-archive?archive_id=<your-archive-id>
// archive_id is "id" in of results when you call start-archive. 
// example abrow archive_id is : "e30a8c18-e981-46ee-9afc-5902f1d1cb32"

{{HOST}}/session/stop-archive?archive_id=e30a8c18-e981-46ee-9afc-5902f1d1cb32

results:
    {
    "status": "stopped",
    "output_mode": null,
    "name": null,
    "url": "https://s3.amazonaws.com/clone-api/45837512/e30a8c18-e981-46ee-9afc-5902f1d1cb32/archive.mp4",
    "created_at": "2017-05-12T20:54:52+00:00",
    "has_video": true,
    "session_id": "1_MX40NTgzNzUxMn5-MTQ5NDYwNTgzMzc3OX5kNWprUktaeVhsb1hLdUFRN05SNStwRnl-fg",
    "id": "e30a8c18-e981-46ee-9afc-5902f1d1cb32",
    "duration": 0,
    "partner_id": 45837512,
    "has_audio": true,
    "size": 0
}