cyberbotics / urdf2webots

Utility to convert URDF files to Webots PROTO nodes
Apache License 2.0
132 stars 43 forks source link

Question: Update rate of sensor #180

Closed FrederikBark closed 2 years ago

FrederikBark commented 2 years ago

In the sdf format an update_rate for sensors is defined, but unfortunately this field is not available in the parser right now. This field would be useful to increase or decrease sensor updates of cameras, range finders, imus, etc. and therefore useful to improve upon simulation performance and match real robots better. Is there a way how this can be implemented/passed to the webots ros controller?

omichel commented 2 years ago

Do you mean this update_rate field is specific to the SDF format only? Or can we specify it in a URDF file as well? If yes, can you provide an example?

FrederikBark commented 2 years ago

The update_rate field is a child of the sensor field and can be specified for sensors. The ros wiki says it is part of the urdf in section 2.

It seems currently not to be parsed by the parser. An example for a camera would be <sensor type="camera" name="thermal_camera_sensor"> <update_rate>9</update_rate> <camera> ... Source:

To parse these information into a proto, or do I need to create custom controllers?

omichel commented 2 years ago

There is no such information in Webots PROTO files, so I guess it is better to create a custom controller where you will call:

wb_camera_enable(update_rate);
FrederikBark commented 2 years ago

Thank you for the quick responses