|
3.23 GyroDerived from Solid.
3.23.1 DescriptionThe 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.23.2 Field Summary
3.23.3 Gyro FunctionsNAMEwb_gyro_enable, wb_gyro_disable, wb_gyro_get_values - enable, disable and read the output values of the gyro deviceC SYNOPSIS#include <webots/gyro.h>void wb_gyro_enable(WbDeviceTag sensor, int ms); void wb_gyro_disable(WbDeviceTag sensor); const double *wb_gyro_get_values(WbDeviceTag sensor); C++ SYNOPSIS#include <webots/Gyro.hpp>void Gyro::enable(int ms); void Gyro::disable(); const double *Gyro::getValues(); JAVA SYNOPSISimport com.cyberbotics.webots.controller.Gyro;void Gyro.enable(int ms); void Gyro.disable(); double[] Gyro.getValues(); PYTHON SYNOPSISfrom controller import Gyronone Gyro.enable(int ms) none Gyro.disable() list<float> Gyro.getValues() DESCRIPTIONThe wb_gyro_enable() function turn on the angular velocity measurement each ms milliseconds. The wb_gyro_disable() function turns off the Gyro device. 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. Note: For the C/C++ API: the returned vector is a pointer to the internal values managed by the Gyro node, therefore it is illegal to free this pointer. Furthermore, note that the pointed values are only valid until the next call to the wb_robot_step() function. If these values are needed for a longer period they must be copied. ![]() ^ page top ^ |
| E-mail to webmaster | Last updated: | Copyright © 2008 Cyberbotics Ltd. |