HBRS-SDP / ss24-physiological-computing

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

🌟 HRI Physio Library 🌟

Last Updated: Sept 15, 2024

πŸ“œ Table of Contents


πŸ“˜ Introduction

Welcome to HriPhysioLib! πŸŽ‰ This library is designed for researchers in Human-Robot Interaction (HRI), specifically tailored for physiological signal processing. Whether you're analyzing ECG data 🩺 or synchronizing robotic systems with physiological inputs πŸ€–, this library provides the tools to make that happen seamlessly!

With support for Lab Streaming Layer (LSL) and Robot Operating System (ROS), and advanced signal processing techniques like bi-quadratic filtering and the Hilbert Transform, it's ideal for cutting-edge research in physiological data analysis.

Let’s dive into the details!


🧩 Library Components

πŸ“¦ External Libraries

HriPhysioLib integrates external submodules to extend its functionality. These are:

πŸ“‚ Source Modules

The source folder is divided into several modules, each with a specific role:

πŸ› οΈ Core

The Core module provides essential data structures. The key component here is the Ring Buffer, a circular structure used for managing physiological data streams in FIFO (First In, First Out) order.

πŸ”§ Manager

The Manager module handles the coordination between robotic systems πŸ€– and physiological data. It includes multithreading for efficient, real-time operations.

πŸ€– Social

The Social module is all about integrating robots with the outside world using physiological signals to drive behaviors πŸšΆβ€β™‚οΈβ†’πŸ€–.

πŸ”¬ Processing

This is where the magic of transforming raw data into something meaningful happens! πŸ§™β€β™‚οΈ The Processing module includes:

πŸ’Ύ Stream

The Stream module manages data flow from external sources to the processing pipeline πŸ“Š.

βš™οΈ Utilities

The Utilities module offers various helper tools to smooth your workflow πŸ› οΈ.

πŸ§ͺ Tests

The Tests module is vital for ensuring all the core functionalities work as intended. βœ”οΈ

Certainly! Here’s the updated Tests section with the details you provided about the test cases and how to run them.


πŸ§ͺ Tests

The Tests module includes comprehensive test suites to verify the core functionalities of the library. These tests ensure that critical components, such as the RingBuffer and the HilbertTransform, behave as expected in various scenarios.

Test Suites and Cases

πŸ“¦ Ring Buffer Test Suite

The RingBuffer test suite ensures that the circular buffer, essential for streaming continuous physiological data, operates correctly.

🧠 HilbertTransform Test Suite

This test suite ensures the HilbertTransform class, responsible for signal processing, works as expected across different use cases.


πŸ”§ Running the Tests

To build and run the test suite, follow these steps:

# Create a build directory and navigate into it
mkdir build && cd build

# Generate the build system files
cmake ..

# Build the tests
make

# Run the test suite
./run-tests.sh

This will execute all the test cases and display the results in the terminal.


πŸ–₯️ CLI Testing

The CLI testing framework πŸ–₯️ allows you to test the library’s functionality directly from the command line, focusing on the Hilbert Transform application on ECG data generated using the NeuroKit library.

Key Features:

Key features of the cli testing setup:

The cli folder contains a simple test program (main.cpp) that executes the entire process. This setup allows researchers and developers to verify the processing functions of the library before integrating it into larger systems. However, it does not utilize the full functionality of the library, such as streaming protocols or robotic control.

For more detailed instructions on using the example, visit the Instructions.

πŸš€ Getting Started

πŸ’» Installation

There are two methods to install HriPhysioLib:

πŸ” Method 1: Recursive Git Clone

This method automatically pulls the external submodules for you.

git clone --recursive https://github.com/HBRS-SDP/ss24-physiological-computing.git
cd hri-physio/HriPhysioLib

Then, to build and test the library, simply use:

make build-library
make run-library-tests
make run-cli

πŸ”§ Method 2: Manual Git Clone and Adding Submodules

Alternatively, if you prefer manual control over submodules, follow these steps:

git clone https://github.com/HBRS-SDP/ss24-physiological-computing.git
cd hri-physio/HriPhysioLib

Next, initialize and update the submodules:

git submodule init
git submodule update

Then, use the same Makefile commands as in Method 1 to build and run tests:

make build-library
make run-library-tests
make run-cli

πŸ–₯️ Tested and Verified On


πŸ‘₯ Contributors

Big thanks to our amazing contributors who made HriPhysioLib possible! πŸ™Œ


πŸ“„ License

HriPhysioLib is licensed under the MIT License πŸ“œ. For more details, please visit the GitHub Repository.


Enjoy exploring the world of Human-Robot Interaction with physiological data! πŸ§ πŸ€–