Skip to content

Commit

Permalink
Merge tag '0.0.9' into indigo
Browse files Browse the repository at this point in the history
Conflicts:
	deps/testfixtures
  • Loading branch information
asmodehn committed Jan 28, 2016
2 parents a96da63 + b694897 commit 6002a7d
Show file tree
Hide file tree
Showing 372 changed files with 1,100 additions and 1,607 deletions.
47 changes: 43 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,45 @@
[submodule "rostful/deps/Rester"]
path = rostful/deps/Rester
[submodule "deps/Rester"]
path = deps/Rester
url = https://github.com/asmodehn/Rester.git
[submodule "rostful/deps/testfixtures"]
path = rostful/deps/testfixtures
[submodule "deps/testfixtures"]
path = deps/testfixtures
url = https://github.com/Simplistix/testfixtures.git
[submodule "deps/flask-cors"]
path = deps/flask-cors
url = https://github.com/corydolphin/flask-cors.git
[submodule "deps/flask-restful"]
path = deps/flask-restful
url = https://github.com/flask-restful/flask-restful.git
[submodule "deps/Flask-Migrate"]
path = deps/Flask-Migrate
url = https://github.com/miguelgrinberg/Flask-Migrate.git
[submodule "deps/flask-security"]
path = deps/flask-security
url = https://github.com/asmodehn/flask-security.git
[submodule "deps/click"]
path = deps/click
url = https://github.com/mitsuhiko/click.git
[submodule "deps/webargs"]
path = deps/webargs
url = https://github.com/sloria/webargs.git
[submodule "deps/marshmallow"]
path = deps/marshmallow
url = https://github.com/marshmallow-code/marshmallow.git
[submodule "deps/flask-login"]
path = deps/flask-login
url = https://github.com/maxcountryman/flask-login.git
[submodule "deps/flask-principal"]
path = deps/flask-principal
url = https://github.com/mattupstate/flask-principal.git
[submodule "deps/flask-mail"]
path = deps/flask-mail
url = https://github.com/mattupstate/flask-mail.git
[submodule "deps/flask-wtf"]
path = deps/flask-wtf
url = https://github.com/lepture/flask-wtf.git
[submodule "deps/flask-sqlalchemy"]
path = deps/flask-sqlalchemy
url = https://github.com/mitsuhiko/flask-sqlalchemy.git
[submodule "deps/passlib"]
path = deps/passlib
url = https://github.com/asmodehn/passlib.git
11 changes: 0 additions & 11 deletions .hgignore

This file was deleted.

8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
udo: required
sudo: required
dist: trusty
language: generic
install:
Expand All @@ -13,11 +13,11 @@ install:
- sudo `which rosdep` init
- rosdep update
# Use rosdep to install rostful-node's dependencies
- rosdep install --default-yes --from-paths rostful/ --rosdistro $CI_ROS_DISTRO
- rosdep install --default-yes --from-paths ./ --rosdistro $CI_ROS_DISTRO
script:
- source /opt/ros/$CI_ROS_DISTRO/setup.bash
- mkdir rostful/build
- cd rostful/build
- mkdir build
- cd build
- cmake .. -DCMAKE_INSTALL_PREFIX=./install
- make -j1
- make -j1 tests
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Changelog
=========


0.1.0
-----
* now working with pyros 0.1.0
* Added Rester tests to validate API behavior on ROS systems
* ...

0.0.8
-----
* Extracted multiprocess mess from this package. Trying to keep this a neat python (flask) web REST backend.

0.0.2
-----
* Converted to Catkin
* Migrated from raw python to Flask
* Added Celery Support for async tasks
* Experimental Rocon support
7 changes: 6 additions & 1 deletion rostful/CMakeLists.txt → CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,10 @@ install(DIRECTORY launch/

## Unit tests
if (CATKIN_ENABLE_TESTING)
add_subdirectory(tests)

# Unit tests using nose, but needing a running ROS core.
find_package(catkin REQUIRED COMPONENTS rostest)
#TODO add_rostest(rostful.test)


endif()
File renamed without changes.
86 changes: 28 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,41 @@
[![Build Status](https://travis-ci.org/asmodehn/rostful.svg?branch=indigo-devel)](https://travis-ci.org/asmodehn/rostful)
# ROSTful

## Try it now
Go check the [examples](https://github.com/asmodehn/rostful/tree/indigo-devel/rostful_examples)
Overview
========

## Overview
ROStful - A REST API for ROS.

ROStful is a lightweight web server for making ROS services, topics, and actions available as RESTful web services. It also provides a client proxy to expose a web service locally over ROS.
Rostful is intended to be the outside layer of a ros system,
communicating with the outside world via HTTP,
and exposing a REST API to use the robot services, or introspect robot topics.
As such this should be launched either :
- as a python code with the de facto python standard behaviors ( venv, pip requirements, etc. ),

ROStful web services primarily use the [rosbridge](http://wiki.ros.org/rosbridge_suite) JSON mapping for ROS messages. However, binary serialized ROS messages can be used to increase performance.
``` python -m rostful flask ```

The purpose of ROStful is different from [rosbridge](http://wiki.ros.org/rosbridge_suite): rosbridge provides an API for ROS through JSON using web sockets. ROStful allows specific services, topics, and actions to be provided as web services (using plain get and post requests) without exposing underlying ROS concepts.
The ROStful client, however, additionally provides a modicum of multi-master functionality. The client proxy is a node that connects to a ROStful web service and exposes the services, topics, and actions locally over ROS.
- as a ros package, with the de facto ros standard behaviors.

The ROStful server has no dependencies on 3rd party libraries, and is WSGI-compatible and can therefore be used with most web servers like Apache and IIS.
``` roslaunch rostful rostful.launch ```

### ROStful web services
so that users from both world can use it efficiently.

A ROStful web service is a web service that uses ROS data structures for input and output. These include services, topics, and actions.
What will not be in Rostful
===========================
- Security related stuff ( Authentication/Authorization ) implementation.
We will not provide here any Authentication/Authorization mechanisms without ROS providing one first.
And even after that, the implications of such an implementation would probably fit better in another specific microservice, that we would rely on in rostful.

Service methods accept as input a ROS message over HTTP POST and return a ROS message in the response. The input and output cannot be defined directly with ROS messages; it must use a ROS service definition.
PYTHON VIRTUALENV SETUP
=======================

Methods denoted as topics may use any ROS message, but are limited to accepting that message via HTTP POST or returning it, taking no input, via HTTP GET. Topic methods do not need to allow both methods. A topic method allowing POST is described as a "subscribing" method, and one that allows GET is a "publishing" method.
How to setup your python virtual environment on Ubuntu (tested on Trusty
14.04)
- Install and Setup virtualenvwrapper if needed
``` sudo apt-get install virtualenvwrapper echo "source /etc/bash_completion.d/virtualenvwrapper" >> ~/.bashrc ```

Methods denoted as actions consist of a set of subsidiary topic methods, the subscribing-only `goal` and `cancel` methods, and the publishing-only `status`, `result`, and `feedback` methods. These methods are located at the url `<action method url>/<suffix>`, where the suffix is the subsidiary method name.
- Create your virtual environment for your project
``` mkvirtualenv myproject --no-site-packages workon myproject ```

### The ROStful server

The ROStful server can provide services, topics, and actions that are locally available over ROS as ROStful web services. Topics may be specified as publishing, subscribing, or both.

ROStful uses the rosbridge JSON mapping by default, but binary serialized ROS messages can be sent with the `Content-Header` set to `application/vnd.ros.msg`. Giving this MIME type in the `Accept` header for queries without input (i.e., publishing topic methods) will cause the server to return serialized messages.

### The ROStful client

The ROStful client is a node that connects to a ROStful web service and makes its services, topics, and actions locally available over ROS.

The client can be given the root URL of a ROStful web service, in which case it will connect to all services, topics, and actions for that web service, or it can be given the URL of an individual service, topic, or action to connect to.
When connecting directly, the name of service, topic, or action is used as the service, topic, or action name. When connecting to the root URL, the name of the web service, if any, is used as a prefix (followed by a slash) to the service/topic/action names. This can be controlled using the `--prefix` and `--no-prefix` options.

For privacy, the client will not allow the web service to subscribe to local ROS topics unless the `--allow-subscription` option is given.

The client periodically queries the server for its published topics, and then publishes those messages locally. The default interval is 1 second, but this can be set with the `--publish-interval` option.

The `--binary` option directs the client to use binary serialized messages instead of JSON.

For debugging, the client can be used with the same ROS master as the server. Giving the `--test` option causes the client to append `_ws` to the names of the services/topics/actions it connects to, so they don't conflict with those being used by the server.

## Web service/component description format

The ROStful server functions as a ROS component, providing services and actions, and publishing and subscribing to topics. Due to the lack of a standard format for describing ROS components, ROStful uses simple INI-file-based format. The file is broken up into sections, with each section starting with a header contained in square brackets. In addition to standard INI file formatted sections, "definition" sections are allowed for defining messages, services, and actions.

### Manifest section

There is a single optional section titled `Manifest`. The section is in standard INI file format, a sequence of lines each containing a key-value pair separated by `=`. The special key `Def-Type` indicates the type of description being provided (e.g., `Node`, `Service`, `Topic`, `Action`).

For services, topics, and actions, the keys `Type` and `Name` are given, which give the ROS type of the service/topic/action, and the service/action name or topic as appropriate.

For topics, the keys `Publishes` and `Subscribes` are given with the values `true` or `false`.

### Other sections

The `Node` description includes the optional sections `Services`, `Actions`, `Publishes`, and `Subscribes`. These sections also follow the INI file format, where the keys are the names of the services, actions, or topics, and the values are their ROS types.

### Definitions

Definition sections have a title in the form `<definition type>:<definition name>`. The definition type, given before the colon, can be one of `msg`, `srv`, or `action`, corresponding to ROS message, service, and action definitions. The definition name, given after the colon, is the name of the data structure being defined. The content of the section is exactly the format used in the ROS files defining messages, services, and actions, respectively.

### Purpose

This description format allows the full definition for a component to be given inline. The description for a node or method is located at `<node or method url>/_rosdef`. Setting the query parameter `full=true` will include all the definitions referenced in description (recursively). Setting the query parameter `json=true` will return a JSON representation of the definition.
- Populate it to use rostful. The catkin dependency is temporarily needed
to be able to use the setup.py currently provided in rostful.
``` pip install catkin-pkg rostful ```
121 changes: 121 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
.. image:: https://travis-ci.org/asmodehn/rostful.svg?branch=indigo-devel
:target: https://travis-ci.org/asmodehn/rostful

Overview
========

ROStful - A REST API for ROS.

Rstful is intended to be the outside layer of a ros system. meaning it will interface other software systems with ros.
As such this should be launched either :
* as a python code with the de facto python standard behaviors ( venv, pip requirements, etc. ),

```
python -m rostful flask
```

* as a ros package, with the de facto ros standard behaviors.

```
roslaunch rostful rostful.launch
```

so that users from both world can use it efficiently.


PYTHON VIRTUALENV SETUP
=======================

How to setup your python virtual environment on Ubuntu (tested on Trusty 14.04)
* Install and Setup virtualenvwrapper if needed
```
sudo apt-get install virtualenvwrapper
echo "source /etc/bash_completion.d/virtualenvwrapper" >> ~/.bashrc
```
* Create your virtual environment for your project
```
mkvirtualenv myproject --no-site-packages
workon myproject
```
* Populate it to use rostful. The catkin dependency is temporarily needed to be able to use the setup.py currently provided in rostful.
```
pip install catkin-pkg rostful
```

|Build Status| # ROSTful

Try it now
----------

Go check the `examples`_

Overview
---------

ROStful is a lightweight web server for making ROS services, topics, and
actions available as RESTful web services. It also provides a client
proxy to expose a web service locally over ROS.

ROStful web services primarily use the `rosbridge`_ JSON mapping for ROS
messages. However, binary serialized ROS messages can be used to
increase performance.

The purpose of ROStful is different from `rosbridge`_: rosbridge
provides an API for ROS through JSON using web sockets. ROStful allows
specific services, topics, and actions to be provided as web services
(using plain get and post requests) without exposing underlying ROS
concepts. The ROStful client, however, additionally provides a modicum
of multi-master functionality. The client proxy is a node that connects
to a ROStful web service and exposes the services, topics, and actions
locally over ROS.

The ROStful server has no dependencies on 3rd party libraries, and is
WSGI-compatible and can therefore be used with most web servers like
Apache and IIS.

ROStful web services
~~~~~~~~~~~~~~~~~~~~~

A ROStful web service is a web service that uses ROS data structures for
input and output. These include services, topics, and actions.

Service methods accept as input a ROS message over HTTP POST and return
a ROS message in the response. The input and output cannot be defined
directly with ROS messages; it must use a ROS service definition.

Methods denoted as topics may use any ROS message, but are limited to
accepting that message via HTTP POST or returning it, taking no input,
via HTTP GET. Topic methods do not need to allow both methods. A topic
method allowing POST is described as a “subscribing” method, and one
that allows GET is a “publishing” method.

Methods denoted as actions consist of a set of subsidiary topic methods,
the subscribing-only ``goal`` and ``cancel`` methods, and the
publishing-only ``status``, ``result``, and ``feedback`` methods. These
methods are located at the url ``<action method url>/<suffix>``, where
the suffix is the subsidiary method name.

The ROStful server
~~~~~~~~~~~~~~~~~~

The ROStful server can provide services, topics, and actions that are
locally available over ROS as ROStful web services. Topics may be
specified as publishing, subscribing, or both.

ROStful uses the rosbridge JSON mapping by default, but binary
serialized ROS messages can be sent with the ``Content-Header`` set to
``application/vnd.ros.msg``. Giving this MIME type in the ``Accept``
header for queries without input (i.e., publishing topic methods) will
cause the server to return serialized messages.

The ROStful client
~~~~~~~~~~~~~~~~~~~

The ROStful client is a node that connects to a ROStful web service and
makes its services, topics, a

.. _examples: https://github.com/asmodehn/rostful/tree/indigo-devel/rostful_examples
.. _rosbridge: http://wiki.ros.org/rosbridge_suite

.. |Build Status| image:: https://travis-ci.org/asmodehn/rostful.svg?branch=indigo-devel
:target: https://travis-ci.org/asmodehn/rostful
1 change: 1 addition & 0 deletions deps/Flask-Migrate
Submodule Flask-Migrate added at 95518a
1 change: 1 addition & 0 deletions deps/Rester
Submodule Rester added at 1b7b03
1 change: 1 addition & 0 deletions deps/click
Submodule click added at f403b0
1 change: 1 addition & 0 deletions deps/flask-cors
Submodule flask-cors added at 3108f7
1 change: 1 addition & 0 deletions deps/flask-login
Submodule flask-login added at f74c86
1 change: 1 addition & 0 deletions deps/flask-mail
Submodule flask-mail added at 1709c7
1 change: 1 addition & 0 deletions deps/flask-principal
Submodule flask-principal added at 0b5cd0
1 change: 1 addition & 0 deletions deps/flask-restful
Submodule flask-restful added at f57ddf
1 change: 1 addition & 0 deletions deps/flask-security
Submodule flask-security added at 7f6925
1 change: 1 addition & 0 deletions deps/flask-sqlalchemy
Submodule flask-sqlalchemy added at cfe529
1 change: 1 addition & 0 deletions deps/flask-wtf
Submodule flask-wtf added at f20c32
1 change: 1 addition & 0 deletions deps/marshmallow
Submodule marshmallow added at fb01c9
1 change: 1 addition & 0 deletions deps/passlib
Submodule passlib added at 8e52bc
1 change: 1 addition & 0 deletions deps/webargs
Submodule webargs added at 0e4d95
1 change: 1 addition & 0 deletions doc/changelog_link.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. include:: ../CHANGELOG.rst

0 comments on commit 6002a7d

Please sign in to comment.