NetFT

Documentation Status PyPI

Please Note:

This project has moved to `GitHub <https://github.com/CameronDevine/NetFT>`_. All future work will be stored there.

Introduction

This is a Python API for RDT communication with ATI Force/Torque sensors using Net-F/T interface boxes. This library supports requesting single measurements, streaming measurements, and taring the sensor.

Installation

This package can be installed using pip install NetFT. The current development version can be installed by cloning the git repository and running python setup.py install.

Use

A command line interface is included with the package. It can be run by simply typing NetFT in a terminal. The documentation for this can be viewed by running NetFT --help.

Documentation

class NetFT.Sensor(ip)[source]

The class interface for an ATI Force/Torque sensor.

This class contains all the functions necessary to communicate with an ATI Force/Torque sensor with a Net F/T interface using RDT.

force()[source]

Get the most recent force measurement

Returns:The force values received.
Return type:list of float
getForce()[source]

Get a single force measurement from the sensor

Request a single measurement from the sensor and return it.

Returns:The force values received.
Return type:list of float
getMeasurement()[source]

Get a single measurement from the sensor

Request a single measurement from the sensor and return it. If The sensor is currently streaming, started by running startStreaming, then this function will simply return the most recently returned value.

Returns:
The force and torque values received. The first three
values are the forces recorded, and the last three are the measured torques.
Return type:list of float
getMeasurements(n)[source]

Request a given number of samples from the sensor

This function requests a given number of samples from the sensor. These measurements must be received manually using the receive function.

Parameters:n (int) – The number of samples to request.
getTorque()[source]

Get a single torque measurement from the sensor

Request a single measurement from the sensor and return it.

Returns:The torque values received.
Return type:list of float
measurement()[source]

Get the most recent force/torque measurement

Returns:
The force and torque values received. The first three
values are the forces recorded, and the last three are the measured torques.
Return type:list of float
receive()[source]

Receives and unpacks a response from the Net F/T box.

This function receives and unpacks an RDT response from the Net F/T box and saves it to the data class attribute.

Returns:
The force and torque values received. The first three
values are the forces recorded, and the last three are the measured torques.
Return type:list of float
receiveHandler()[source]

A handler to receive and store data.

send(command, count=0)[source]

Send a given command to the Net F/T box with specified sample count.

This function sends the given RDT command to the Net F/T box, along with the specified sample count, if needed.

Parameters:
  • command (int) – The RDT command.
  • count (int, optional) – The sample count to send. Defaults to 0.
startStreaming(handler=True)[source]

Start streaming data continuously

This function commands the Net F/T box to start sending data continuously. By default this also starts a new thread with a handler to save all data points coming in. These data points can still be accessed with measurement, force, and torque. This handler can also be disabled and measurements can be received manually using the receive function.

Parameters:handler (bool, optional) – If True start the handler which saves data to be used with measurement, force, and torque. If False the measurements must be received manually. Defaults to True.
stopStreaming()[source]

Stop streaming data continuously

This function stops the sensor from streaming continuously as started using startStreaming.

tare(n=10)[source]

Tare the sensor.

This function takes a given number of readings from the sensor and averages them. This mean is then stored and subtracted from all future measurements.

Parameters:n (int, optional) – The number of samples to use in the mean. Defaults to 10.
Returns:The mean values calculated.
Return type:list of float
torque()[source]

Get the most recent torque measurement

Returns:The torque values received.
Return type:list of float
zero()[source]

Remove the mean found with tare to start receiving raw sensor values.