ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
The ros tutorials are always a good starting point. In particular, there are tutorials on how to create a publisher and a subscriber.
For setting the publish frequency, you have a few choices. If it is sufficient to set the rate once, when your node is started up, you can use a ros parameter that is best set using a launch file.
If you need to change the publish rate at run time, you can either use a service or use dynamic_reconfigure. While the former one should be easier to implement, I think the latter one is more flexible. For instance, you can use a nice GUI to change the parameters which is really handy when you are trying to find a good value.