72
28 aprile 2021
•
short int inputs[]
: The array used to store the inputs to be taken to
the devices
•
commGetMeasurements
•
Description
: This function is used to retrieve the encoder measurements from the
device. The measurements returned are in encoder ticks. If you are using the
qbmove, the constant to convert from ticks to degrees is 360/32768.
•
Arguments
•
comm_settings *comm_settings_t
: Structure containing info about
communication settings
•
int id
:
The device’s ID number
•
short int measurements[]
: The array used to store the encoder
measurements of the device connected
•
commGetCurrents
•
Description
: This function is used to retrieve the motor currents from the device.
•
Arguments
•
comm_settings *comm_settings_t
: Structure containing info about
communication settings
•
int id
:
The device’s ID number
•
short int currents[]
: The array used to store the motor currents of the
device connected
•
commGetCurrAndMeas
•
Description
: This function is used to retrieve both motor currents and encoder
measurements from the device with only one command.
•
Arguments
•
comm_settings *comm_settings_t
: Structure containing info about
communication settings
•
int id
:
The device’s ID number
•
short int values*
: The array used to store motor currents and encoder
measurements of the device connected
6.4.4
Code Examples
6.4.4.1
Theoretical Example
The purpose of this example is to show how the functions are supposed to be used, in which
order and with what arguments. To compile the example, first of all follow the steps described
in the previous section. Secondly we suggest to create a new .cpp file (e.g.
qbmove_example.cpp
)
and copy and paste the following code. At this point create a new folder, for example
named
include,
in which you have to copy qbmove_communications.h and commands.h. Then
copy and paste the generated static library "libqbmove_comm.a"(under generated folder
lib_win
)
and “qbmove_communications.o”
(under generated folder
objs_win
) in the folder
containing the code and execute the commands (in a terminal shell or a cmd prompt correctly
setted as described in the previous sections):
Summary of Contents for qbmove Advanced Kit
Page 2: ...www qbrobotics com ...
Page 15: ...12 28 aprile 2021 Figure 3 7 Snap on mechanism Figure 3 8 Examples of connection ...
Page 40: ...37 28 aprile 2021 ...
Page 63: ...60 28 aprile 2021 IMPORTANT Remember to power the qbmove or the chain before using it ...
Page 97: ...94 28 aprile 2021 This page was intentionally left blank ...