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

ROS Action translator node

asked 2022-04-10 04:08:28 -0500

Spyro gravatar image

Hello everybody,

For a personal project, I want to create a ROS action translator node that will works as a middle person :

  • The node will receive a message, let's say "Hello"
  • It will change that to "Good morning"
  • Send back the new message to the node that requested the action.

I want to do that for a predefined list of words that I have with it's translation, something like this but in an XML file probably :

  • Hello ----> Good morning

  • Bye ----> See you

  • robot_pr2 -----> robot_pr2_x5

Do you have any idea how I can perform that in a good way ? or I must do a string comparison for each word received with all my list till I found the right one ?

Thank you

edit retag flag offensive close merge delete


Anyone please ?

Spyro gravatar image Spyro  ( 2022-04-11 11:31:01 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-04-11 17:32:57 -0500

ljaniec gravatar image

Why wouldn't a standard Python dictionary and a sub-pub "repeater" node be enough?

edit flag offensive delete link more


Because I have to do it using an xml file. But could you please explain you suggestion, I am still curious about it (I am a beginner).

Thank you

Spyro gravatar image Spyro  ( 2022-04-12 11:24:54 -0500 )edit

You can implement similar functionality with XML too, by mapping etc. You should read more about ROS subscribers and publishers - you can then use e.g. this tutorial: for a base

ljaniec gravatar image ljaniec  ( 2022-04-12 12:24:38 -0500 )edit

Question Tools

1 follower


Asked: 2022-04-10 04:08:28 -0500

Seen: 89 times

Last updated: Apr 11 '22