Working off of PX4 v1.10.2, I attempted to subscribe to a uORB topic from mixer_multirotor.cpp by including the uORB::Subscription class in mixer.h, but I got an “undefined reference to function” when trying to create a Subscription object.
I added these headers to mixer.h:
…and added this private field to the MultirotorMixer class description in mixer.h:
This is the same way CollisionPrevention.hpp retrieves various uORB topic data.
I expected the code to compile with these additions so I could then use Subscription::updated() and Subscription::copy() to retrieve the data. This works in CollisionPrevention.cpp.
/…/src/modules/uORB/Subscription.hpp:66: undefined reference to `uORB::Subscription::subscribe()’
/…/src/modules/uORB/Subscription.hpp:71: undefined reference to `uORB::Subscription::unsubscribe()’
Any help would be great. Also, if you know a more elegant way to add this uORB data, feel free to let me know in detail.