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

D455 motion Module not streaming realsense viewer #7742

Closed
noblegasses opened this issue Nov 8, 2020 · 8 comments
Closed

D455 motion Module not streaming realsense viewer #7742

noblegasses opened this issue Nov 8, 2020 · 8 comments

Comments

@noblegasses
Copy link

Required Info
Camera Model D455
Firmware Version 05.12.07.100
Operating System & Version Linux (FriendlyDesktop)
Kernel Version (Linux Only) 4.4.179
Platform NanoPi NEO4
SDK Version 2.38.1
Language C++
Segment Robot

Issue Description

I've been trying to get the motion data from the d455, and struggling. I tried using Realsense Viewer to see if I can use that for motion data, however, turning on the motion stream doesn't seem to change the Pitch, roll and yaw of the camera regardless of rotation. Furthermore, as well as some calibration errors. How do I resolve this?
motion module

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Nov 8, 2020

Hi @noblegasses You should switch the RealSense Viewer into 2D mode with the 2D option in the top corner of the Viewer to view the gyro and accel data of the Motion Module.

Are you able to view the Motion Module data successfully if you switch the Viewer to 2D mode please?

image

If you believe that you are getting incorrect values for roll, pitch and yaw from the IMU, you may find the discussion in the link below useful.

#4391

@FrankCreen
Copy link

Required Info
Camera Model D455
Firmware Version 05.12.07.100
Operating System & Version Linux (FriendlyDesktop)
Kernel Version (Linux Only) 4.4.179
Platform NanoPi NEO4
SDK Version 2.38.1
Language C++
Segment Robot

Issue Description

I've been trying to get the motion data from the d455, and struggling. I tried using Realsense Viewer to see if I can use that for motion data, however, turning on the motion stream doesn't seem to change the Pitch, roll and yaw of the camera regardless of rotation. Furthermore, as well as some calibration errors. How do I resolve this?
motion module

Hi !I test the code below with a 75FPS, could you show your result? Thanks very much!

Test Program

// include the librealsense C++ header file
#include <librealsense2/rs.hpp>

#include <opencv2/opencv.hpp>

#include <chrono>

using namespace std;
using namespace cv;

int main()
try
{
    //Contruct a pipeline which abstracts the device
    rs2::pipeline pipe;

    //Create a configuration for configuring the pipeline with a non default profile
    rs2::config cfg;
    //Add desired streams to configuration
    cfg.enable_stream(RS2_STREAM_COLOR, 480, 270, RS2_FORMAT_BGR8, 90);

    //Instruct pipeline to start streaming with the requested configuration
    pipe.start(cfg);

    //Sensor Settings
    auto sensor1 = pipe.get_active_profile().get_device().query_sensors()[1];
    sensor1.set_option(RS2_OPTION_ENABLE_AUTO_EXPOSURE, 1);
    auto sensor2 = pipe.get_active_profile().get_device().query_sensors()[1];
    sensor2.set_option(RS2_OPTION_AUTO_EXPOSURE_PRIORITY, 0);

    // Display in a GUI
    const auto window_name = "Display Video";
    namedWindow(window_name, WINDOW_AUTOSIZE);

    //用于计时
    //show time
    auto start = chrono::system_clock::now();
    int frame = 0;

    while (waitKey(1) < 0 && getWindowProperty(window_name, WND_PROP_AUTOSIZE) >= 0)
    {
        rs2::frameset data = pipe.wait_for_frames(); // Wait for next set of frames from the camera

        //获取彩色图像帧
        rs2::frame color = data.get_color_frame();

        //保存彩色图像
        Mat image(Size(480, 270), CV_8UC3, (void *)color.get_data(), Mat::AUTO_STEP);

        // Update the window with new data
        imshow(window_name, image);

        frame++;
        //one loop end
        auto end = chrono::system_clock::now();
        auto duration = chrono::duration_cast<chrono::microseconds>(end - start);
        double timecost = double(duration.count()) * chrono::microseconds::period::num / chrono::microseconds::period::den;

        cout << frame / timecost << " FPS" << endl;
    }

    return 0;
}
catch (Exception ex)
{
    cout << "Error!!!" << endl;
    cerr << ex.msg << endl;
}

@MartyG-RealSense
Copy link
Collaborator

Hi @FrankCreen Please post your question as a new issue using the New Issue button at the link below and do not post it on multiple D455 cases if the question is unrelated to that case. Thank you.

https://github.com/IntelRealSense/librealsense/issues/

@noblegasses
Copy link
Author

Hi,
thanks, the 2d view solves my issue. this might require opening a separate issue, but how do I stream this data in c++ or python? the pose stream seems to fail, as does storing the accel and gyro streams in frames.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Nov 11, 2020

Hi @noblegasses You could take a look at the SDK's rs-motion C++ example program.

https://github.com/IntelRealSense/librealsense/tree/master/examples/motion

If you plan to stream depth, color and IMU simultaneously then putting IMU on one pipeline and depth and color on a second pipeline can improve performance. The link below leads to a Python example script for this:

#6031 (comment)

@MartyG-RealSense
Copy link
Collaborator

Hi @noblegasses Do you require further assistance with this case, please? Thanks!

@noblegasses
Copy link
Author

my apologies, I don't require any further help at this time. I simply forgot to close the issue. Thanks!

@MartyG-RealSense
Copy link
Collaborator

No apologies needed - thanks very much for the update!

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

No branches or pull requests

3 participants