Ask Your Question
0

nodelet: Publisher subscriber

asked 2016-11-02 09:13:35 -0600

ROSfc gravatar image

I have seen the basic working of the nodelets and even read the instruction how to port your class to nodelet. But I don't know how to make my publisher subscriber nodes into nodelet. Once of the instruction is delete the main() and put the constructor into the init(). So then where does the publisher while loop go then ? and where is my subscriber supposed to do the callback ? I am completely confused. Does anyone have a minimum working example for publisher subscriber nodelets ? Or any tips on how to do this task ?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-11-14 09:06:21 -0600

ROSfc gravatar image

This book below has some good examples:

Mastering ROS for Robotics Programming By Lentin Joseph

To answer my own question in short, there are no while loops or spin() and spinOnce() this is taken care of by the nodelet manager.

edit flag offensive delete link more
0

answered 2016-11-02 18:38:52 -0600

JoshMarino gravatar image

Google search returned this. It has an example of both subscriber and publishers.

edit flag offensive delete link more

Comments

I have seen the link it doesn't solve either of my doubts on what to do with my ros::while loops and what happens to the subscriber and publisher spin and spinOnce. I want to have them as two separate nodelets. Anyways I will ask some friends here next week.

ROSfc gravatar imageROSfc ( 2016-11-03 11:14:16 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-11-02 09:13:35 -0600

Seen: 599 times

Last updated: Nov 14 '16