svah — समुद्रः वह् — ODrive CANSimple host library in C
=========================================================

svah is a portable C library for controlling ODrive BLDC motor
controllers via the CANSimple protocol over a CAN bus.

It ports the host-side Python ODrive library to pure C, enabling use
on bare-metal microcontrollers (ESP32, SAMD51), embedded Linux
(Raspberry Pi, BeagleBone), and PC host platforms from a single
codebase.


Requirements
------------

  - GNU Make
  - GCC with C11 support (gcc >= 4.9)
  - autoconf >= 2.69, automake >= 1.11
  - Linux: SocketCAN-enabled kernel and iproute2 (for CAN interface setup)


Building — first time or after a fresh archive extraction
---------------------------------------------------------

  ./bootstrap
  ./configure
  make
  make check


Clean rebuild (when Makefile already exists)
--------------------------------------------

  make maintainer-clean
  ./bootstrap
  ./configure
  make check


Integrating a new delivery archive into an existing build tree
--------------------------------------------------------------

Always run bootstrap BEFORE make maintainer-clean when the archive
contains a new configure.ac or Makefile.am. Without it, make tries to
regenerate Makefile.in via automake but the required helper files
(config.guess, depcomp, ...) may be absent from the previous clean.

  tar xJf svah-X.Y.Z.tar.xz
  ./bootstrap
  make maintainer-clean
  ./bootstrap
  ./configure
  make check


Usage (Linux)
-------------

Set up the CAN interface (once, as root):

  ip link set can0 type can bitrate 250000
  ip link set up can0

Run the test program:

  ./svah --interface can0 --axis 0

For testing without hardware, use a virtual CAN interface:

  ip link add dev vcan0 type vcan
  ip link set up vcan0
  ./svah --interface vcan0 --debug

See svah.1 or run ./svah --help for full option documentation.


Architecture
------------

  Application / svah
  OdriveApi        — high-level ODrive commands
  CanopenSimple    — CANSimple frame codec (portable)
  HalCan / HalTime — platform HAL (Linux: SocketCAN / CLOCK_MONOTONIC)


License
-------

svah is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your
option) any later version.

See COPYING for the full license text.


Author
------

Peter Felecan <pfelecan@gmail.com>
