# Subscriber node callback not triggering from simulator messages but manually sending with ros2 topic pub works?

**URL:** <https://discuss.px4.io/t/subscriber-node-callback-not-triggering-from-simulator-messages-but-manually-sending-with-ros2-topic-pub-works/36260>\
**Category:** ROS 1 / ROS 2\
**Created:** [January 13, 2024, 5:08am UTC](https://discuss.px4.io/t/subscriber-node-callback-not-triggering-from-simulator-messages-but-manually-sending-with-ros2-topic-pub-works/36260 "2024-01-13T05:08:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![climbbikehike](https://discuss.px4.io/letter_avatar_proxy/v4/letter/c/7993a0/32.png) [@climbbikehike](https://discuss.px4.io/u/climbbikehike)\
**Post date:** [January 13, 2024, 5:08am UTC](https://discuss.px4.io/t/subscriber-node-callback-not-triggering-from-simulator-messages-but-manually-sending-with-ros2-topic-pub-works/36260/1 "2024-01-13T05:08:06Z")

</div>

I am currently running the latest PX4-Autopilot simulator using `make px4_sitl gazebo-classic` on a machine with ROS2 Foxy and Ubuntu 20.04. I am also running the MicroXRCEAgent using: `MicroXRCEAgent udp4 -p 8888`. I don’t know if that matters or not.

I can run `ros2 topic echo /fmu/out/sensor_combined` and see these messages being published in the terminal window. But I have a subscriber node that is listening for them, and not being triggered (despite it triggering if I manually publish to that topic via the command line). These terminals are all on the same machine on the same network if that matters.

I tried looking into MAV BROADCAST settings, but that did not seem to yield any results. What am I missing? Is there a networking thing that would prevent my node from subscribing to a topic?

---

<div class="post-metadata">

**Author:** ![Benja](https://discuss.px4.io/user_avatar/discuss.px4.io/benja/32/11872_2.png) [@Benja](https://discuss.px4.io/u/Benja)\
**Post date:** [January 14, 2024, 11:02am UTC](https://discuss.px4.io/t/subscriber-node-callback-not-triggering-from-simulator-messages-but-manually-sending-with-ros2-topic-pub-works/36260/2 "2024-01-14T11:02:00Z")

</div>

Did you check the QoS?

> **[uXRCE-DDS (PX4-ROS 2/DDS Bridge) | PX4 User Guide (main)](https://docs.px4.io/main/en/middleware/uxrce_dds.html#px4-ros-2-qos-settings)**
>
> PX4 is the Professional Autopilot. Developed by world-class developers from industry and academia, and supported by an active world wide community, it powers all kinds of vehicles from racing and cargo drones through to ground vehicles and...

---

<div class="post-metadata">

**Author:** ![climbbikehike](https://discuss.px4.io/letter_avatar_proxy/v4/letter/c/7993a0/32.png) [@climbbikehike](https://discuss.px4.io/u/climbbikehike)\
**Post date:** [January 14, 2024, 3:43pm UTC](https://discuss.px4.io/t/subscriber-node-callback-not-triggering-from-simulator-messages-but-manually-sending-with-ros2-topic-pub-works/36260/3 "2024-01-14T15:43:19Z")

</div>

Thanks for the response! I just got it figured out last night and it was a problem with the QoS as you mentioned. I had only set history and depth, but not reliability and durability. It did not work until I set all of them.

For those who are curious, here’s the Python code for the QoS profile I used:

```auto
      qos_profile = QoSProfile(
          history=HistoryPolicy.KEEP_LAST,
          depth=5,
          reliability=ReliabilityPolicy.BEST_EFFORT,
          durability=DurabilityPolicy.VOLATILE)

```
