{
 "cells": [
  {
   "cell_type": "raw",
   "metadata": {},
   "source": [
    "---\n",
    "description: An efficient neural network for real-time attitude estimation using IMU\n",
    "  data.\n",
    "output-file: index.html\n",
    "title: RIANN (Robust IMU-based Attitude Neural Network)\n",
    "\n",
    "---\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "language": "python"
   },
   "outputs": [],
   "source": [
    "#hide\n",
    "from riann.riann import *"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## What is RIANN?\n",
    "\n",
    "RIANN is a lightweight neural network implementation for estimating orientation (attitude) from inertial measurement unit (IMU) data. It processes accelerometer and gyroscope readings to provide quaternion-based attitude estimation, optimized for real-time applications."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Key Features\n",
    "\n",
    "- Fast and accurate quaternion-based attitude estimation\n",
    "- Optimized for real-time processing with state preservation\n",
    "- Supports both batch processing and step-by-step integration\n",
    "- Robust against sensor noise and motion artifacts\n",
    "- Simple Python API with minimal dependencies"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Installation"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```bash\n",
    "pip install riann"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "or from source"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```bash\n",
    "git clone https://github.com/daniel-om-weber/riann.git\n",
    "cd riann\n",
    "pip install -e ."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Quickstart"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "language": "python"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Output shape: (100, 4)\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "from riann.riann import RIANN\n",
    "\n",
    "# Initialize RIANN\n",
    "riann = RIANN()\n",
    "\n",
    "# Prepare IMU data\n",
    "acc = np.ones((100, 3))  # Accelerometer data (100 samples, XYZ axes)\n",
    "gyr = np.zeros((100, 3)) # Gyroscope data (100 samples, XYZ axes)\n",
    "fs = 200                 # Sampling rate in Hz\n",
    "\n",
    "# Get attitude quaternions\n",
    "attitude = riann.predict(acc, gyr, fs)\n",
    "print(f\"Output shape: {attitude.shape}\")  # (100, 4) - 100 quaternions"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "python3",
   "language": "python",
   "name": "python3"
  },
  "widgets": {
   "application/vnd.jupyter.widget-state+json": {
    "state": {},
    "version_major": 2,
    "version_minor": 0
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
