AMOR API library  V1.1.44
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator
Usage

Using the AMOR API library

The AMOR API is defined in the header file amor.h. This file specifies how to interface with the corresponding library.

Files and folders

bin/     Compiled binary of the example application.
doc/     API Reference Documentation
include/ Files that need to be included in your software to allow interfacing with the AMOR API.
lib/     AMOR API library files (dll) + esd can driver interface (dll)
src/     Source code of the example application.

Dependencies and Include directory

To use the AMOR API in your code, make sure that:

Connect to the AMOR

To use the AMOR API in your code, you must connect to the AMOR:

Example 1

AMOR_HANDLE handle = amor_connect("canlib_esd.dll", 0);

if(handle == AMOR_INVALID_HANDLE) {
  // Handle error
}
else {
  // call any of the amor_* functions
  amor_release(handle);
}

The second argument to amor_connect (can_port) specifies th CAN net number of the CAN device you are using. Usually the net number is 0. Please refer to the manual of your CAN device for more information. When the handle to the AMOR connection is created, it is possible to use all function that are listed in the library header, for example:

Example 2

AMOR_VECTOR7 pos;
if(amor_get_actual_positions(handle, &pos) != AMOR_SUCCESS) {
  // Handle error
}
else {
  printf("Joint angle A1 = %f [rad]\n", pos[0]);
  printf("Joint angle A2 = %f [rad]\n", pos[1]);
  // ... and so on
}