Is it possible to filter messages from a topic based on 'header' data ?

asked 2023-04-26 07:24:41 -0600

SébastienL gravatar image

Hi,

In my world.sdf, I included a model "cis_iris" that use

<include>
  <uri>model://iris_with_standoffs</uri>
</include>

<plugin filename="libignition-gazebo-pose-publisher-system.so"
          name="ignition::gazebo::systems::PosePublisher">
  ...

The message in gazebo topic contain position for the "cis_iris" model but also for "cis iris::iris_with_standoffs" : gz topic --topic /model/cis_iris/pose --echo

header {
  stamp {  sec: 41   }
  data {
    key: "frame_id"
    value: "cis iris"   }
 data {
    key: "child_frame_id"
    value: "cis iris::iris_with_standoffs"   } 
}
name: "cis iris::iris_with_standoffs"
...

header {
  stamp {   sec: 41   }
  data {
    key: "frame_id"
    value: "warehouse_lanes"   }
  data {
    key: "child_frame_id"
    value: "cis iris"   }
}
name: "cis iris"
 ...

Is there any way to prevent the emission of message for the element "cis iris::iris_with_standoffs" ? If not, as this topic is then send to ROS2, maybe there is a way to filter the message there ?

edit retag flag offensive close merge delete