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

Runtime topics remapping ?!

asked 2013-06-10 02:32:13 -0500

mateo_7_7 gravatar image

updated 2014-04-20 14:09:28 -0500

ngrennan gravatar image

is it possible to remap topic during runtime?..using strings passed by other topics for example.. If it

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-06-10 02:42:47 -0500

dornhege gravatar image

Not directly as remapping usually means connecting to another topic. But you can just use normal ROS functionality for publishing/subscribing.

Basically: Bring down the old publisher/subscriber and create a new one that you pass another topic string to.

edit flag offensive delete link more


so, if i had 100 robots (nodes) and each of those had to communicate with just ONE (among all robots) and this "one" changes over time, i should write 100 subscriber/publisher declarations!?!?!

mateo_7_7 gravatar image mateo_7_7  ( 2013-06-10 02:55:10 -0500 )edit

Well, you will have 100 total. For each robot, however, you would only have one declaration. If the ONE to connect to changes, you will just change what this single declaration points to in each robot/node. In the simplest form, you'd move the subscribe/advertise call from the init code.

dornhege gravatar image dornhege  ( 2013-06-10 04:35:55 -0500 )edit

thanks, i know this solution but in this way my system would be extremely inefficient in terms of scalability...(i should modify the code every time the number of robots changes).

mateo_7_7 gravatar image mateo_7_7  ( 2013-06-10 04:42:50 -0500 )edit

No, that should not be necessary. Can you maybe update your original post and give some more explicit use cases what you'd like to happen, e.g. something like: robots/nodes and topic connections before - something changes - robots/nodes + topics after. This can probably be done without code changes.

dornhege gravatar image dornhege  ( 2013-06-10 05:03:44 -0500 )edit

As to scalability: If you want to connect 100 robots to one and then change to connect to another one, you'd have to change those 100 connections physically. Besides that there should be no overhead.

dornhege gravatar image dornhege  ( 2013-06-10 05:04:51 -0500 )edit

Question Tools


Asked: 2013-06-10 02:32:13 -0500

Seen: 635 times

Last updated: Jun 10 '13