Items with no label
3335 Discussions

SR300 SDK on Ubuntu 14.04

RLi23
Beginner
3,779 Views

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 Kudos
1 Solution
MartyG
Honored Contributor III
1,577 Views

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

View solution in original post

0 Kudos
28 Replies
MartyG
Honored Contributor III
1,578 Views

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 Kudos
RLi23
Beginner
1,054 Views

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 Kudos
MartyG
Honored Contributor III
1,052 Views

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 Kudos
RLi23
Beginner
1,054 Views

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 Kudos
MartyG
Honored Contributor III
1,054 Views

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 Kudos
RLi23
Beginner
1,054 Views

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 Kudos
MartyG
Honored Contributor III
1,054 Views

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 Kudos
RLi23
Beginner
1,054 Views

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 Kudos
MartyG
Honored Contributor III
1,054 Views

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 Kudos
RLi23
Beginner
1,054 Views

Thanks a lot.

I will try it.

0 Kudos
RLi23
Beginner
1,054 Views

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 Kudos
MartyG
Honored Contributor III
1,054 Views

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 Kudos
RLi23
Beginner
1,054 Views

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 Kudos
MartyG
Honored Contributor III
1,054 Views

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 Kudos
RLi23
Beginner
1,054 Views

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 Kudos
MartyG
Honored Contributor III
1,054 Views

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 Kudos
RLi23
Beginner
1,054 Views

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

So what should I do to fix this problem?

0 Kudos
MartyG
Honored Contributor III
1,054 Views

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

sudo modprobe uvcvideo

0 Kudos
RLi23
Beginner
1,054 Views

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

0 Kudos
MartyG
Honored Contributor III
980 Views

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 Kudos
Reply