Mavlink Custom msgs uORB::Publication issue

Hi everybody.
I was writing a code to receive some custom messages via mavlink, so, I was modifying the mavlink module on PX4 (V10.0.1), more precisely the mavlink_receiver.cpp.
Instead of using the publish scheme given in the tutorial to publish the message that is received, I use the class wrapper class publication and I created a object as below:

uORB::Publication<custom_s> _custom_pub {ORB_ID(msg_custom)}

and to publish:


The issue is that, when I try to use the code as above, the topic is never published, on the other hand, if I advertise the topic in advance, as below, it works:

orb_advertise(ORB_ID(msg_custom), &_msg_custom)
** _custom_pub.publish(_msg_custom)**

What does not make sense to me is that, the wrapper class has already methods for advertising the topic that are supposed to do that
Doe anyone has a clue of what is the trick here?

Thanks in advance

I have found the error.
I was declaring the object with uORB ID with a wrong name.
I put the correct name and it worked fine.