Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 314

rosserial: How do I make a subscriber read the newest message of a topic?

$
0
0
How do I make a rosserial_arduino-based subscriber read the newest message of a topic? (Edit: By "newest message" I mean the message that was published most recently.) I tried to set the queue size of the subscriber to 1, but I couldn't find the string "queue" in the ros_lib Arduino files; and so I believe it's not a feature of rosserial_arduino. Here's an example of a rosserial_arduino subscriber from [a rosserial_arduino tutorial](http://wiki.ros.org/rosserial_arduino/Tutorials/Blink): ros::Subscriber sub("toggle_led", &messageCb ); void setup() { pinMode(13, OUTPUT); nh.initNode(); nh.subscribe(sub); }

Viewing all articles
Browse latest Browse all 314


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>