Mocap controller
================


**Controller for the motion of the human avatar, using the                    ASUS Xtion**


Read the positions of the different joints at:
head, neck, shoulders, torso, elbows, hands, hips, knees and feet
And apply those positions to the control points (Empty's) of the armature


.. cssclass:: properties morse-section

Configuration parameters for mocap controller
---------------------------------------------

*No configurable parameter.*

.. cssclass:: fields morse-section

Data fields
-----------


This actuator reads these datafields at each simulation step:

- ``head_position`` (vec3<float>, initial value: ``[0.0, 0.0, 0.0]``)
	Head position
- ``neck_position`` (vec3<float>, initial value: ``[0.0, 0.0, 0.0]``)
	Neck position
- ``left_hand_position`` (vec3<float>, initial value: ``[0.0, 0.0, 0.0]``)
	Left Hand position
- ``right_hand_position`` (vec3<float>, initial value: ``[0.0, 0.0, 0.0]``)
	Right Hand position
- ``left_elbow_position`` (vec3<float>, initial value: ``[0.0, 0.0, 0.0]``)
	Left elbow position
- ``right_elbow_position`` (vec3<float>, initial value: ``[0.0, 0.0, 0.0]``)
	Right elbow position
- ``left_shoulder_position`` (vec3<float>, initial value: ``[0.0, 0.0, 0.0]``)
	Left shoulder position
- ``right_shoulder_position`` (vec3<float>, initial value: ``[0.0, 0.0, 0.0]``)
	Right shoulder position
- ``left_hip_position`` (vec3<float>, initial value: ``[0.0, 0.0, 0.0]``)
	Left hip position
- ``right_hip_position`` (vec3<float>, initial value: ``[0.0, 0.0, 0.0]``)
	Right hip position
- ``left_foot_position`` (vec3<float>, initial value: ``[0.0, 0.0, 0.0]``)
	Left foot position
- ``right_foot_position`` (vec3<float>, initial value: ``[0.0, 0.0, 0.0]``)
	Right foot position
- ``torso_position`` (vec3<float>, initial value: ``[0.0, 0.0, 0.0]``)
	torso position
- ``left_knee_position`` (vec3<float>, initial value: ``[0.0, 0.0, 0.0]``)
	left knee position
- ``right_knee_position`` (vec3<float>, initial value: ``[0.0, 0.0, 0.0]``)
	right knee position

*Interface support:*

- :tag:`pocolibs`  as `NIUT_HUMAN_LIST <http://trac.laas.fr/git/niut-genom/tree/niutStruct.h#n82>`_ (:py:mod:`morse.middleware.pocolibs.actuators.niut.NiutPoster`)


.. cssclass:: services morse-section

Services for Mocap controller
-----------------------------

- ``get_properties()`` (blocking)
    Returns the properties of a component.
    
    
  - Return value

    a dictionary of the current component's properties  

- ``get_configurations()`` (blocking)
    Returns the configurations of a component (parsed from the properties).
    
    
  - Return value

    a dictionary of the current component's configurations  



.. cssclass:: examples morse-section

Examples
--------


The following examples show how to use this component in a *Builder* script:

.. code-block:: python


    from morse.builder import *
    
    robot = ATRV()
    
    # creates a new instance of the actuator
    mocapcontrol = MocapControl()

    # place your component at the correct location
    mocapcontrol.translate(<x>, <y>, <z>)
    mocapcontrol.rotate(<rx>, <ry>, <rz>)
    
    robot.append(mocapcontrol)
    
    # define one or several communication interface, like 'socket'
    mocapcontrol.add_interface(<interface>)

    env = Environment('empty')
    

.. cssclass:: files morse-section

Other sources of examples
+++++++++++++++++++++++++

- `Source code <../../_modules/morse/actuators/mocap_control.html>`_
- `Unit-test <../../_modules/base/mocap_control_testing.html>`_




*(This page has been auto-generated from MORSE module morse.actuators.mocap_control.)*
