How do I export Point Cloud Data (Project Tango)?

后端 未结 5 945
孤街浪徒
孤街浪徒 2020-12-03 05:46

Just got a Project Tango Development Kit tablet and have worked through some of the demos and examples.

Some older blog posts use the log files from a "Tango Map

5条回答
  •  北海茫月
    2020-12-03 06:32

    Go take a look at the Java Point Cloud sample on GitHub - The function you want to look at is onXyzIsAvailable in PointCloudActivity. Extracting a few relevant lines....

    public void onXyzIjAvailable(final TangoXyzIjData xyzIj) {
    ....
                   byte[] buffer = new byte[xyzIj.xyzCount * 3 * 4];
                   FileInputStream fileStream = new FileInputStream(
                            xyzIj.xyzParcelFileDescriptor.getFileDescriptor());
                    try {
                        fileStream.read(buffer,
                                xyzIj.xyzParcelFileDescriptorOffset, buffer.length);
                        fileStream.close();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
    

    At this point buffer contains the point cloud data - I would strongly recommend you ship this off the device via a binary service call, as I think making the poor thing try and convert it to JSON or XML would make things slower than you would like

提交回复
热议问题