# Custom message from ROS topic to PX4 autopilot

**URL:** <https://discuss.px4.io/t/custom-message-from-ros-topic-to-px4-autopilot/20640>\
**Category:** Uncategorized\
**Created:** [January 22, 2021, 3:53pm UTC](https://discuss.px4.io/t/custom-message-from-ros-topic-to-px4-autopilot/20640 "2021-01-22T15:53:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![virgil](https://discuss.px4.io/letter_avatar_proxy/v4/letter/v/4af34b/32.png) [@virgil](https://discuss.px4.io/u/virgil)\
**Post date:** [January 22, 2021, 3:53pm UTC](https://discuss.px4.io/t/custom-message-from-ros-topic-to-px4-autopilot/20640/1 "2021-01-22T15:53:55Z")

</div>

Hello All,

I am attempting to create a custom message that can be published from a ROS node, communicated via MAVLink, and then uploaded as a uORB topic for use with the PX4 autopilot. I have followed the instructions for [Custom MAVLink](https://docs.px4.io/master/en/middleware/mavlink.html) and [Custom uORB](https://docs.px4.io/master/en/middleware/uorb.html) message generation. To test my implementation I am running a SITL simulation using Gazebo with ROS. My debugging steps have been:

1. Using `rostopic echo mavros/mymessage` and `rostopic list` to confirm that my message is being published by my ROS node, which it is based on the output from these commands. Oddly using the `rqt_graph` tool does not show that my node is publishing to this topic.
2. Using `listener myuORBmessage` to confirm that the uORB topic is alive, as the output is `never published` rather than `Topic did not match any known topics`.
3. Placing a `PX4_INFO()` statement inside of `handle_message()` function from mavlink\_reciever.cpp to output the IDs of messages received. In my ROS node I am also publishing to the `mavros/actuator_control` topic and I see the correct value for that message, but not my custom one.
4. After reading some old questions (~2017) about this topic I did try adding my custom message to the stream list in mavlink\_main.cpp, but that did not fix the problem.
5. I was unsure of what dialect value to use in my MyMessage.xml file so I have tried using both 1 and 3 as dialect value 2 is being used by another xml file and dialect value 0 is being used by common.xml.

Based on these steps it appears that my custom message is being published correctly from my ROS node, but it never enters the `handle_message()` function to then be passed off to the handler function written to publish the data to a uORB topic. I would really appreciate and advice on this problem. Thanks in advance.
