API

Human Robotics Public API

Index

API

The Java Api is a simple yet powerful library that lets any developer interact with Robios Robot with few lines of code.

The API lets you develop a Java program that will interact with the main robot brain using socket and an open protocol : this Java program can be called a Robot Behavior.

The first thing to do is to connect the robot to a Wifi network. This can easily be done using the configuration app on the head of robot. Once connected, the robot will send information to HumanRobotics cloud and will then be available to be reached by the API.

Internet is needed to execute the robot behavior on a remote computer.

If the robot behavior is uploaded on the Robot, then no Internet connection is needed.

Requirements

Download api source code

git clone ​https://osmadja@bitbucket.org/humanrobotics/io.humanrobotics.api.git

Compilation

To compile the API, Java JDK 8 and maven is needed.

Maven script is

$root/pom.xml

Tutorial

1 minute tutorial

` /**

    * a simple example of how to control the body and the head of Robios

    * @author olivier - olivier@humanrobotics.io

    */

public class ​OneMinuteTutorial​ {

    public static void main(String[] args) throws Exception {

        String apiKey = "<enter api key here>";

        String robotId = "<enter robot id here>";


        Robios robios = RobiosApi.getById(apiKey, robotId);


        // goes forward, during 400ms and stop

        robios.moveBody(100, 100).stopAfter(400);


        // Move the head in horizontal direction

        robios.moveHead(50, 0).moveHead(-50, 0);


        // Move the head in vertical direction

        robios.moveHead(0, 50).moveHead(0, -50);

    }

}

`

5 minutes tutorial

` package io.humanrobotics.api.examples;

import java.util.List;

import io.humanrobotics.api.Robios;

import io.humanrobotics.api.RobiosApi;

import io.humanrobotics.api.helper.Helper;

/\*\*

- a simple example of how to control Robios

\*

- @author olivier - olivier@humanrobotics.io

\*

\*/

public class ​FiveMinutesTutorial​ {

    public static void main(String[] args) throws Exception {


        String apiKey = "<enter api key here>";


        String robotId = "<enter robot id here>";



        Robios robios = RobiosApi.getById(apiKey, robotId);


        // Move the head to come back to default position robios.centerHead();


        // Make the robot say something robios.say("My name is Robios");


        List<String> allFaceExpressions = robios.getAllFaceExpressions();


        // Change the expression of the robot

        robios.setExpression(Helper.expression.HAPPY);


        // or use the first returned expression

        robios.setExpression(allFaceExpressions.get(0));


        // Display the api version

        System.out.println(robios.ext().apiVersion());


    }

}

`

Upload a program to the robot

NOT AVAILABLE / TO DO

Execution Indicators

The head of the robot is a display and has a status bar that shows the status of each robot subsystems. To display the status bar, click on the circle on the left corner on the top of the screen:

List of all status indicators:

Icon Description
Status between to robot core and the head
Status of the speaker system
Status of the Voice recognition system
Status of the Face detection system
Status of the Web System
Status of the low level communication
Status of Internet connection
Status of the Bluetooth link between the robot core and the head (head receiving data from the core)
Status of the Bluetooth link between the robot head and the robot core (head sending data to the core)