0
$\begingroup$

Rosanswers logo

I'm wondering if there is a standard node for receiving a message, and then repeating the last message which was received on another topic at a specified rate. So something like what rostopic pub /topic std_msgs/String 'hi!' -r 10 does, except it would take the message it's sending from another topic that it is receiving from. This would seem like a useful node type to have, but I can't find it from my cursory search of the stacks. Something like what relay does from the topic_tools stack.

My reason: I've set up the generic_teleop to work with a joystick and broadcast to a stageros on /robot_0/cmd_vel, but it stops when I am controlling it and don't move the joystick, I assume because it doesn't continually send messages, but only sends when there is an update to the joystick. Sticking my "repeat last message" node in between teleop_source_node and teleop_sink_twist_node (or between teleop_sink_twist_node and stageros) would solve this problem.


Originally posted by jamuraa on ROS Answers with karma: 218 on 2012-03-21

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I don't know if this is still relevant to you (probably not) but what I would do is take the topic_tools/relay node source code and slightly modify so it could accept an optional argument such as -r, using ros::Rate to control the publishing in the main function instead of through the in_cb callback. That would be immediately useful to you and could be submitted as a contribution to the package maintainer.


Originally posted by georgebrindeiro with karma: 1264 on 2012-08-21

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.