BRML Drivers


BioTac SP driver

This driver reads samples of tactile data from a Syntouch BioTac SP sensor conntected to the PC using a Cheetah SPI/USB adapter.

Currently only reading out a single Biotac sensor is supported.

This driver implements the sensor interface of the generic data recorder and thus a driver instance can be passed directly to the recorder as a sensor.

Installation

Make sure that the system driver for the Cheetah SPI/USB adapter is properly installed.

Driver configuration

Instantiating the driver requires providing a configuration record of type BRML.Drivers.BioTacCfgT.

1: 
2: 
3: 
4: 
5: 
6: 
open BRML.Drivers

let cfg : BioTacCfgT = {
    Cheetah        = uint32 1364033083   // adjust
    Index          = 0                   // adjust
}

Cheetah is the unique id (UID) of the Cheetah SPI/USB adapter the BioTac sensor is connected to. Index is the port the BioTac sensor is connected to on the multiplexer board. It can be 0, 1 or 2.

Driver instance

We can now instantiate the driver.

1: 
let biotac = new BiotacT (cfg)

After power on and initialization the driver starts to stream samples from the BioTac sensor at the highest possible sampling rate.

Reading the latest sensor sample

The latest acquired sample is available in the biotac.CurrentSample property.

1: 
let cs = biotac.CurrentSample

If you intend to do machine learning with the tactile sensor data, you are probably interested in the flat sensor data. It is available in the cs.Flat field.

1: 
printfn "Current sensor data:\n%A" cs.Flat

Event-based sample acquisition

The driver also provides an event-based interface to obtain samples. Subscribe to the biotac.SampleAcquired event and you will be notified for each newly acquired sample. This is the recommended method of processing the sample stream.

1: 
2: 
biotac.SampleAcquired.Add (fun smpl ->
    printfn "Acquired sensor sample:\n%A" smpl.Flat)

This code will automatically print each new sample as it is acquired.

Disposing

Dispose the driver instance after usage.

1: 
biotac.Dispose ()

This will turn off power to the sensor and release the Cheetah SPI/USB adapter.

val cfg : obj

Full name: Biotac.cfg
Multiple items
val uint32 : value:'T -> uint32 (requires member op_Explicit)

Full name: Microsoft.FSharp.Core.Operators.uint32

--------------------
type uint32 = System.UInt32

Full name: Microsoft.FSharp.Core.uint32
val biotac : obj

Full name: Biotac.biotac
val cs : obj

Full name: Biotac.cs
val printfn : format:Printf.TextWriterFormat<'T> -> 'T

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printfn
namespace System
namespace System.Threading
Multiple items
type Thread =
  inherit CriticalFinalizerObject
  new : start:ThreadStart -> Thread + 3 overloads
  member Abort : unit -> unit + 1 overload
  member ApartmentState : ApartmentState with get, set
  member CurrentCulture : CultureInfo with get, set
  member CurrentUICulture : CultureInfo with get, set
  member DisableComObjectEagerCleanup : unit -> unit
  member ExecutionContext : ExecutionContext
  member GetApartmentState : unit -> ApartmentState
  member GetCompressedStack : unit -> CompressedStack
  member GetHashCode : unit -> int
  ...

Full name: System.Threading.Thread

--------------------
System.Threading.Thread(start: System.Threading.ThreadStart) : unit
System.Threading.Thread(start: System.Threading.ParameterizedThreadStart) : unit
System.Threading.Thread(start: System.Threading.ThreadStart, maxStackSize: int) : unit
System.Threading.Thread(start: System.Threading.ParameterizedThreadStart, maxStackSize: int) : unit
System.Threading.Thread.Sleep(timeout: System.TimeSpan) : unit
System.Threading.Thread.Sleep(millisecondsTimeout: int) : unit
Fork me on GitHub