0
$\begingroup$

Rosanswers logo

Hello, all,

Since I want to do the processing toward the IR and RGB data from Kinect in one node, I need to build two subscribers and then iteratively subscribing the IR and RGB data published by openni_node within the openni_camera_unstable package. (Due to the limitation of Kinect:Cannot stream RGB and IR at the same time.) But I have no idea how to code that out. Is there anyone would like to give me any advice or samples? Thanks a lot!


Originally posted by walonchiu on ROS Answers with karma: 11 on 2011-05-24

Post score: 0


Original comments

Comment by ROSkinect on 2014-06-23:
Hi walonchiu, I wanna ask you if you can send me the code that you use to subscribe to IR camera topic ? Thank you

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The openni driver does not allow streaming both ir and rgb at the same time, but there is a way to switch between ir mode and rgb mode. The driver looks at the number of subscribers on the rgb and ir topics, and based on the number of subscribers decides to enable ir mode or rgb mode. When you have one or more subscribers to the rgb topic, the driver will be in rgb mode, independent of the number of subscribers to the ir topic. When you have zero subscribers to the rgb topic and one or more subscribers to the ir topic, the driver will be in ir mode.

To implement this, you can use the ros::topcic::WaitForMessage method. This method will subscribe to a topic, receive one message, and then unsubscribe from the topic. So you can call this method sequentially on the rgb and the ir topic to switch between rgb/ir mode and receive rgb/ir images.


Originally posted by Wim with karma: 2915 on 2011-06-17

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.