Skip to content
Snippets Groups Projects
Commit cdc79c74 authored by Markus Grotz's avatar Markus Grotz
Browse files

update doc

parent d7cf8a79
No related branches found
No related tags found
No related merge requests found
API Reference
==============
If you are looking for information on a specific function.
*************
API Reference for Robot Module
==============================
......
......@@ -2,10 +2,20 @@ Examples
========
Example code snippets can be found in the [examples
folder](https://git.h2t.iar.kit.edu/sw/armarx/python3-armarx/-/tree/master/examples)
of the code repository.
In the following,
Retrieving a proxy
------------------
Retrieving a proxy of a running component is straightforward. Interface can be
directly imported and proxy can be accessed using the `get_proxy` method.
.. highlight:: python
.. code-block:: python
......@@ -19,13 +29,20 @@ Retrieving a proxy
Creating a proxy
----------------
An instance of the class that inherits the interace has to be created first.
Methods that are specified in the interface have to be implemented. In this
case `generateRandomInt`. Result parameters have to match the return value as
specified in the interface. The parameter `Ice::IceContext` is also passed to
every method that are defined in the interface. Once an instance of the class
is created it can be registered with `ice_manager.register_object` and a name
of the proxy. Other components can then load the interface and access the
component via the name of the proxy.
.. highlight:: python
.. code-block:: python
#!/usr/bin/env python
import random
from armarx import RNGProviderComponentInterface
......@@ -47,3 +64,41 @@ Creating a proxy
if __name__ == '__main__':
main()
Processing images
-----------------
The module `armarx_vision.image_processor` provides a class to conveniently
process images from armarx. Here the `process_images` method has to be
implemented. The method has two parameters `images` and `info`. The former
contains the images and the latter contains information about the images, e.g.
the timestamp. The return value of the method is a tuple of result images and
information about these.
The approach is similar to :ref:`Creating a proxy`. Note that
this method does not have an `Ice::IceContext` as it is not specified by a
slice interface. The method `ImageProcessor.on_connect()` takes care of
subscribing to the component that publishes the images, i.e.
`visionx::ImageProviderInterface`. Additionally, a component is created
internally that handles the result images.
.. highlight:: python
.. code-block:: python
from armarx_vision.image_processor import ImageProcessor
class TestImageProcessor(ImageProcessor):
def process_images(self, images, info):
info.timeProvided = 1633428148974550
result_image = np.random.random(images.shape) * 128
return result_image, info
image_processor = TestImageProcessor("ExampleImageProvider")
image_processor.on_connect()
from 🤖 import armarx as ❤
**************************
Welcome to armarx python binding's documentation. Grab the latest version with
:ref:`Installation` and then get an overview with the :ref:`Quickstart`
.. toctree::
:maxdepth: 3
:caption: Contents:
:ref:`Quickstart`
users_guide
installation
examples
api
User's Guide
============
Checkout section :ref:`Quickstart` for a quick introduction. For more detailed
instructions on the installation see section :ref:`Installation`. The ArmarX
Python bindings share some configuration with the statecharts. Section
:ref:`Configuration` gives more details. :ref:`Examples` lists some examples.
Quickstart
----------
Grab the latest version with `poetry add armarx` or `pip install armarx`.
To access a proxy via ice you can load the interface with the import keyword.
For convenience, functions such as `get_proxy` are automatically injected with
default parameters.
.. highlight:: python
.. code-block:: python
from armax import PlatformNavigatorPrx
platform_navigator = PlatformNavigatorPrx.get_proxy()
platform_navigator.movePlatform(6000, -7300, 2.2)
That's it. Happy coding.
Robots module
-------------
The `armarx_robots` module is an easy and convient way to control a robot.
.. highlight:: python
.. code-block:: python
from armarx_robots import A6
# we use the ARMAR-6 robot
robot = A6()
# use the text-to-speech system to say something
robot.say('Hello World')
# look at a specific target, i.e. in front of the robot
from armarx import FramedPositionBase
position = FramedPositionBase(0, 1000, 1650, frame='root', agent='Armar6'))
robot.gaze.fixate(position)
# close both hands
robot.close_hand('both')
robot.say('Here it is.')
#execute the handover action.
robot.handover()
Indices and tables
==================
......
from 🤖 import armarx as ❤
**************************
Welcome to armarx python binding's documentation. Grab the latest version with
:ref:`Installation` and then get an overview with the :ref:`Quickstart`
If you are looking for information on a specific function checkout the API :ref:`API Reference`.
.. image:: _static/war-machine.jpg
:scale: 50 %
:alt: ArmarX Python bindings
:align: center
User's Guide
============
Checkout section :ref:`Quickstart` for a quick introduction. For more detailed
instructions on the installation see section :ref:`Installation`. The ArmarX
Python bindings share some configuration with the statecharts. Section
:ref:`Configuration` gives more details. :ref:`Examples` lists some examples.
Quickstart
----------
Grab the latest version with `poetry add armarx` or `pip install armarx`.
To access a proxy via ice you can load the interface with the import keyword.
For convenience, functions such as `get_proxy` are automatically injected with
default parameters.
.. highlight:: python
.. code-block:: python
from armax import PlatformNavigatorPrx
platform_navigator = PlatformNavigatorPrx.get_proxy()
platform_navigator.movePlatform(6000, -7300, 2.2)
That's it. Happy coding.
Robots module
-------------
The `armarx_robots` module is an easy and convient way to control a robot.
.. highlight:: python
.. code-block:: python
from armarx_robots import A6
# we use the ARMAR-6 robot
robot = A6()
# use the text-to-speech system to say something
robot.say('Hello World')
# look at a specific target, i.e. in front of the robot
from armarx import FramedPositionBase
position = FramedPositionBase(0, 1000, 1650, frame='root', agent='Armar6'))
robot.gaze.fixate(position)
# close both hands
robot.close_hand('both')
robot.say('Here it is.')
#execute the handover action.
robot.handover()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment