Re: [ros-users] Rostopic + python

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Ugo Cupcic
Date:  
To: ros-users
Subject: Re: [ros-users] Rostopic + python
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
>
> https://code.ros.org/mailman/listinfo/ros-users
>



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