Skip to content
This repository was archived by the owner on Jun 15, 2026. It is now read-only.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

anypressure

Python driver and data collection tools for the BMP585 barometric tactile sensor, developed in MSR Robotics. The sensor re-purposes a barometric pressure chip as a tactile sensor for robot grippers.


Building the sensor

Before using the Python driver, complete the following hardware steps:

  1. PCB — Order the sensor breakout and microcontroller shield. See barometer/parts/README.md for Gerber files and JLCPCB ordering instructions.

  2. Casting — Cast the silicone sensor pad using the mold files in barometer/parts/README.md.

  3. Firmware — Upload firmware to the board. See barometer/firmware/README.md for board setup, library installation, and upload instructions.

  4. Gripper mount — 3D-print and assemble the mount for your robot. See barometer/parts/README.md for STL/STEP files and fastener specs.


Install

git clone <repo-url>
cd anypressure/
conda create -n anypressure python=3.10
conda activate anypressure
pip install -e .

Port access (Linux)

If you see a Permission denied error on /dev/ttyACM*, you can grant access one-time with:

sudo chmod 666 /dev/ttyACM0
Persistent fix: udev rules

Create a udev rule so the port is always accessible without sudo, and optionally give it a stable name.

1. Find your device's vendor ID, product ID, and serial number:

# List USB devices — find your board and note the ID (e.g. 239a:800b)
lsusb

# Get full attributes for the connected port
udevadm info -a -n /dev/ttyACM0 | grep -E 'idVendor|idProduct|serial'

2. Create a udev rule — replace XXXX and YYYY with your vendor and product IDs:

sudo nano /etc/udev/rules.d/99-tactile-sensor.rules
SUBSYSTEM=="tty", ATTRS{idVendor}=="XXXX", ATTRS{idProduct}=="YYYY", MODE="0666"

To also match by serial number (useful when using multiple different boards):

SUBSYSTEM=="tty", ATTRS{idVendor}=="XXXX", ATTRS{idProduct}=="YYYY", ATTRS{serial}=="YOUR_SERIAL", MODE="0666"

To also assign a stable symlink (e.g. /dev/tactile0), add SYMLINK+=:

SUBSYSTEM=="tty", ATTRS{idVendor}=="XXXX", ATTRS{idProduct}=="YYYY", ATTRS{serial}=="YOUR_SERIAL", MODE="0666", SYMLINK+="tactile0"

The symlink appears under /dev/tactile0 and can be passed directly to --port /dev/tactile0.

3. Reload and apply:

sudo udevadm control --reload-rules && sudo udevadm trigger

Reconnect the board — the port should now be accessible without sudo.

---

Usage

Live plot

Stream and visualize all sensor channels in real time. Layout is one row per sensor, with pressure and temperature side by side.

# python scripts/live_plot.py --port <port> 
python scripts/live_plot.py --port /dev/ttyACM0

With baseline subtraction — sensor values start at ~0 and reflect change from the resting state:

python scripts/live_plot.py --port /dev/ttyACM0 --baseline

Options:

Flag Default Description
--port required Serial port of the sensor
--baseline off Subtract a resting baseline so readings start at ~0
--window-size 100 Rolling window in samples
--plot-rate 30 Plot update rate in Hz

Keyboard shortcuts while the plot is open:

Key Action
r Reset baseline from current readings
q Close window
h Print shortcuts to console

Collect data

Collect continuous data to a CSV file. Saves to experiment/data/MMDD_<SN>.csv.

python scripts/collect_data.py --port <port> --sn <sn> --duration <min>
python scripts/collect_data.py --port /dev/ttyACM0 --sn V20S5 --duration 10

With baseline subtraction (baseline values written to CSV header so raw signal is always recoverable):

python scripts/collect_data.py --port /dev/ttyACM0 --sn V20S5 --duration 10 --baseline

Options:

Flag Default Description
--port required Serial port of the sensor
--sn required Serial number — used in the output filename
--duration required Collection duration in minutes
--baseline off Subtract resting baseline; baseline values saved to CSV header
--sample-rate 30 Logging rate in Hz (independent of sensor ODR)
--no-plot off Disable the live plot during collection

Press Ctrl+C to stop early — the CSV is flushed and closed cleanly.


Plot collected data

python scripts/plot_data.py experiment/data/MMDD_{SN}.csv

Saves a PNG alongside the CSV. Auto-detects sensor fields from column names.

Options:

Flag Default Description
--show off Open an interactive plot window in addition to saving the PNG
--file Alternative to the positional argument: --file path/to/data.csv

Privacy

Privacy & Cookies

About

CAD, circuit files, firmware, and python class to build anypressure tactile sensors

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages