
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "examples/data_collection/emg_record.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_examples_data_collection_emg_record.py>`
        to download the full example code

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_examples_data_collection_emg_record.py:


Delsys EMG Record
=================

This example shows how to record EMG data via Delsys Trigno Control Utility.

.. GENERATED FROM PYTHON SOURCE LINES 7-27

.. code-block:: default


    import argparse
    from datetime import datetime

    import rofunc as rf

    parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawTextHelpFormatter)
    parser.add_argument(
        '-a', '--addr',
        dest='host',
        default='10.13.162.196',
        help="IP address of the machine running TCU. Default is localhost.")
    args = parser.parse_args()

    root_dir = '/home/ubuntu/Data/emg_record/20230306'
    exp_name = datetime.now().strftime('%Y%m%d_%H%M%S')
    rf.oslab.create_dir(root_dir)

    # For instance, 6 channels, 2000 samples per second and 30 seconds are chosen.
    rf.emg.record(args.host, 6, 2000, 40, root_dir, exp_name)


.. rst-class:: sphx-glr-timing

   **Total running time of the script:** (0 minutes 0.000 seconds)


.. _sphx_glr_download_examples_data_collection_emg_record.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example




    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: emg_record.py <emg_record.py>`

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: emg_record.ipynb <emg_record.ipynb>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
