timeflux_amti.nodes.driver module

Timeflux AMTI driver node

Use this node to acquire data from a AMTI force device.

class timeflux_amti.nodes.driver.ForceDriver(rate=500, dll_dir=None, device_index=0, zero_trigger=None, event_label='label')[source]

Bases: timeflux.core.node.Node

Acquisition driver for the AMTI force platform.

This node uses the AMTI USB Device SDK version 1.3.00 to communicate with an AMTI AccuGait Optimized (AGO) force platform. All operations are performed through the AMTIUSBDevice.dll provided by AMTI and following the SDK documentation.

Please refer to the SDK documentation for more details on how the force platform is configured and used. This class implements a single use-case (but can be extended if needed), which corresponds to:

  • 6+2 channels (three force, three moments, sample count and trigger).

  • Fully conditioned mode (see section 21 of SDK).

  • No genlock feature used (when an input port is used to synchronise and trigger a sample of the signal).

The output of this node is a dataframe with 8 columns, representing the following channels: sample counter, three force values in x, y and z axis, three momentum values in x, y and z axis, and a trigger channel. Force and momentum are in SI units (newton and newton-meters, respectively). The output dataframe index are timestamps, calculated from the sample number. In other words, this node trusts the time management of the underlying AMTI DLL.

Parameters
  • rate (int) – Sampling rate in Hz. It must be one of the supported frequencies as listed in SAMPLING_RATES. Defaults to 500 Hz.

  • dll_dir (str) – Directory where the DLL file AMTIUSBDevice.dll will be searched and loaded. By default, it uses the DLL directory included in the timeflux_amti package.

  • device_index (int) – Device number to read. AMTI supports several chained devices, but this has not been tested in timeflux_amti. Use the default, 0.

  • zero_trigger (str) – Name of a stimulation event that, when received, will force the device to zero itself, setting the tare value of the force platform.

Variables
  • i (Port) – Default input, listens for a specific event that triggers the device zeroing procedure.

  • o (Port) – Default output, provides a pandas.DataFrame with 8 columns.

Examples

The following YAML pipeline can be used to acquire from the AMTI force platform and print each sample:

graphs:
   - nodes:
     - id: driver
       module: timeflux_amti.nodes.driver
       class: ForceDriver
       params:
         rate: 100

     - id: display
       module: timeflux.nodes.debug
       class: Display

     rate: 20

     edges:
       - source: driver
         target: display

Notes:

Attention

Using a sampling frequency higher than 1000 Hz have been observed to drift significantly. Presumably, these higher frequencies would need the usage of an external trigger (the genlock feature).

Hint

Make sure to use an appropriate rate on the graph that contains this node. The graph rate should be short enough so that the underlying AMTI DLL buffer does not overflow, which will give repeated samples (this will be shown as a warning on the logs). The AMTI DLL buffer can hold about 10000 complete samples. For example, using ForceDriver(rate=1000) and a graph with rate of 0.1 (i.e. one update every 10 seconds), you would be dangerously close to overwriting the AMTI DLL buffer.

Warning

Since this class opens a library (DLL) and the release code is not guaranteed to free the library, using this class a second time on the same Python interpreter will fail with an OSError.

SAMPLING_RATES = (2000, 1800, 1500, 1200, 1000, 900, 800, 600, 500, 450, 400, 360, 300, 250, 240, 225, 200, 180, 150, 125, 120, 100, 90, 80, 75, 60, 50, 45, 40, 30, 25, 20, 15, 10)

Supported sampling rates (in Hz) for the AMTI force platform.

__init__(rate=500, dll_dir=None, device_index=0, zero_trigger=None, event_label='label')[source]

Instantiate the node.

property driver

Property for the ctypes.WinDLL interface driver object

update()[source]

Read samples from the AMTI force platform

terminate()[source]

Release the DLL and internal variables.