Hello Guys,
I'm new to ros and although there are tutorials for using rostopic, I don't know how to integrate it in my project.
What I'm trying to do: I'm writing a python script* which spawns objects in a gazebo world. The positions and number of items is changing.
After every ne positioning, I'd want to get the current data with all (or certain) fields of one topic.
How can I do that? Is there a way, that I have like an object which subscribes to the topic, and I'll ask it hey, give me your current state? I really don't now how to incorporate those Subscriber-tutorial-pys in my basically independent py-script (I use plumbum for rosparam calls).
I would appreciate if you could help me to get a better impression on how to solve my problem.
I'm using ros-electric.
**UPDATE:
To make it a little bit more clear: Every time I launch an object, I want to check a certain topic. And from that topic I want to read the boundingbox, pos, rot, etc of model a, b, c. Those values are all written out to the topic I want to read. So I just need to now how to access them in a script (and just one iterarion, e.g. the current state).
*(the script is autonomous from the ros-projects. it basically calculates the position of those objects, writes thos on the paramserver and launches them)
Originally posted by termed on ROS Answers with karma: 1 on 2012-08-11
Post score: 0
Original comments
Comment by termed on 2012-08-11:
Thanks for your answer! The problem I have is not to have a topic which gives informations I need, but on how to read those informations in code. So, I mean, when I call echo in the console I get a shitload of data, but how do I get just one load, or how can I choose one?