none
_E_PENDING The data necessary to complete this operation is not yet available._HRESULT RRS feed

  • Question

  • Hello,

     I got this message when debugging a console application with Kinect v2 in C++,  I don't know if anyone can help me. Thank you before hand. 

    Code:

    This message is when I tryed to get a frame(line is underlined and bold in code).

    int _tmain(int argc, _TCHAR* argv[])
    {
    IKinectSensor * sensor=nullptr ;
    std::cout << sensor << std::endl;
    IBodyFrameSource *body_source=nullptr;
    IBodyFrameReader* body_reader=nullptr;
    //IBodyFrame *b_frame = nullptr;
    IBodyFrame *b_frame= nullptr ;
    HRESULT hr;
    BOOLEAN *status= false;
    ICoordinateMapper *mapper;
    IBody *bodies[BODY_COUNT]={0};//CAN READ UP TO 6 BODIES

    //sensor initialization
    hr= GetDefaultKinectSensor(&sensor);

    if (FAILED(hr))
    return -1;

    //open the sensor to futher use


    hr = sensor->Open();
    if (FAILED(hr))
    {
    std::cout << "Failed to open the sensor!" << std::endl;
    return -1;
    }

    //sensor->get_CoordinateMapper(&mapper);

    std::cout <<"sensor open: "<< hr << std::endl;

    sensor->get_BodyFrameSource(&body_source);
    hr= body_source->OpenReader(&body_reader);
    std::cout << "source open reader: " << hr << std::endl;
    if (!body_reader || FAILED(hr))return -1;

    std::cout << "body Reader: " << body_reader << std::endl;

    hr = body_reader->AcquireLatestFrame(&b_frame);
    // hr = body_reference->AcquireFrame(&b_frame);
    //body_source->Release();

    if (sensor)std::cout << "this lane is not supposed to be printed" <<
    "if sensor is connected but it does eitherway!" << std::endl;
    //finish sensor initialization
    //After bodyFrame data is stored the frame shoud be released

    //if (SUCCEEDED(hr))std::cout << "now Start collecting and showing the data" << std::endl;



    std::cout <<"hr: "<<hr
    << std::endl;
    if (SUCCEEDED(hr))
    {
    std::cout << "get a frame" << std::endl;
    b_frame->GetAndRefreshBodyData(_countof(bodies), bodies);
    std::cout << "Bodies: " << _countof(bodies) << std::endl;
    }

    std::cin.get();

    return 0;
    }

    Sunday, October 25, 2015 5:21 PM

All replies

  • As far as I know, you don't get valid data every frame. In C# at least one out of three ticks will get null data from the sensor. You just ignore it and move on.

    You're supposed to be getting frames every 33ms but your application works at lower ms therefore you either get null or the last cached frame.

    Friday, July 13, 2018 8:11 AM