pupil_recording_interface.MotionStream

class pupil_recording_interface.MotionStream(device, motion_type, pipeline=None, name=None)

Bases: pupil_recording_interface.stream.BaseStream

Motion data stream.

__init__(device, motion_type, pipeline=None, name=None)

Constructor.

Parameters
  • device (BaseDevice) – The device producing the stream.

  • motion_type (str) – The type of motion streamed by the device. Can be “odometry”, “accel” or “gyro”.

  • name (str, optional) – The name of the stream. If not specified, motion_type will be used.

Methods

Config(*args, **kwargs)

Configuration for this class.

__init__(device, motion_type[, pipeline, name])

Constructor.

from_config(config[, device, folder])

Create a stream from a StreamConfig.

get_packet()

Get the last data packet from the stream.

get_status([packet])

Get information about the stream status.

run()

Main loop.

run_in_thread([stop_event, status_queue, …])

Main loop for running in a dedicated thread.

run_post_thread_hooks()

Run hook(s) after processing thread(s) finish(es).

run_pre_thread_hooks()

Run hook(s) before dispatching processing thread(s).

start([allow_failure])

Start the stream.

stop()

Stop the stream.

Attributes

current_fps

Current average fps.

listen_for

stream_type

classmethod Config(*args, **kwargs)

Configuration for this class.

property current_fps

Current average fps.

classmethod from_config(config, device=None, folder=None)

Create a stream from a StreamConfig.

get_packet()

Get the last data packet from the stream.

get_status(packet=None)

Get information about the stream status.

run()

Main loop.

run_in_thread(stop_event=None, status_queue=None, notification_queue=None, priority_queue=None)

Main loop for running in a dedicated thread.

Parameters
  • stop_event (multiprocessing.Event, optional) – An event that stops the stream in a multi-threaded setting.

  • status_queue (thread safe deque, optional) – A queue for the current status in a multi-threaded setting.

  • notification_queue (thread safe deque, optional) – A queue for incoming notifications in a multi-threaded setting.

  • priority_queue (thread safe deque, optional) – A queue for incoming priority notifications in a multi-threaded setting.

run_post_thread_hooks()

Run hook(s) after processing thread(s) finish(es).

run_pre_thread_hooks()

Run hook(s) before dispatching processing thread(s).

start(allow_failure=False)

Start the stream.

stop()

Stop the stream.