Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to change the topic publish frequency of imu or other sensor? #919

Open
lkx8421 opened this issue Apr 25, 2024 · 1 comment
Open

how to change the topic publish frequency of imu or other sensor? #919

lkx8421 opened this issue Apr 25, 2024 · 1 comment

Comments

@lkx8421
Copy link

lkx8421 commented Apr 25, 2024

When I use webots to publish imu topic, the urdf infomation such as this
image
and in my code i set TIME_STEP = 5 use
WbFieldRef field = wb_supervisor_node_get_field(time_node, "basicTimeStep"); wb_supervisor_field_set_sf_float(field, TIME_STEP);
but the topic frequecy is always like
image
image
i dont know how to change it in 5ms to publish

@lukicdarkoo
Copy link
Member

The publish rate also depends on the simulation speed. Webots tries to maintain RTF at 1.0 but it is not guaranteed as some simulation steps take longer to calculate.

In ROS, the standard approach is to use ROS clock (Webots already publishes it) in your nodes, see:
https://wiki.ros.org/Clock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants