librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

Using T265 with any other Intel Sensor does not work anymore

Open ArturSchuetz opened this issue 6 years ago • 6 comments

Required Info
Camera Model T265
Firmware Version 0.2.0.926
Operating System & Version Ubuntu 18.04.4 LTS
Kernel Version (Linux Only) (e.g. 4.14.13)
Platform PC
SDK Version 2.32.1
Language C++
Segment others

Issue Description

I have two code examples added: The first one works perfectly fine while the second does not. But in order to use multiple cameras and a T265, I need to use the second approach. It worked for a previous SDK version but after an update it broke.

This is the error I get for the second example: rs2_pipeline_start_with_config_and_callback_cpp(pipe:0x558422e41460, config:0x558422e39b60, callback:0x558422e26de0): No device connected

adding this line returns the same error: cfg.enable_device(dev.get_info(RS2_CAMERA_INFO_SERIAL_NUMBER));

#include <librealsense2/rs.hpp>

#include <iostream>
#include <thread>
#include <mutex>

std::mutex g_data_mutex;

int main(int /*argc*/, char* /*argv*/[])
{
    rs2::context context;

    // Declare RealSense pipeline, encapsulating the actual device and sensors
    rs2::pipeline pipe(context);

    // Create a configuration for configuring the pipeline with a non default profile
    rs2::config cfg;

    cfg.enable_stream(RS2_STREAM_POSE, RS2_FORMAT_6DOF);

    try
    {
        auto callback_Tracking = [&](const rs2::frame& frame)
        {
            std::lock_guard<std::mutex> lock(g_data_mutex);

            if (auto fp = frame.as<rs2::pose_frame>()) {
                auto pose_data = fp.get_pose_data();
                std::cout << pose_data.rotation.x << ", " << pose_data.rotation.y << ", " << pose_data.rotation.z << ", " << pose_data.rotation.w << std::endl;
            }
        };
        pipe.start(cfg, callback_Tracking);
    }
    catch (const rs2::error & e)
    {
        std::cerr << "RealSense error calling: " << e.get_failed_function() << "(" << e.get_failed_args() << "):\n    " << e.what() << std::endl;
    }
    catch (const std::exception& e)
    {
        std::cerr << e.what() << std::endl;
    }

    std::this_thread::sleep_for(std::chrono::milliseconds(1000));
    return 0;
}
#include <librealsense2/rs.hpp>

#include <iostream>
#include <thread>
#include <mutex>

std::mutex g_data_mutex;

int main(int /*argc*/, char* /*argv*/[])
{
    rs2::context context;

    for(auto&& dev: context.query_devices())
    {
        std::string TrackingCameraName = "Intel RealSense T";
        if (std::string(std::string(dev.get_info(RS2_CAMERA_INFO_NAME)).substr(0, TrackingCameraName.length())).compare(TrackingCameraName) == 0)
        {
            rs2::config cfg;

            // Declare RealSense pipeline, encapsulating the actual device and sensors
            rs2::pipeline pipe(context);

            cfg.enable_stream(RS2_STREAM_POSE, RS2_FORMAT_6DOF);

            try
            {
                auto callback_Tracking = [&](const rs2::frame& frame)
                {
                    std::lock_guard<std::mutex> lock(g_data_mutex);

                    if (auto fp = frame.as<rs2::pose_frame>()) {
                        auto pose_data = fp.get_pose_data();
                        std::cout << pose_data.rotation.x << ", " << pose_data.rotation.y << ", " << pose_data.rotation.z << ", " << pose_data.rotation.w << std::endl;
                    }
                };
                pipe.start(cfg, callback_Tracking);
            }
            catch (const rs2::error & e)
            {
                std::cerr << "RealSense error calling: " << e.get_failed_function() << "(" << e.get_failed_args() << "):\n    " << e.what() << std::endl;
            }
            catch (const std::exception& e)
            {
                std::cerr << e.what() << std::endl;
            }
        }
    }

    std::this_thread::sleep_for(std::chrono::milliseconds(1000));
    return 0;
}

ArturSchuetz avatar Feb 27 '20 15:02 ArturSchuetz

I can confirm the issue, neither rs-multicam nor rs-tracking-and-depth examples from the development branch work. The cameras work fine together in the viewer so its most likely the never ending story of the t265 initialization along with d4x5 camera...

RealSense error calling rs2_pipeline_start_with_config(pipe:0x5608b46230e0, config:0x5608b4470ac0):
    No device connected

Linux ubuntu-desktop 5.3.0-40-generic #32~18.04.1-Ubuntu x86_64 D415 FW 05.12.02.100 T265 FW 0.2.0.926 development branch - default cmake config

2020-02-28-08_31_24.log

korzen avatar Feb 28 '20 07:02 korzen

I have the exact same problem in Python, using the last lib realsense 2.33.1.1370

Can you help us with the problem?

stino78 avatar Mar 08 '20 00:03 stino78

I have the exact same problem.

T265, D415 Linux Mint 19.3 Kernel 5.3 v2.33.1

andreaszwengINS avatar Mar 10 '20 13:03 andreaszwengINS

I have the same issue with D435 and T265, Ubuntu18.04, v2.33.1

leochien1110 avatar Mar 11 '20 05:03 leochien1110

I could fix the problem for me. I had enable_device and enable_stream in my code for every device. I removed enable_device and it works better than ever before. Maybe this method never worked correctly? Thats why rs-multicam also does not work anymore. We use one t265 in combination with one D415. Not a proper workaround, but this is the reason, it stopped working for us.

EDIT: I would like to add, that we search for the camera name t265 and d415 and set the streams accordingly. This way, we always set the correct streams for the cameras.

andreaszwengINS avatar Mar 12 '20 15:03 andreaszwengINS

Thank you for highlighting this issue while using T265 with other RealSense products. We have moved our focus to our next generation of products and consequently, we will not be addressing this issue with the T265 other than the already completed PRs.

RealSenseSupport avatar Sep 11 '20 19:09 RealSenseSupport