ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Possible to filter messages in rxplot?

asked 2012-03-07 04:30:39 -0600

updated 2012-03-07 04:31:06 -0600

I'm stuck using a message type that was perhaps poorly designed in that it's been multiplexed. That is to say several different joints are using the same message, but filling out a different joint index. I can't change the message unfortunately, but still need to work with it.

Is it possible to use rxplot to plot the information in such messages? I would have to basically set up some sort of conditional plotting.

I'm guessing this is not possible and my best option is to write a little translator node to convert the messages into either different topics or one that aggregates. But figured I'd ask anyway.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-03-07 05:24:52 -0600

mrtc gravatar image

updated 2012-03-07 05:29:21 -0600

You could also pipe data with a filter using rostopic like so (one line):

rostopic echo --filter "int(m.header.stamp.secs) % 3 == 0" /imu_data/orientation/x | rostopic pub bar std_msgs/Float64

This example just publishes messages with a timestamp divisible by 3 to bar, but you can put any python expression there (such as to filter by your joint index) and then use:

rxplot bar/data

to plot it. However the rostopic wiki article warns that filtering give a performance hit, not sure how that would impact your current system.

For more info: rostopic

edit flag offensive delete link more


Oh, nice. This will work perfectly. Thanks!

Asomerville gravatar image Asomerville  ( 2012-03-07 05:31:33 -0600 )edit

answered 2012-03-07 04:56:55 -0600

tfoote gravatar image

Your filter/translator node is the best option.

edit flag offensive delete link more

Question Tools


Asked: 2012-03-07 04:30:39 -0600

Seen: 429 times

Last updated: Mar 07 '12