Internal Modules¶
- opsoro.apps
- opsoro.dof
- opsoro.dof.servo
- opsoro.hardware
- opsoro.hardware.analog
- opsoro.hardware.capacitive
- opsoro.hardware.dummy_spidev
- opsoro.hardware.i2c
- opsoro.hardware.neopixel
- opsoro.hardware.servo
- opsoro.hardware.spi
- opsoro.hardware.usb_serial
- opsoro.module
- opsoro.module.eye
- opsoro.module.eyebrow
- opsoro.module.mouth
- opsoro.module.turn
- opsoro.preferences
- opsoro.server
- opsoro.server.request_handlers
- opsoro.server.request_handlers.opsoro_data_requests
- opsoro.sound
- opsoro.sound.tts
opsoro.animate¶
This module defines the interface for animating an expression.
-
class
opsoro.animate.
Animate
(times, values)[source]¶ Bases:
object
-
__init__
(times, values)[source]¶ Class to facilitate the tweening of values in time. The animation starts when the object is created. Once ended, the call method will return the last item in values.
Parameters: - times (list) – A list of timestamps in seconds, in increasing order. Timestamp 0 is the moment the Animate object was created.
- values (list) – A list of numerical values associated with timestamps. First element should be 0.
-
-
class
opsoro.animate.
Animate
(times, values)[source] Bases:
object
-
__init__
(times, values)[source] Class to facilitate the tweening of values in time. The animation starts when the object is created. Once ended, the call method will return the last item in values.
Parameters: - times (list) – A list of timestamps in seconds, in increasing order. Timestamp 0 is the moment the Animate object was created.
- values (list) – A list of numerical values associated with timestamps. First element should be 0.
-
has_ended
()[source] Returns true if the animation has ended.
-
-
class
opsoro.animate.
AnimatePeriodic
(times, values)[source]¶ Bases:
object
-
__init__
(times, values)[source]¶ Class to facilitate the tweening of values in time. The animation starts when the object is created. This class is a variant of the Animate class that does not end, but instead repeats its pattern indefinitely.
Parameters: - times (list) – A list of timestamps in seconds, in increasing order. Timestamp 0 is the moment the Animate object was created.
- values (list) – A list of numerical values associated with timestamps. First element should be 0.
-
opsoro.console_msg¶
opsoro.expression¶
This module defines the interface for communicating with the expression.
-
class
opsoro.expression.
_Expression
[source]¶ Bases:
object
-
get_emotion_complex
()[source]¶ Returns current emotion as a complex number
Returns: current emotion Return type: complex
-
load_config
(file_name='robot_expressions.conf')[source]¶ Load expressions from a expressions configurations file
Parameters: file_name (string) – name of the config file Returns: True if file is successfully loaded Return type: bool
-
save_config
(file_name='robot_expressions.conf')[source]¶ Save the current expressions configurations
Parameters: file_name (string) – name of the config file Returns: True if file is successfully saved Return type: bool
-
set_emotion_e
(e=0j, anim_time=-1)[source]¶ Set an emotion with complex number e, within a certain time.
Parameters: - e (complex) – complex number e
- anim_time (float) – time to set the emotion
-
set_emotion_icon
(icon, anim_time=-1)[source]¶ Set an emotion with icon if defined in expression list, within a certain time.
Parameters: - icon (string) – name of the icon to set
- anim_time (float) – time to set the emotion
-
set_emotion_index
(index, anim_time=-1)[source]¶ Set an emotion with index in defined expression list, within a certain time.
Parameters: - index (integer) – index of the emotion in the list of emotions
- anim_time (float) – time to set the emotion
-
set_emotion_name
(name, anim_time=-1)[source]¶ Set an emotion with name if defined in expression list, within a certain time.
Parameters: - name (string) – name of the emotion to set
- anim_time (float) – time to set the emotion
-
set_emotion_r_phi
(r, phi, degrees=False, anim_time=-1)[source]¶ Set an emotion with r and phi, within a certain time.
Parameters: - r (float) – radius of the circumplex
- phi (float) – angle of the circumplex
- degrees (bool) – is convertion to radians needed?
- anim_time (float) – time to set the emotion
-
set_emotion_random
(all_random=True, anim_time=-1)[source]¶ Set an emotion with random index in defined expression list, within a certain time. Or set all dofs to a random position between -1 and 1.
Parameters: - all_random (bool) – all dofs random or not
- anim_time (float) – time to set the emotion
-
opsoro.robot¶
This module defines the interface for communicating with the robot.