ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Could you give us some context into what you are trying to accomplish?

I haven't used ros2. But in ros1, you can hack this behavior using timers as shown here. Ros2 may have something similar.

You could have a subscriber that reads the topic at the original 100Hz and saves the value to some variable (or struct). Each ros timer has a callback and you can execute this callback at the desired 10Hz rate, where you can use this data for your processing. In the code example at the above link, you can have callback1 from the subscriber (at whatever rate program A is publishing) and callback2 from the timer (at the desired 10Hz).