Skip to content

Latest commit

 

History

History
45 lines (28 loc) · 1.31 KB

File metadata and controls

45 lines (28 loc) · 1.31 KB

Controllers

This repository contains: OnOffController and PidController. It also contains a class called Controller was created to be able to create general controllers in the future.

Build

If you do not intend to edit the code, go to the Makefile and comment the lines related with compiledb those are 13 and 20. If you do not do this and don't have compiledb already installed in your system, you will probably get an error during compilation.

  • If you want to get the compiledb just run the command below:

    pip install compiledb

Static

  1. Run the command below to compile the library as static

    make static

Shared

  1. Run the command below to compile the library as shared

    make shared

Link to your program

To link to your program manually (without an automate build system as CMake), use one of the options below. I use both of them with the code under example folder, this code is a simple example to show how to instantiate the controllers, and how to use the Update function. Check this code to see how to make it.

Static

g++ -std=c++11 main.cpp -I../include -L../lib -o main -lcontrollers

Shared

g++ -std=c++11 main.cpp -I../include -L../lib -Wl,-rpath=../lib -o main -lcontrollers