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

take updated topic and repeat it

asked 2012-03-21 17:35:09 -0500

jamuraa gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-08-21 03:36:24 -0500

updated 2012-08-21 03:37:04 -0500

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-03-21 17:35:09 -0500

Seen: 498 times

Last updated: Aug 21 '12