This driver offers a c++ wrapper to control a pan&tilt [PTU-D46] (https://www.sustainable-robotics.com/reference/PTU/PTU-manual-D46-2.15.pdf). This driver provides a set of functions to:
* Configure both servos with an XML file.
* Download the current configuration to a XML file.
* Move both servos to a desired position.
* Move both servos to a desired position relative to the current position.
* Move both servos on torque mode.
* Get any feedback that the pna-tilt offers.
On the following image is shown a pan&tilt and his controller:
This package requires of the following system libraries and packages
*[cmake](https://www.cmake.org"CMake's Homepage"), a cross-platform build system.
*[doxygen](http://www.doxygen.org"Doxygen's Homepage") and [graphviz](http://www.graphviz.org"Graphviz's Homepage") to generate the documentation.
* stdc++.
Under linux all of these utilities are available in ready-to-use packages.
Under MacOS most of the packages are available via [fink](http://www.finkproject.org/"Fink's Homepage")
This package also requires of the following IRI libraries:
*[iriutils](https://gitlab.iri.upc.edu/labrobotica/algorithms/iriutils"iriutils gitlab page"), a set of basic tools.
*[comm](https://gitlab.iri.upc.edu/labrobotica/drivers/comm"comm gitlab page"), a set of drivers for standard communication devices.
*[trajectory](https://gitlab.iri.upc.edu/labrobotica/algorithms/trajectory"trajectory gitlab page"), a set of basic tools to follow a trajectory.
## Compilation and installation
Download this repository and create a build folder inside:
``` mkdir build ```
Inside the build folder execute the following commands:
``` cmake .. ```
The default build mode is DEBUG. That is, objects and executables include debug information.
The RELEASE build mode optimizes for speed. To build in this mode execute instead
``` cmake .. -DCMAKE_BUILD_TYPE=RELEASE ```
The release mode will be kept until next time cmake is executed.
``` make ```
In case no errors are reported, the generated libraries (if any) will be located at the
_lib_ folder and the executables (if any) will be located at the _bin_ folder.
In order to be able to use the library, it it necessary to copy it into the system.
To do that, execute
``` make install ```
as root and the shared libraries will be copied to */usr/local/lib/iridrivers* directory
and the header files will be copied to */usr/local/include/iridrivers* dierctory. At
this point, the library may be used by any user.
To remove the library from the system, exceute
``` make uninstall ```
as root, and all the associated files will be removed from the system.
To generate the documentation execute the following command:
``` make doc ```
## How to use it
To use this library in an other library or application, in the CMakeLists.txt file, first it is necessary to locate if the library has been installed or not using the following command
``` FIND_PACKAGE(<libraryname>) ```
In the case that the package is present, it is necessary to add the header files directory to the include directory path by using