First, I will reprint the guide I linked you to in another message for launching RealSense with ROS in an RVIZ environment, as the original message was too old for the forum to display the update on the forum's front page and others may benefit from it.
I'll also link back to your other message to help other people who are reading this and may wish to offer advice.
Regarding your question here: if you are using Ubuntu with an SR300 then Librealsense - which you said that you have already successfully installed in your other message - would be the correct choice.
As you are new to the SR300 and ROS, rather than diving straight into the deep end with depth sensing, I would recommend trying the Librealsense example program cpp-capture first. This displays four boxes on your screen with RGB, depth and IR streams in them.
You can generate pre-built 'binary' versions of the samples that can be run. Although I have not tried it myself, the process is apparently to:
1. Navigate to the root folder of Librealsense
2. Use this instruction:
make && sudo make install
3. You should then be able to find the demos, samples and tests in the folder called /usr / local / bin
Thank you for you suggestion, that helps me a lot!
By now, I have tried the example/.cpp-capture. But I still dont know how to use SR300 to do face recognition on ROS, Ubuntu 14.04 system.
Because the released RealSense SDK for face Rcongnition and Tracking is only for Windows, as far as I find out.
So I am not sure whether I can do it on Ubuntu. Can you give me some soggestions?
Thanks a lot,
ROS has a face recognition module, though it seems to be designed for general webcams rather than RealSense specifically. That is not necessarily a problem, since RealSense F200 and SR300 cameras can act as an ordinary RGB webcam too.
Thanks a lot, Marty!Sorry for replying late because the system miscategorized this email as a spam so I did not find it until today I clear my mailbox.
And may I ask you another question?
I have successfully run RViz to detect depth image by using SR300 camera. But I really don't know how to export the depth image data to a file(like distance, pixels, height, width...)
Do you have any suggestion?
If you are using Librealsense, your main option for exporting RealSense data to a file is likely to be to create a .mat format file in conjunction with OpenCV.
Thanks. I do think OpenCV mat is enough for me since I can put it straightly into OpenCV model and run the models.
And the key point is, how can I get the OpenCV mat? By now, what I have is only show depth image on RViz but I have no idea how to see the image data behind the image.
So could you please give me some suggestions?
Apologies for the delay in responding. It is difficult to find easy to understand resources about converting a RealSense image to OpenCV .mat. In previous discussions about OpenCV mat, the link below has been recommended more than once as an easy introduction, and has a link to a YouTube tutorial .
Thank you for the reply.
Just saw the video, does the rviz on ROS only can present a visualization of the depth image? It means there is no way to connect rviz with OpenCV mat and what I can only do is just forget the rviz and use other ways like C++ code to get depth image data.
Is what I think right?
Rviz is a topic that is largely outside of my knowledge. You may find some useful insight in this document though that discusses its use with RealSense.
It is formatted as one long web page, so to find the RealSense section with the Rviz info quickly, do a page find for the world 'realsense'.
Here's an image grab from the RealSense section for your easy reference
Regarding recording to a local file, please see this page.
The new SR300-compatible RealSense SDK 2.0 that was released this week also has record and playback built into it.
Regarding taking a static snapshot, this Librealsense tutorial may help.
I am not aware of a specific Python function for RealSense data export. You can though use Python with Librealsense in general using the Pyrealsense wrapper. It comes with an example for capturing still color with matplotlib.