3.27 Gyro
Derived from Device.
Gyro { |
3.27.1 Description
The Gyro node is used to model 1, 2 and 3-axis angular velocity sensors (gyroscope). The angular velocity is measured in radians per second [rad/s].
3.27.2 Field Summary
-
lookupTable: This field optionally specifies a lookup table that can be used for mapping the raw angular velocity values [rad/s] to device specific output values. With the lookup table it is also possible to add noise and to define the min and max output values. By default the lookup table is empty and therefore the raw values are returned (no mapping).
-
xAxis, yAxis, zAxis: Each of these boolean fields specifies if the computation should be enabled or disabled for the specified axis. If one of these fields is set to FALSE, then the corresponding vector element will not be computed and it will return NaN (Not a Number) For example if zAxis is FALSE, then wb_gyro_get_values()[2] returns NaN. The default is that all three axes are enabled (TRUE).
3.27.3 Gyro Functions
NAME
wb_gyro_enable, wb_gyro_disable, wb_gyro_get_sampling_period, wb_gyro_get_values - enable, disable and read the output values of the gyro deviceSYNOPSIS [C++] [Java] [Python] [Matlab]
#include <webots/gyro.h>void wb_gyro_enable(WbDeviceTag tag, int ms);
void wb_gyro_disable(WbDeviceTag tag);
int wb_gyro_get_sampling_period(WbDeviceTag tag);
const double *wb_gyro_get_values(WbDeviceTag tag);
DESCRIPTION
The wb_gyro_enable() function turns on the angular velocity measurement each ms milliseconds.
The wb_gyro_disable() function turns off the Gyro device.
The wb_gyro_get_sampling_period() function returns the period given into the wb_gyro_enable() function, or 0 if the device is disabled.
The wb_gyro_get_values() function returns the current measurement of the Gyro device. The values are returned as a 3D-vector therefore only the indices 0, 1, and 2 are valid for accessing the vector. Each vector element represents the angular velocity about one of the axes of the Gyro node, expressed in radians per second [rad/s]. The first element corresponds to the angular velocity about the x-axis, the second element to the y-axis, etc.
|
|
|
|