Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscribing filter_state #71

Open
Sriherams opened this issue Dec 9, 2015 · 1 comment
Open

Subscribing filter_state #71

Sriherams opened this issue Dec 9, 2015 · 1 comment

Comments

@Sriherams
Copy link

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?

@whatgit
Copy link

whatgit commented Dec 10, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants