FIROS Config API Specification

DATE: 4 September 2015

Editors

+Íñigo González, Etxe-Tar +Ángel Hernández, Etxe-Tar +Fernánde Herranz, Etxe-TAr +José Jaime, Etxe-Tar

MIT License

Copyright (c) <2015>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Abstract

This specification defines the FIROS Config version 1 API. FIROS Config API v1 is intended to manage the whitelists, robots connection/disconnections and robots listings in FIROS.

FIROS is a tool that helps connecting robots to the cloud. For this purpose it uses the Robot Operating System (ROS, http://www.ros.org/) and the FIWARE Context Broker (http://catalogue.fiware.org/enablers/publishsubscribe-context-broker-orion-context-broker) as a way to publish and listen robot's data.

Status of this document

This is a work in progress and is changing on a daily basis. First major release 4 will be released by the end of September 2015

This specification is licensed under the FIWARE Open Specification License.


API Specification

Default

Get Robots [/robots]

Get robots handled by FIROS with their corresponding topics. - GET /robots

Response 200 (application/json)

Get Robot Name [/robot/{robot_name}]

Get the data published by the robot on Context Broker.. - GET /robot/{robot_name}

Response 200 (application/json)

Connect Robot [/robot/connect]

Search for robots and connect them - POST /robot/connect

This API makes FIROS connecting to new robots in case their names and topics match the ones allowed on the whitelist.json

Response 200 (application/json)

Disconnect Robot [/robot/disconnect/{robot_name}]

Disconnect robot which name matches with the one used - POST /robot/disconnect/{robot_name}

This API forces FIROS to disconnect from the robot specified by the NAME parameter. It will also delete any connection and entity associated to the particular robot on the Context Broker.

Response 200 (application/json)

Write whitelist [/whitelist/write]

Search for robots and connect them - POST /whitelist/write

This API overwrites or creates entries in the robot whitelist.

Request (application/json)
Response 200 (application/json)

Remove from whitelist [/whitelist/remove]

Remove elements from whitelist - POST /whitelist/remove

This API removes elements from the whitelist.

Request (application/json)
Response 200 (application/json)

Whitelist Restore [/whitelist/restore]

Restore the whitelist - POST /whitelist/restore

This API restores the whitelist file to its initial state.

Response 200 (application/json)

Examples

Default

Get Robots [/robots]

Get robots handled by FIROS with their corresponding topics. - GET /robots

Response 200 (application/json)

Headers

Content-Type: application/json

Body

[
    {
        "name": "turtle1",
        "topics": [
            {
                "type": "turtlesim.msg.Pose",
                "name": "pose",
                "structure": {
                    "y": "float32",
                    "x": "float32",
                    "linear_velocity": "float32",
                    "angular_velocity": "float32",
                    "theta": "float32"
                },
                "pubsub": "subscriber"
            },
            {
                "type": "geometry_msgs.msg.Twist",
                "name": "cmd_vel",
                "structure": {
                    "linear": {
                        "y": "float64",
                        "x": "float64",
                        "z": "float64"
                    },
                    "angular": {
                        "y": "float64",
                        "x": "float64",
                        "z": "float64"
                    }
                },
                "pubsub": "publisher"
            }
        ],
    }
]

Get Robot Name [/robot/{robot_name}]

Get the data published by the robot on Context Broker.. - GET /robot/{robot_name}

Response 200 (application/json)

Headers

Content-Type: application/json

Body

[
    {
        "id": "turtle1",
        "type": "ROBOT",
        "attributes": [
            {
                "type": "COMMAND",
                "name": "COMMAND",
                "value": [
                    "pose"
                ]
            },
            {
                "type": "DescriptionData",
                "name": "descriptions",
                "value": "http://wiki.ros.org/ROS/Tutorials/UsingRxconsoleRoslaunch||http://wiki.ros.org/ROS/Tutorials/UnderstandingNodes"
            },
            {
                "type": "turtlesim.msg.Pose",
                "name": "pose",
                "value": {
                    "FIROSstamp": 1424423606.27683,
                    "linear_velocity": 0,
                    "theta": 0,
                    "y": 5.544444561004639,
                    "x": 5.885244369506836,
                    "angular_velocity": 0
                }
            },
            {
                "type": "geometry_msgs.msg.Twist",
                "name": "cmd_vel",
                "value": {
                    "FIROSstamp": 1424423604309,
                    "linear": {
                        "y": 0,
                        "x": 0,
                        "z": 0
                    },
                    "angular": {
                        "y": 0,
                        "x": 0,
                        "z": 0
                    }
                }
            }
        ]
    }
]

Connect Robot [/robot/connect]

Search for robots and connect them - POST /robot/connect

Response 200 (application/json)

Headers

Content-Type: application/json

Body

{}

Disconnect Robot [/robot/disconnect/{robot_name}]

Disconnect robot which name matches with the one used - POST /robot/disconnect/{robot_name}

Response 200 (application/json)

Headers

Content-Type: application/json

Body

{}

Write whitelist [/whitelist/write]

Search for robots and connect them - POST /whitelist/write

Request (application/json)

Headers

Content-Type: application/json

Body

{
    "turtle\\w+": {
        "publisher": ["cmd_vel"],
        "subscriber": ["pose"]
    },
    "robot\\w+": {
        "publisher": ["cmd_vel.*teleop", ".*move_base/goal"],
        "subscriber": [".*move_base/result"]
    }
}
Response 200 (application/json)

Headers

Content-Type: application/json

Body

{}

Remove from whitelist [/whitelist/remove]

Remove elements from whitelist - POST /whitelist/remove

Request (application/json)

Headers

Content-Type: application/json

Body

{
    "turtle\\w+": {
        "publisher": [],
        "subscriber": ["pose"]
    },
    "robot\\w+": {
        "publisher": ["cmd_vel.*teleop", ".*move_base/goal"],
        "subscriber": []
    }
}
Response 200 (application/json)

Headers

Content-Type: application/json

Body

{}

Whitelist Restore [/whitelist/restore]

Restore the whitelist - POST /whitelist/restore

Response 200 (application/json)

Headers

Content-Type: application/json

Body

{}

References