tum_ardrone icon indicating copy to clipboard operation
tum_ardrone copied to clipboard

Subscribing filter_state

Open Sriherams opened this issue 9 years ago • 1 comments

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?

Sriherams avatar Dec 09 '15 09:12 Sriherams

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

whatgit avatar Dec 10 '15 10:12 whatgit