Giter Site home page Giter Site logo

Comments (6)

Myzhar avatar Myzhar commented on May 31, 2024 1

Hi @Hi-Zed
we noted the issue.
I will test it in the next few days to fix the problem.

from zed-open-capture.

github-actions avatar github-actions commented on May 31, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment otherwise it will be automatically closed in 5 days

from zed-open-capture.

Myzhar avatar Myzhar commented on May 31, 2024

Planned (to not close).

from zed-open-capture.

ab3nd avatar ab3nd commented on May 31, 2024

I'm doing literally the exact same thing (ROS1 wrapper for a non-CUDA system) and getting the exact same fault in the same place when I try to update the CameraInfo before posting the messages.

My code initially loads the camera calibration information, and saves it in two CameraInfo messages, l_info and r_info. Once it's in the capture loop, what it was trying to do was update the timestamps on l_info and r_info and then ship them. Why this crashes the sl_oc::sensors::SensorCapture::updateTimestampOffset function in a different thread is still obscure to me.

However, if you create a sensor_msgs::CameraInfoPtr to the camera info, update the stamps and frame_ids through that, and then publish the CameraInfoPtr, things appear to operate smoothly.

    while(ros::ok)
    {
        const sl_oc::video::Frame frame = cap.getLastFrame();
        if (frame.data != nullptr)
        {
            // Image is YUV 4:2:2, convert to rgb
            cv::Mat frameYUV = cv::Mat(frame.height, frame.width, CV_8UC2, frame.data);
            cv::Mat frameBGR;
            cv::cvtColor(frameYUV, frameBGR, cv::COLOR_YUV2BGR_YUYV);
            // Split into two images
            left_raw = frameBGR(cv::Rect(0, 0, frameBGR.cols / 2, frameBGR.rows));
            right_raw = frameBGR(cv::Rect(frameBGR.cols / 2, 0, frameBGR.cols / 2, frameBGR.rows));
            
            // Create ROS message and publish it
            sensor_msgs::ImagePtr l_msg = cv_bridge::CvImage(std_msgs::Header(), "bgr8", left_raw).toImageMsg();
            sensor_msgs::ImagePtr r_msg = cv_bridge::CvImage(std_msgs::Header(), "bgr8", right_raw).toImageMsg();
            
            ros::Time now = ros::Time::now();
            l_msg->header.stamp = now;
            r_msg->header.stamp = now;
            r_msg->header.frame_id = "zed_right";
            l_msg->header.frame_id = "zed_left";
            
            sensor_msgs::CameraInfoPtr l_info_ptr = boost::make_shared<sensor_msgs::CameraInfo>(l_info);
            sensor_msgs::CameraInfoPtr r_info_ptr = boost::make_shared<sensor_msgs::CameraInfo>(r_info);

            l_info_ptr->header.stamp = now;
            r_info_ptr->header.stamp = now;
            l_info_ptr->header.frame_id = "zed_left";
            r_info_ptr->header.frame_id = "zed_right";

            l_image_pub.publish(l_msg);
            l_info_pub.publish(l_info_ptr);
            r_image_pub.publish(r_msg);
            r_info_pub.publish(r_info);
        }
        ros::spinOnce();
    }

from zed-open-capture.

Myzhar avatar Myzhar commented on May 31, 2024

I suppose it's a udev rule issue.
The sensor module cannot access the sensors data and for some reason (to be verified) it crashes.
In the udev folder you can find the udev rules file and a script to install it

from zed-open-capture.

github-actions avatar github-actions commented on May 31, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment otherwise it will be automatically closed in 5 days

from zed-open-capture.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.