Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Python3 ArmarX
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
ArmarX
Python3 ArmarX
Commits
cdc79c74
Commit
cdc79c74
authored
2 years ago
by
Markus Grotz
Browse files
Options
Downloads
Patches
Plain Diff
update doc
parent
d7cf8a79
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
docs/api.rst
+1
-4
1 addition, 4 deletions
docs/api.rst
docs/examples.rst
+57
-2
57 additions, 2 deletions
docs/examples.rst
docs/index.rst
+1
-66
1 addition, 66 deletions
docs/index.rst
docs/users_guide.rst
+69
-0
69 additions, 0 deletions
docs/users_guide.rst
with
128 additions
and
72 deletions
docs/api.rst
+
1
−
4
View file @
cdc79c74
API Reference
==============
If you are looking for information on a specific function.
*************
API Reference for Robot Module
==============================
...
...
This diff is collapsed.
Click to expand it.
docs/examples.rst
+
57
−
2
View file @
cdc79c74
...
...
@@ -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()
This diff is collapsed.
Click to expand it.
docs/index.rst
+
1
−
66
View file @
cdc79c74
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
==================
...
...
This diff is collapsed.
Click to expand it.
docs/users_guide.rst
0 → 100644
+
69
−
0
View file @
cdc79c74
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()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment