opsoro.module

class opsoro.module.Module(data=None)[source]

Bases: object

__init__(data=None)[source]

Module default class. Custom modules should inherit this class and can override functions.

Parameters:data (dict) – configuration data to setup the module
alive_trigger(count_seed=1)[source]

This is triggered frequently, when the aliveness is turned on.

Parameters:count_seed (float) – seed value for randomization
Returns:True if the module updated something
Return type:bool
apply_poly(r, phi, anim_time=-1)[source]

Apply poly values r and phi to the module and calculate dof values

Parameters:
  • r (float) – r radius value
  • phi (float) – phi angle value
  • anim_time (int) – animation time in ms
load_module(data)[source]

Setup modules with given configuration data

Parameters:data (dict) – configuration data to setup the module
set_dof(tags=[], value=0, anim_time=-1)[source]

Set the value of a dof with the given tags. If no tags are provided, all dofs are set with the given value.

Parameters:
  • tags (list) – name of the DOF
  • value (float) – value to set the DOF
  • anim_time (int) – animation time in ms
set_dof_value(dof_name, value, anim_time=-1)[source]

Set the value of a dof with the given name. If no name is provided, all dofs are set with the given value.

Parameters:
  • dof_name (string) – name of the DOF
  • value (float) – value to set the DOF
  • anim_time (int) – animation time in ms
update()[source]

Update all dof values of this module and return if the update changed a dof.

Returns:True if a dof has been updated
Return type:bool
opsoro.module.constrain(n, minn, maxn)[source]

opsoro.module.eye

class opsoro.module.eye.Eye(data=None)[source]

Bases: opsoro.module.Module

__init__(data=None)[source]

Eye module class inherits default module class.

Parameters:data (dict) – configuration data to setup the module
alive_trigger(count_seed)[source]

This is triggered frequently, when the aliveness is turned on.

Parameters:count_seed (float) – seed value for randomization
Returns:True if the module updated something
Return type:bool

Triggers the eye to blink

Parameters:anim_time (float) – animation time to perform the blinking action
Returns:True if the module updated something
Return type:bool
look(x=0, y=0, z=0)[source]

Look function to make the eye look at some point in space.

Parameters:
  • x (float) – x position / horizontal
  • y (float) – y position / vertical
  • z (float) – z position / depth
Returns:

True if the module updated something

Return type:

bool

opsoro.module.eyebrow

class opsoro.module.eyebrow.Eyebrow(data=None)[source]

Bases: opsoro.module.Module

opsoro.module.mouth

class opsoro.module.mouth.Mouth(data=None)[source]

Bases: opsoro.module.Module

opsoro.module.turn

class opsoro.module.turn.Turn(data=None)[source]

Bases: opsoro.module.Module