Demonstrate how to read analogue data with RoNeX. More...
#include <string>
#include <ros/ros.h>
#include <ros/console.h>
#include <boost/lexical_cast.hpp>
#include "sr_ronex_msgs/GeneralIOState.h"
#include "sr_ronex_utilities/sr_ronex_utilities.hpp"
Go to the source code of this file.
Classes | |
class | SrRonexFindGeneralIOModule |
Functions | |
void | generalIOState_callback (const sr_ronex_msgs::GeneralIOState::ConstPtr &msg) |
int | main (int argc, char **argv) |
Demonstrate how to read analogue data with RoNeX.
Definition in file sr_ronex_read_analog_data.cpp.
void generalIOState_callback | ( | const sr_ronex_msgs::GeneralIOState::ConstPtr & | msg | ) |
The callback function given to the subscribe() call.
msg | A const pointer to a message of type sr_ronex_msgs::GeneralIOState. |
Definition at line 104 of file sr_ronex_read_analog_data.cpp.
int main | ( | int | argc, |
char ** | argv | ||
) |
This class demonstrates how to read analogue data with RoNeX.
The subscribe() call is how you tell ROS that you want to receive messages on a given topic. Messages are passed to a callback function. The second parameter to the subscribe() function is the size of the message queue.
ros::spin() will enter a loop, pumping callbacks. With this version, all callbacks will be called from within this thread (the main one). ros::spin() will exit when Ctrl-C is pressed, or the node is shutdown by the master.
Definition at line 117 of file sr_ronex_read_analog_data.cpp.