Question

(The "Functon" is a compiler typo not mine :P)

my question,

What I need to do, is get the pointcloud(XYZRGBA) data from pcl unmanaged C++, to C#. I do this with the following code:

Unmanaged.cpp (C++)

float* getCloud(int clr_width, int clr_height, int dpth_width, 
int dpth_height, int frameId, int clr_focal_x, int clr_focal_y, 
int dpth_focal_x, int dpth_focal_y, unsigned char *image, 
unsigned char *depth_image) const
{
    (some implementation);
}

END OF Unmanaged.cpp

.

Managed.cpp (C++)

property float[]^ Receiver
{
    float[]^ get()
    {
        return gcnew float[]( Unmanaged->getCloud((int)clr_width, 
        (int)clr_height, (int)dpth_width, (int)dpth_height, (int)frameId, 
        (int)clr_focal_x, (int)clr_focal_y, (int)dpth_focal_x, 
        (int)dpth_focal_y, (unsigned char*)image, 
        (unsigned char*)depth_image) );
    }
}

END OF Managed.cpp

What I get is the error from the title: 'Kinecter::getCloud' : this functon cannot be compiled as managed, consider using #pragma unmanaged

Does someone know how to fix this?

Btw: The suggestion: #pragma unmanaged also doesn't work :(

Was it helpful?

Solution

I fixed it, it turns out it had nothing to do with this bit of code -.-

it was the creation of the cloud which had trouble. (for PCL users)

cloud->sensor_origin_.setZero (); // BUGGY
cloud->sensor_orientation_.w () = 0.0;
cloud->sensor_orientation_.x () = 1.0;
cloud->sensor_orientation_.y () = 0.0;
cloud->sensor_orientation_.z () = 0.0;
return (cloud);

I guess I can't send a pointcloud unless I create a mirror version on C#.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top