|
3.20 GPSDerived from Solid.
3.20.1 DescriptionThe GPS node is used to model a Global Positioning Sensor (GPS) which can obtain information about its absolute position from the controller program. 3.20.2 Field Summary
3.20.3 GPS FunctionsNAMEwb_gps_enable, wb_gps_disable - enable and disable the GPS measurementsC SYNOPSIS#include <webots/gps.h>void wb_gps_enable(WbDeviceTag gps, int ms); void wb_gps_disable(WbDeviceTag gps); C++ SYNOPSIS#include <webots/GPS.hpp>void GPS::enable(int ms); void GPS::disable(); JAVA SYNOPSISimport com.cyberbotics.webots.controller.GPS;void GPS.enable(int ms); void GPS.disable(); PYTHON SYNOPSISfrom controller import GPSnone GPS.enable(int ms) none GPS.disable() DESCRIPTIONwb_gps_enable() allows the user to enable a GPS measurement each ms milliseconds. wb_gps_disable() turns the GPS off, saving computation time. NAMEwb_compass_get_values - read the output values of the gps deviceC SYNOPSIS#include <webots/gps.h>const double *wb_gps_get_values(WbDeviceTag sensor); C++ SYNOPSIS#include <webots/GPS.hpp>const double *GPS::getValues(); JAVA SYNOPSISimport com.cyberbotics.webots.controller.GPS;double[] GPS.getValues(); PYTHON SYNOPSISfrom controller import GPSlist<float> GPS.getValues() DESCRIPTIONThe wb_gps_get_values() function returns the current GPS measurement. The values are returned as a 3d-vector, therefore only the indices 0, 1, and 2 are valid for accessing the vector. The returned vector indicates the absolute position of the GPS device. Note: For the C/C++ API: the returned vector is a pointer to the internal values managed by the GPS 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. |