Items with no label
3338 Discussions

SR300 SDK on Ubuntu 14.04

RLi23
Débutant
7 231 Visites

I am using SR300 camera on ROS Indigo, Ubuntu 14.04. The question is I can not find any kind of SDK fit my environment. Could someone help me?

Also, I have no idea how to use it to calculate the depth and do object tracking work, could anyone give me some suggestions or give me some tutorials?

Thanks a lot.

0 Compliments
1 Solution
MartyG
Contributeur émérite III
5 029 Visites

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.

https://robolady.wordpress.com/2016/11/27/running-intel-realsense-r200-ros-nodelet-and-rviz/ Running Intel RealSense R200 ROS nodelet and RViz – Robotics. And other stuff too.

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.

https://github.com/IntelRealSense/librealsense/blob/master/examples/cpp-capture.cpp librealsense/cpp-capture.cpp at master · IntelRealSense/librealsense · GitHub

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

Voir la solution dans l'envoi d'origine

0 Compliments
28 Réponses
MartyG
Contributeur émérite III
5 030 Visites

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.

https://robolady.wordpress.com/2016/11/27/running-intel-realsense-r200-ros-nodelet-and-rviz/ Running Intel RealSense R200 ROS nodelet and RViz – Robotics. And other stuff too.

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.

https://github.com/IntelRealSense/librealsense/blob/master/examples/cpp-capture.cpp librealsense/cpp-capture.cpp at master · IntelRealSense/librealsense · GitHub

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

0 Compliments
RLi23
Débutant
3 332 Visites

Hi MartyG,

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,

Ruiqi

0 Compliments
MartyG
Contributeur émérite III
3 330 Visites

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.

http://wiki.ros.org/face_recognition face_recognition - ROS Wiki

0 Compliments
RLi23
Débutant
3 332 Visites

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?

Best regards,

Ruiqi

0 Compliments
MartyG
Contributeur émérite III
3 332 Visites

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.

https://stackoverflow.com/questions/30155587/opencv-mat-matlab-mat-file c++ - OpenCV Mat -> Matlab Mat File - Stack Overflow

0 Compliments
RLi23
Débutant
3 332 Visites

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?

0 Compliments
MartyG
Contributeur émérite III
3 332 Visites

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 .

https://software.intel.com/en-us/forums/realsense/topic/624897 converting PXCImage to Mat format

0 Compliments
RLi23
Débutant
3 332 Visites

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?

0 Compliments
MartyG
Contributeur émérite III
3 332 Visites

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.

http://apprize.info/programming/ros/9.html Programming Vision Sensors using ROS, Open-CV, and PCL - Mastering ROS for Robotics Programming (2015)

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

0 Compliments
RLi23
Débutant
3 332 Visites

Thanks a lot.

I will try it.

0 Compliments
RLi23
Débutant
3 332 Visites

Hi Marty,

Thank you for your suggestion. I have tried and another problem raised, how can I save the depth image captured by the real sense camera SR300 to my local file? Also, how to take photos using real sense camera since it is like for video?

Regards,

Richie

0 Compliments
MartyG
Contributeur émérite III
3 332 Visites

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.

https://github.com/IntelRealSense/librealsense/tree/development GitHub - IntelRealSense/librealsense at development

Regarding taking a static snapshot, this Librealsense tutorial may help.

https://github.com/IntelRealSense/librealsense/blob/zr300_documentation/doc/stepbystep/getting_started_with_openCV.md librealsense/getting_started_with_openCV.md at zr300_documentation · IntelRealSense/librealsense · GitHub

0 Compliments
RLi23
Débutant
3 332 Visites

Thank you, Marty.

It seems that most of the code is written in C++. Is there any function or library in Python can do the data export work? Export the image captured by real sense camera as jpg or some other image files.

0 Compliments
MartyG
Contributeur émérite III
3 332 Visites

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.

https://github.com/toinsson/pyrealsense GitHub - toinsson/pyrealsense: Cross-platform ctypes/Cython wrapper to the librealsense library -

0 Compliments
RLi23
Débutant
3 332 Visites

Hi Marty,

Thank you for your kindly assistance.

But now, new problem occured. When I start the camera to capture RGB images, it always shows green mosaic on the screen. How it can be like this? Is my camera broken ?

0 Compliments
MartyG
Contributeur émérite III
3 332 Visites

Does it look like the image on this page, where someone with an SR300 had problems with their color stream in Librealsense?

https://www.bountysource.com/issues/38477245-color-stream-does-not-work Bountysource

0 Compliments
RLi23
Débutant
3 332 Visites

Yes, exactly the same problem when connecting Ros librealsense then run cop-capture.

So what should I do to fix this problem?

0 Compliments
MartyG
Contributeur émérite III
3 332 Visites

One of the leaders of Librealsense, ddiakopoulos ,recommended re-running the patch script and then afterwards doing the instruction

sudo modprobe uvcvideo

0 Compliments
RLi23
Débutant
3 332 Visites

Thanks for your suggestion, but it still did not fix the problem after I tried this method.

0 Compliments
MartyG
Contributeur émérite III
3 258 Visites

Apologies for the delay in responding to your latest message. I was carefully considering the best way to help you.

I have observed that for some Librealsense users, they may find that a particular sample program has problems such as the one that you have with the RGB, whilst other samples work perfectly. I would advise trying another sample that uses an RGB stream to see whether the problem is with the camera or with the sample program.

0 Compliments
Répondre