Пример #1
0
        public Vector3[] GetPointCloud()
        {
            const int MAX_POINT_COUNT = 500;



            float[]  m_data = new float[MAX_POINT_COUNT * 3];
            GCHandle dataObject;
            IntPtr   dataInptr;

            dataObject = GCHandle.Alloc(m_data, GCHandleType.Pinned);
            dataInptr  = dataObject.AddrOfPinnedObject();
            int len = 0;

            PointCloudSo.get_point_cloud(out len, dataInptr);
            Vector3[] points  = new Vector3[len];
            int[]     indices = new int[len];

            for (int j = 0; j < len; j++)
            {
                // points
                points[j].x = m_data[3 * j];
                points[j].y = m_data[3 * j + 1];
                points[j].z = m_data[3 * j + 2];
                //index
                indices[j] = j;

                //  Debug.Log("m_points [" + j + "]" + Vector3ToString(points[j]));
            }
            return(points);
        }
Пример #2
0
 public bool StartSlam()
 {
     return(PointCloudSo.start_slam());
 }
Пример #3
0
 public int  SlamInt()
 {
     return(PointCloudSo.slam_init());
 }
Пример #4
0
 public bool ModeSwitch(bool mode)
 {
     return(PointCloudSo.mode_switch(mode));
 }
Пример #5
0
 public bool StopSlam()
 {
     return(PointCloudSo.stop_slam());
 }