Items with no label
3335 Discussions

Issues while using two realsense

bxie2
Beginner
2,125 Views

I'm using two realsense on my board(nvidia TX1), an R200 and an SR300. Open the librealsense exmaple cpp-multicam, the default resolution is 640X480, averything goes will.

In my application, we want use the 1080P resolution, so I change it and rebuild cpp-multicam.cpp(RGB:1080P, Depth:640x480)

At this time, the R200 RGB data occures incorrect, see below:

Summary:

  • I tried using above two camera with my PC(thinkPad T460 with two standalone USB3.0 port), this problem also not disappeared, but the R200 image is better than on TX1 board.
  • While I using two R200 with 1080P, this problem is the same.
  • While I using only one R200 with 1080P plus 640X480 depth on TX1 board, the R200 RGB data sometimes not correct, but much better than two realsense.
  • I've confirmed that the source image from librealsense is incorrect by saving the date after read date .
  • TX1 board kernel version 3.10.96 with UVC module pached
  • PC kernel version is 4.4 and installed with official guides
  • below is a correct picture for R200:

Any help will be appreciated!

0 Kudos
8 Replies
idata
Employee
377 Views

Hello bauer.xxxxx,

 

 

Thanks for reaching out!

 

 

You are using librealsense on your project, right? I'm asking since you are on Ubuntu but also using both a R200 and a SR300 at the same time.

 

 

This is a very specific issue since it is only happening when using both cameras and capturing at 1080p. If you are indeed using librealsense I would suggest you to submit an issue in librealsense's github ( https://github.com/IntelRealSense/librealsense/issues), there you might be able to communicate directly to its developers and inform them of this specific scenario.

 

 

Keep us updated.

 

Pedro M.
0 Kudos
idata
Employee
377 Views

I was checking your post again and I notice that I've overlooked the fact that you are using an Nvidia TX1. This board doesn't have an Intel processor, therefore, it is not officially supported by the RealSense cameras. Due to this we won't be able to help you with the issue described above on your board.

Nevertheless, you also reported that the same issue is happening with the Thinkpad T460, we would like to reproduce what you are describing to see if we get a similar result on our end.

Could you please provide us the code you are using on your project? Once we have it we'll try to replicate the issue and get back to you.

We'll be waiting for your response.

 

Pedro M.
0 Kudos
bxie2
Beginner
377 Views

Hi, Pedro.

Thanks a lot for you advise.

Here is my code. I only changed the two highlight line.

// License: Apache 2.0. See LICENSE file in root directory.

 

// Copyright(c) 2015 Intel Corporation. All Rights Reserved.

# include

 

# include "example.hpp"

# include

 

# include

std::vector buffers;

int main(int argc, char * argv[]) try

 

{

 

rs::log_to_console(rs::log_severity::warn);

 

//rs::log_to_file(rs::log_severity::debug, "librealsense.log");

rs::context ctx;

 

if(ctx.get_device_count() == 0) throw std::runtime_error("No device detected. Is it plugged in?");

 

 

// Enumerate all devices

 

std::vector devices;

 

for(int i=0; i  {

 

devices.push_back(ctx.get_device(i));

 

}

// Configure and start our devices

 

for(auto dev : devices)

 

{

 

std::cout << "Starting " << dev->get_name() << "... ";<p>  dev->enable_stream(rs::stream::depth, 640, 480, rs::format::z16, 30);

 

dev->enable_stream(rs::stream::color, 1920, 1080, rs::format::rgb8, 30);

 

//dev->enable_stream(rs::stream::depth, rs::preset::best_quality);

 

//dev->enable_stream(rs::stream::color, rs::preset::best_quality);

 

dev->start();

 

std::cout << "done." << std::endl;<p>  }

// Depth and color

 

buffers.resize(ctx.get_device_count() * 2);

// Open a GLFW window

 

glfwInit();

 

std::ostringstream ss; ss << "CPP Multi-Camera Example";<p>  GLFWwindow * win = glfwCreateWindow(1280, 960, ss.str().c_str(), 0, 0);

 

glfwMakeContextCurrent(win);

int windowWidth, windowHeight;

 

glfwGetWindowSize(win, &windowWidth, &windowHeight);

// Does not account for correct aspect ratios

 

auto perTextureWidth = int(windowWidth / devices.size());

 

auto perTextureHeight = 480;

while (!glfwWindowShouldClose(win))

 

{

 

// Wait for new images

 

glfwPollEvents();

 

 

// Draw the images

 

int w,h;

 

glfwGetFramebufferSize(win, &w, &h);

 

glViewport(0, 0, w, h);

 

glClear(GL_COLOR_BUFFER_BIT);

 

 

glfwGetWindowSize(win, &w, &h);

 

glPushMatrix();

 

glOrtho(0, w, h, 0, -1, +1);

 

glPixelZoom(1, -1);

 

int i=0, x=0;

 

for(auto dev : devices)

 

{

 

dev->poll_for_frames();

 

const auto c = dev->get_stream_intrinsics(rs::stream::color), d = dev->get_stream_intrinsics(rs::stream::depth);

 

buffers[i++].show(*dev, rs::stream::color, x, 0, perTextureWidth, perTextureHeight);

 

buffers[i++].show(*dev, rs::stream::depth, x, perTextureHeight, perTextureWidth, perTextureHeight);

 

x += perTextureWidth;

 

}

glPopMatrix();

 

glfwSwapBuffers(win);

 

}

glfwDestroyWindow(win);

 

glfwTerminate();

 

return EXIT_SUCCESS;

 

}

 

catch(const rs::error & e)

 

{

 

std::cerr << "RealSense error calling " << e.get_failed_function() << "(" << e.get_failed_args() << "):\n " << e.what() << std::endl;<p>  return EXIT_FAILURE;

 

}

 

catch(const std::exception & e)

 

{

 

std::cerr << e.what() << std::endl;<p>  return EXIT_FAILURE;

 

}
0 Kudos
idata
Employee
377 Views

Thank you for providing us the code. We will try to see if we can replicate the issue and come back to you.

 

 

Pedro M.
0 Kudos
idata
Employee
377 Views

Hi bauer.xxxxx,

 

 

We've been running some tests with you code and we have not been able to see the same results as you. Please check the screenshot below:

 

 

I'm not sure what might be happening, I'd suggest you to try with another PC (if possible) to see if the issue persists in order to see if the issue is not environmental.

 

 

Pedro M.
0 Kudos
idata
Employee
377 Views

Hello bauer.xxxxx,

 

 

Do you have any updates about this?

 

 

Pedro M.
0 Kudos
bxie2
Beginner
377 Views

Hi Pedro,

I don't have another PC to do this test.

For this problem, I'm discussing at gihub "https://github.com/IntelRealSense/librealsense/issues/468# issuecomment-291114539 Issues while using two realsense · Issue # 468 · IntelRealSense/librealsense · GitHub ".

Unfortunately, I didn't solve it.

Thanks!

0 Kudos
idata
Employee
377 Views

I understand. Unfortunately, we are not able to replicate the behavior you are experiencing, so, I would imagine that it is probably related to your specific environment. However, if you have any news, please keep us updated. I'm sure any information you can provide will be of help for other users that are in a similar situation.

 

 

Pedro M.
0 Kudos
Reply