tum_ardrone
tum_ardrone copied to clipboard
Subscribing filter_state
How to subscribe the topic tum_ardrone/filter_state in a program?
What are the dependencies, header files that are need to be added with my program?
This is from the code I wrote almost about 2-3 years ago, I'm not sure it still works with current version of things. For example, I subscribed to "ardrone/predictedPose" topic by the code below.
the header file (I'm not sure about the include section, I have more but I think only ros.h is relevant here)
#include "ros/ros.h"
std::string dronepose_channel;
ros::NodeHandle nh;
ros::Subscriber subPose
In cpp file
dronepose_channel = nh.resolveName("ardrone/predictedPose");
subPose = nh.subscribe(dronepose_channel,10, &NodeGenerator::posCb, this);
I think the "posCb" is a callback function. I don't remember now