.. _auto_recording:
Automatic Recording
===================
The automatic recording component is a state-machine based process
that triggers the :ref:`record_server` component based on activity found in the
:ref:`situation_recognition` by the following rules: If there is (human)
movement, the recording is started. Only if no movement can be observed anymore,
a cooldown phase of 15 minutes is started where the recording is still active.
After cooldown, the recording process is stopped. This way, the recording starts
as soon as someone enters the apartment keeps running at least 15 minutes after
the last movement has been observed.
Automatic recording can be suspended, i.e. prevented from starting and paused
if running by using buttons in the apartment (`Button Control Interface`_) or
via rsb (`RSB Control Interface`_).
The current state of the recording is displayed via an `Ambient Status Interface`_
and `Verbal Output`_ in the control room.
Related resources
-----------------
The automatic recording (historically) shares a repository with the
:ref:`scenario_coordination`. As they both are SCXML state-machines, they are
started with the same executable and vdemo component but with a different
(xml) configuration file. Furthermore, they share the same visualization, called
:ref:`state_engine_viewer`.
Component repository:
- Browse component repository: `scenario-coordination-cfg `_.
- ``git clone https://projects.cit-ec.uni-bielefeld.de/git/lsp-csra.scenario-coordination-cfg.git/``
System startup:
- The ``auto-record`` component can be found in ``lsp-csra-base.sh`` on the ``base`` tab.
- The component script is called ``component_engine-runner``
Related projects:
- Browse repository `system-startup `_.
- Browse IDE project `rsb-dsl `_.
Ambient Status Interface
------------------------
The current recording status is displayed in two locations in the apartment: The control room ambient light, and
the first light bulb of the living room lamp next to the 4k screen at the sports door. If nothing is being recorded
at the moment, the light is switched off accordingly. Otherwise, a red color indicates recording and shades of blue/purple
an suspended state.
+-------------------------------------------+------------------------------------------------------+--------------------------------------------------------+
| Recording active | Suspended (with movement) | Suspended (no movement) |
+===========================================+======================================================+========================================================+
| Control room |
+-------------------------------------------+------------------------------------------------------+--------------------------------------------------------+
|.. image:: /images/recording/ghost.jpg |.. image:: /images/recording/ghost-sus-active.jpg |.. image:: /images/recording/ghost-sus-inactive.jpg |
| :width: 150px | :width: 150px | :width: 150px |
+-------------------------------------------+------------------------------------------------------+--------------------------------------------------------+
| Living room |
+-------------------------------------------+------------------------------------------------------+--------------------------------------------------------+
|.. image:: /images/recording/minighost.jpg |.. image:: /images/recording/minighost-sus-active.jpg |.. image:: /images/recording/minighost-sus-inactive.jpg |
| :width: 150px | :width: 150px | :width: 150px |
+-------------------------------------------+------------------------------------------------------+--------------------------------------------------------+
Verbal Output
-------------
.. _TaskState: http://docs.cor-lab.de//rst-manual/trunk/html/generated/stable/package-rst-communicationpatterns.html#rst.communicationpatterns.TaskState
Verbal feedback is given via the :ref:`speech_synthesis` in the control room.
For that purpose, the automatic recording component sends `TaskState`_ objects
to the scope ``/home/control/saytask/SAY`` everytime the recording process is
(re-)started, stopped, or suspended.
Button Control Interface
------------------------
You can press the two topmost buttons right next to the living room's
`Ambient Status Interface`_ to suspend or resume the recording process (at the
sports door).
.. image:: /images/recording/recordpanel.jpg
:scale: 25 %
:alt: Control room light signaling active recording
RSB Control Interface
---------------------
As the automatic recording listens to the following scopes, you can also send
rsb events to suspend or resume the recording process:
============================= ====
Scope (Listener) Type
============================= ====
``/state/recording/suspend`` void
``/state/recording/resume`` void
============================= ====
RSB Output Interface
--------------------
The recording component triggers the :ref:`record_server` with all of the
following methods:
================================== ================ ================
Scope (Local Server) + Method Argument Type Return Type
================================== ================ ================
``/logger/rsbag/all/open()`` String: filename void
``/logger/rsbag/all/start()`` void void
``/logger/rsbag/all/isstarted()`` void bool: recording?
``/logger/rsbag/all/stop()`` void void
``/logger/rsbag/all/close()`` void void
================================== ================ ================
Examples
--------------
Suspend and resume recording via command line:
.. code-block:: bash
tools0.12 send '""' /state/recording/suspend
# discuss secret things
tools0.12 send '""' /state/recording/resume
or simply:
.. code-block:: bash
rsb-send /state/recording/suspend
# discuss secret things
rsb-send /state/recording/resume