# QoS profile for ROS2 in Python

**URL:** <https://discuss.px4.io/t/qos-profile-for-ros2-in-python/33043>\
**Category:** ROS 1 / ROS 2\
**Created:** [July 3, 2023, 10:04pm UTC](https://discuss.px4.io/t/qos-profile-for-ros2-in-python/33043 "2023-07-03T22:04:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![R\_mcc](https://discuss.px4.io/letter_avatar_proxy/v4/letter/r/e68b1a/32.png) [@R\_mcc](https://discuss.px4.io/u/R_mcc)\
**Post date:** [July 3, 2023, 10:04pm UTC](https://discuss.px4.io/t/qos-profile-for-ros2-in-python/33043/1 "2023-07-03T22:04:29Z")

</div>

Hello, I am looking to do some offboard control and need to subscribe to the “/fmu/out/vehicle\_odometry” topic. However as detailed in the [documentation](https://docs.px4.io/main/en/ros/ros2_comm.html#ros-2-subscriber-qos-settings), the default QoS profile for ROS2 subscribers is incompatible with PX4’s publishers.The documentation does give example code for changing this QoS profile, however it is in C++.

If anyone can show me what creating this custom QoS profile in Python would look like I would be very grateful.

Thanks!

---

<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:** [July 4, 2023, 12:07am UTC](https://discuss.px4.io/t/qos-profile-for-ros2-in-python/33043/2 "2023-07-04T00:07:21Z")

</div>

Hi @R_mcc !  
You can take a look at the offboard control example in python!

> <https://github.com/PX4/px4_ros_com/blob/e18248db6211350e6a418cb08ae38f64c314a2f4/src/examples/offboard_py/offboard_control.py>

---

<div class="post-metadata">

**Author:** ![R\_mcc](https://discuss.px4.io/letter_avatar_proxy/v4/letter/r/e68b1a/32.png) [@R\_mcc](https://discuss.px4.io/u/R_mcc)\
**Post date:** [July 5, 2023, 4:27pm UTC](https://discuss.px4.io/t/qos-profile-for-ros2-in-python/33043/3 "2023-07-05T16:27:02Z")

</div>

Hello,

I didn’t realize that package had been updated with newer examples! This works perfectly for me, thank you so much!
