subscribe to temperature sensor and humidity sensor messages fails to link [closed]
Hi All,
I am using ros indigo on Ubuntu 14.04 on an intel i7 platform. I am trying to subscribe to a sensor that is publishing two messages , temperature and humidity. On my subscriber I am using approximate time sync feature to get both messages. I am having trouble linking the code. I guess a fresh pair of eyes could help.
publisher is publishing messages of type : sensor_msgs::Temperature and sensor_msgs::RelativeHumidity.
On subscriber I have the following :
define TEMP_SENSOR_MSG_TYPE sensor_msgs::Temperature define RELATIVE_HUM_MSG_TYPE sensor_msgs::RelativeHumidity typedef message_filters::sync_policies::ApproximateTime<temp_sensor_msg_type,relative_hum_msg_type> AppxSyncSensor;
message_filters::Synchronizer<AppxSyncSensor> *syncApproximateSensor;
message_filters::Subscriber<TEMP_SENSOR_MSG_TYPE> *tempSubscriber;
message_filters::Subscriber<RELATIVE_HUM_MSG_TYPE> *humSubscriber;
image_transport::TransportHints hints(useCompressed ? "compressed" : "raw"); hintsM_ = hints;
tempSubscriber = new message_filters::Subscriber<TEMP_SENSOR_MSG_TYPE>(nh, tempTopicName, queueSize);
humSubscriber = new message_filters::Subscriber<RELATIVE_HUM_MSG_TYPE>(nh, humTopicName, queueSize);
syncApproximateSensor = new message_filters::Synchronizer<AppxSyncSensor>(AppxSyncSensor(queueSize), *tempSubscriber, *humSubscriber);
syncApproximateSensor->registerCallback(boost::bind(&Receiver::sensorDataCallback,this,_1,_2));
Error: attached log file.C:\fakepath\error_logs_temp_sensor.bmp
-Cheers cn
What is this a duplicate of?
Hi, Just that the callback signature needs to be of the type sensor_msgs::TemperatureConsPtr, instead of just sensor_msgs::Temperature. Saw that in some of the questions posted adjacent to this thread.