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

Configuration parameters for Mocap controller

No configurable parameter.

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:

Services for Mocap controller

  • get_properties() (blocking)

    Returns the properties of a component.

    • Return value

      a dictionary of the current component’s properties

  • set_property(prop_name, prop_val) (blocking)

    Modify one property on a component

    • Parameters

      • prop_name: the name of the property to modify (as shown the documentation)
      • prop_val: the new value of the property. Note that there is no checking about the type of the value so be careful
    • Return value

      nothing

  • get_configurations() (blocking)

    Returns the configurations of a component (parsed from the properties).

    • Return value

      a dictionary of the current component’s configurations

Examples

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

from morse.builder import *

# adds a default robot (the MORSE mascott!)
robot = Morsy()

# 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')

Other sources of examples

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

Table Of Contents

Previous topic

Light

Next topic

Orientation Actuator

This Page