Skip to content

Example 4: creating SA Readers and Writers with CPP using the sam_helpers

jmessias edited this page Jun 29, 2015 · 1 revision
#include <sam_helpers/writer.h>
#include <sam_helpers/reader.h>

//NOTE: For writers, you must specify the message type at construction.
SAMWriter<std_msgs::Float64> we("Slot E");

//You can then publish to the writer as you would to a ROS Publisher.

//Reader creation:
SAMReader ra("Slot A", callback);

//Reader creation for a specific slot of a given group
SAMReader rp("Predicate", ”mbot01”, callback_p);