Skip to content

bertoramos/marvelmind_pylib

Repository files navigation


Logo

marvelmind_pylib

Python binding for Marvelmind C API
Explore the docs »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contact


About The Project

Python binding for Marvelmind C API

(back to top)

Built With

(back to top)

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

Installation

$ python pip install https://github.com/bertoramos/marvelmind_pylib/releases/download/{version}/{so-version-file}.whl

Install from source

Building

Unix

TODO

Windows
  1. Install Visual Studio.

  2. Create a python virtual environment and install pybind11.

    $ conda create --prefix .\.venv python=3.11
    $ conda activate .\.venv
    $ python -m pip install --upgrade pip
    (.\.venv) $ python -m pip install pybind11
  3. Run win_make.bat to build library.

  4. A file with extension .pyd must have been created. You can find it in makefiles/win_build/Release folder.

Installation
  1. Copy the .pyd file inside makefiles/marvelmind_pylib/marvelmind_pylib folder.
  2. Modify version and requires-python parameters pyproject.toml file.
version = "1.0.0"
requires-python = ">=3.11"
  1. Build wheel:
  (.\.venv) $ python -m pip install build
  (.\.venv) $ python -m build
``

4. Install wheel. Inside makefiles/marvelmind_pylib/dist folder you will find the wheel and tar files, ready to be installed.

<p align="right">(<a href="#top">back to top</a>)</p>

<!-- USAGE EXAMPLES -->
## Usage

This is an example of the use of the library.

```python

import marvelmind_pylib

SERIAL_PORT = "COM5"

dev = marvelmind_pylib.MarvelMindDevice(SERIAL_PORT, True)
dev.start()

while True:
    try:
        mob_pos = dev.getMobileBeaconsPosition()
        stat_pos = dev.getStationaryBeaconsPosition()

        if len(mob_pos) > 0:
            print(mob_pos)
        if len(stat_pos) > 0:
            print(stat_pos)
    except KeyboardInterrupt:
        break

dev.close()

Portable usage

You can compile or download the dynamic .so/.pyd file and place it in the same folder as the python script that imports the marvelmind_pylib library.

(back to top)

Contact

Alberto Ramos Sánchez - alberto.ramos104@alu.ulpgc.es

(back to top)

About

Python binding for Marvelmind C API

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published