Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using T265 with any other Intel Sensor does not work anymore #5935

Closed
ArturSchuetz opened this issue Feb 27, 2020 · 6 comments
Closed

Using T265 with any other Intel Sensor does not work anymore #5935

ArturSchuetz opened this issue Feb 27, 2020 · 6 comments

Comments

@ArturSchuetz
Copy link

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 ArturSchuetz changed the title Usin Using T265 with any other Intel Sensor does not work anymore Feb 27, 2020
@korzen
Copy link

korzen commented Feb 28, 2020

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

@stino78
Copy link

stino78 commented Mar 8, 2020

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

Can you help us with the problem?

@andreaszwengINS
Copy link

andreaszwengINS commented Mar 10, 2020

I have the exact same problem.

T265, D415
Linux Mint 19.3
Kernel 5.3
v2.33.1

@leochien1110
Copy link

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

@andreaszwengINS
Copy link

andreaszwengINS commented Mar 12, 2020

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.

@RealSenseSupport
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants