[ros-users] Rostopic + python

Ugo Cupcic ugo at shadowrobot.com
Thu Jul 1 12:20:58 UTC 2010


Dear Sacha,

You can find this in rostopic.py. 

Here is a small code sample that works:

import rosgraph.masterapi
master = rosgraph.masterapi.Master('/rostopic')
print master.getPublishedTopics('/')

Cheers,

Ugo

On Thu, 2010-07-01 at 13:07 +0100, Sacha Aury wrote:
> Hi,
> 
> I would like to know if it is possible to get the list of published ros
> topic in a python script.
> 
> The solution I am using is to use subprocess with rostopic list as a
> bash command, but it is a bit slow (and not very fancy)
> 
> Thanks.
> 
> Sacha
> 
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
> 


-- 
Ugo Cupcic         |  Shadow Robot Company | ugo at shadowrobot.com
Software Engineer  |    251 Liverpool Road |
need a Hand?       |    London  N1 1LX     | +44 20 7700 2487
http://www.shadowrobot.com/hand/              @shadowrobot






More information about the ros-users mailing list