Coder Social home page Coder Social logo

eyescan-libptzf's Introduction

libptzf

Pan Tilt Zoom Focus library for custom Marlin 3d printer firmware.

Requirements:

to build the library

sudo apt install \
  libboost-log-dev \
  libboost-system-dev \
  libserial-dev \
  ninja-build
pip3 install --upgrade meson

to build coverage reports

sudo apt install \
  libxml2-dev \
  libxslt1-dev
pip3 install gcovr

Installation:

mkdir builddir (vscode should make this for you if you have the meson extension)
cd buildir
meson -Db_coverage=true ..
ninja test
(optional for coverage reports) ninja coverage
(sudo) ninja install

NOTE: ninja install may also require Meson to be available to the root user if the installation path is not writable to the running user (usually the case). In this case, do the ugly sudo pip3 install --upgrade meson. You will probably wish to sudo apt uninstall meson if meson is installed with apt since it may conflict.

Python bindings

A pyptzf module will be built and installed in /usr/local/lib/python3.6/dist-packages if python3-dev (python headers) are installed on the system. The interface is mostly the same as C++. Simple usage is:

import pyptzf

c = pyptzf.Controller('/dev/MCB')

p = pyptzf.Position(0,1,2,3)

if not c.go(p):
  print(f"controller could not go to position: {}")

Would go to xyzf position 0,1,2,3 unless it wasn't possible in which case controller could not go to position: G0 X0.000 Y1.000 Z2.000 E3.000 would be printed.

TODO: Controller as a context manager.

Testing:

Valgrind

Other than the above tests and coverage reports, Valgrind (sudo apt install valgrind) can also be used to wrap the test to test for memory issues like this:

meson test --wrap='valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1'

source: pmod on stackoverflow, MIT license

Sanitizers

Sanitizers can be configured when running meson the first time like:

meson -Db_sanitize=address (for ASan)

Values can be: none, address, thread, undefined, memory, address, undefined

eyescan-libptzf's People

Contributors

mdegans avatar

Watchers

Seth Loh avatar  avatar

Forkers

indra4837

eyescan-libptzf's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.