1
$\begingroup$

I'm trying to simulate a GPS module I have on a real robot (using ROS 2) which has a position update rate of 1Hz. Is it possible to set this in a GPS device? I'm importing the device directly to Webots from a URDF (I had to modify the urdf2webots script to include the GPS() device), but I can't find a sample_rate option in Webots so I can change that too.

These are the only settings available (this one was imported from URDF):

enter image description here

None of these options seem to affect sample-rate for just the GPS.

Is my only option to write a ROS node that captures the 30Hz Webots sim rate and only republishes at the desired rate? Or can this be set in Webots somehow?

Thanks all

$\endgroup$

1 Answer 1

1
$\begingroup$

In Webots the sensor update rate is defined in the controller side when enabling the device by specifying the sampling period in ms (1Hz = 1000ms) and not in the model definition.

For the GPS device, here is the documentation of the enable function: https://www.cyberbotics.com/doc/reference/gps#wb_gps_enable

If you are using ROS, then the update rate is specified using the sampling period value using the webots_ros::set_int argument of the /<device_name>/enable service.

Disclaimer: I am a Webots developer working at Cyberbotics.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.