[ros-users] (no subject)

Ken Conley kwc at willowgarage.com
Fri Jul 30 22:52:19 UTC 2010

Partial answers below

On Fri, Jul 30, 2010 at 3:45 PM, Markus --- <markus-t314 at gmx.de> wrote:
> Hi,
> I am currently developing a gui (in c++ using Qt) for ros (using the latest svn version from https://code.ros.org/svn/ros/stacks/ros/trunk/) and have some questions:
> 1. I want to configure filters for subscribers. But these filters should be applied before the messages are sent, so that not every subscriber receives a message. I only found the existing message_filters, but in this case the messages are sent over the network and then are filtered before passing to the subscriber. Ideally the subscribers can also change their filter settings at run time.
> For example my application has one node "A" which publishes images and another one "B" subscribing these (both nodes run on the same machine). Now I'd like my gui node "C" (which runs on a remote machine) to receive the images, but to reduce network traffic I'd like the gui to only receive e.g. every 10th image, whereas the local node "B" still needs every message.
> I looked into the source code and thought of maybe editing Publication.cpp's function:
>        bool Publication::enqueueMessage(const SerializedMessage& m)
> where the message is sent to all subscribers.
> The problem is the publication-class doesn't have the necessary information to achieve this. So my question, is it somehow possible to achieve the described behaviour without modifying the ros-code too much, or in any other way?

You may want to take a look at topic_tools. Bascially, you would run a
throttle node on the other side of your link that would limit the
bandwidth that is transmitted. You could probably modify the throttle
code to make your own node that was more run-time configurable by your

> 2. I'd like my gui to run existing commandline tools (e.g. rostopic) and also get the result, so that the gui can display it.
> For example something like this:
> std::list<std::string> topics = run_command("rostopic list");
> Can I interface the tools from my c++ code or directly interface with the tool's python code?
> If it's possible, can you give me a little example on how to that?

I don't know of anyone who has directly interfaced C++ code with the
rospy codebase. Depending on the commands you are using, you may not
need to. For example, if you examine the code for rostopic list,
you'll see that it makes fairly vanilla XMLRPC calls to the master. It
would be much easier to rewrite the C++ equivalent as XMLRPC calls are
very dead simple.

More complicated commands like rostopic echo/pub and rosservice call
are not as easily reproduced, and you may be better off just shelling
out to the commands.

Hope this helps,

> Thanks in advance
> Markus
> --
> GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl.
> Bis zu 150 EUR Startguthaben inklusive! http://portal.gmx.net/de/go/dsl
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users

More information about the ros-users mailing list