Code Examples - QB Robotics qbmove Advanced Kit User Manual

Table of Contents

Advertisement

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
commGetCurrents
Description: This function is used to retrieve the motor currents from the device.
Arguments
commGetCurrAndMeas
Description: This function is used to retrieve both motor currents and encoder
measurements from the device with only one command.
Arguments
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):
short int
inputs[]: The array used to store the inputs to be taken to
the devices
comm_settings
*comm_settings_t: Structure containing info about
communication settings
id: The device's ID number
int
short int
measurements[]: The array used to store the encoder
measurements of the device connected
comm_settings
*comm_settings_t: Structure containing info about
communication settings
id: The device's ID number
int
short int
currents[]: The array used to store the motor currents of the
device connected
comm_settings
*comm_settings_t: Structure containing info about
communication settings
id: The device's ID number
int
short int
values*: The array used to store motor currents and encoder
measurements of the device connected
72
28 aprile 2021

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the qbmove Advanced Kit and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents