ROS Action translator node
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
robotpr2 -----> robotpr2_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
Asked by Spyro on 2022-04-10 04:08:28 UTC
Answers
Why wouldn't a standard Python dictionary and a sub-pub "repeater" node be enough?
Asked by ljaniec on 2022-04-11 17:32:57 UTC
Comments
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
Asked by Spyro on 2022-04-12 11:24:54 UTC
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: https://roboticsbackend.com/oop-with-ros-in-python/ for a base
Asked by ljaniec on 2022-04-12 12:24:38 UTC
Comments
Anyone please ?
Asked by Spyro on 2022-04-11 11:31:01 UTC