Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

For anyone else who might need to do this:

In CMakeLists.txt I had (among other things):

find_package(catkin REQUIRED COMPONENTS    

In package.xml I added:




And in my C++ file I had (among other things):

#include "ros_arduino_msgs/Digital.h"

int start_val = 0;

void start(const ros_arduino_msgs::DigitalConstPtr& msg) {
    start_val = msg->value;

int main(int argc, char * argv[]) {
    ros::init(argc, argv, "test_node");

    ros::NodeHandle nh;
    ros::Subscriber start_sub = nh.subscribe("/arduino/sensor/start_led",1,start);

    while(start_val==0) {

    //do other things

I was just using this within another program to make sure it didn't start until one of my LED values was 1.