How to make a publisher with coordinates from gazebo model in px4


I am new to this. I am trying to adjust drone model in px4 x500. I added pendulum to this model, but now I want to publish data of coordinates of the end of pendulum, that is hung under the drone’s body. I am still not sure where and how can I do that. Right now I see ros2 topics published by mavros from my gazebo simulation like coordinates of the drone’s body, but I don’t know, from where it is coming from. Could somebody provide me some tutorial or advice how can I proceed.

Thank you very much.