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

Revision history [back]

click to hide/show revision 1
initial version

Actually my solution is to give up the synch because of lessing time to wait answer here, but the above answer from lucasw seems should work well.

My solution:

Improve the rate of topic through checking whether there is a IF ELSE statement before the node publishing those messages. If there is a IF ELSE which is the core reason to reduce the publishing rate, then publish those messages always, but with empty message if rules are not satisfied.

  1. Look at which topic has the most lowest hz. This message will be the critical one.
  2. write callback functions individually for each topic. Store these messages i.e. update messages as member variables of class.
  3. In the critical callback function, I get all other member variables(messages) to deal with whatever I want to do.

This solution works if you need to for example imshow, since the callback will be called every time when message received , if the node publish the critical message(i.e. the message you subscribed ) with empty content, this will help the callback will be called more soon, and this will keep other messages you subscribed could be used inside this callback, whenever there is an critical empty message received, you could write a IF ELSE to control your working flow.

Actually my solution is to give up the synch because of lessing time to wait answer here, but the above answer from lucasw seems should work well.

My solution:

Improve the rate of topic through checking whether there is a IF ELSE statement before the node publishing those messages. msg publishing.

If there is a IF ELSE and which is the core reason to reduce the publishing rate, then publish those messages always, but with empty message content if rules are not satisfied.

  1. More details about implementation(For ROS beginner): 1. Look at which topic has the most lowest hz. This message will be the critical one.

    1. write callback functions individually for each topic. Store these messages messages, i.e. update messages as member variables of your node class.

    2. In the critical callback function, function: I get all other member variables(messages) to deal with whatever I want to do.do. i.e. You don't manipulate other messages in their callbacks, you only update them.

    This solution works if you need to for example imshow, since the critical's callback will be called every time when message received , if the node which publish the critical message(i.e. the message you subscribed ) message with empty content, this will help the callback will be called more soon, and soon. This is important because this will keep other messages you subscribed could be used inside this critical callback, whenever there is an critical empty message received, you could write a IF ELSE to control your working flow.

Actually my solution is to give up the synch because of lessing time to wait answer here, but the above answer from lucasw seems should work well.

My solution:

Improve the rate of topic through checking whether there is a IF ELSE statement before the msg publishing.

If there is a IF ELSE and which is the core reason to reduce the publishing rate, then publish those messages always, but with empty content if rules are not satisfied.

More details about implementation(For ROS beginner): 1. beginner):

  1. Look at which topic has the most lowest hz. This message will be the critical one.

    1. write callback functions individually for each topic. Store these messages, i.e. update messages as member variables of your node class.

    2. In the critical callback function: I get all other member variables(messages) to deal with whatever I want to do. i.e. You don't manipulate other messages in their callbacks, you only update them.

    This solution works if you need for example imshow, since the critical's callback will be called every time when message received , if the node which publish the critical message with empty content, this will help the callback will be called more soon. This is important because this will keep other messages you subscribed could be used inside this critical callback, whenever there is an critical empty message received, you could write a IF ELSE to control your working flow.

Actually my solution is to give up the synch because of lessing time to wait answer here, but the above answer from lucasw seems should work well.

My solution:

Improve the rate of topic through checking whether there is a IF ELSE statement before the msg publishing.

If there is a IF ELSE and which is the core reason to reduce the publishing rate, then publish those messages always, but with empty content if rules are not satisfied.

More details about implementation(For ROS beginner):

  1. You need to modify the src code of author's node, by IF ELSE statement to improve rate as above I explained.

  2. Look at which topic has the most lowest hz. This message will be the critical one.

  3. write callback functions individually for each topic. Store these messages, i.e. update messages as member variables of your node class.

  4. In the critical callback function: I get all other member variables(messages) to deal with whatever I want to do. i.e. You don't manipulate other messages in their callbacks, you only update them.

This solution works if you need for example imshow, since the critical's callback will be called every time when message received , if the node which publish the critical message with empty content, this will help the callback will be called more soon. This is important because this will keep other messages you subscribed could be used inside this critical callback, whenever there is an critical empty message received, you could write a IF ELSE to control your working flow.