RTABMapLib.java
Go to the documentation of this file.
1 
2 package com.introlab.rtabmap;
3 import java.nio.ByteBuffer;
4 import java.nio.FloatBuffer;
5 
6 import android.app.Activity;
7 import android.content.Context;
8 import android.os.IBinder;
9 import android.view.KeyEvent;
10 import android.util.Log;
11 
12 
13 // Wrapper for native library
14 
15 public class RTABMapLib
16 {
17 
18  static {
19  // This project depends on tango_client_api, so we need to make sure we load
20  // the correct library first.
23  Log.w(RTABMapActivity.class.getSimpleName(), "WArning! Unable to load libtango_client_api.so! This can be safely ignored if RTAB-Map NDK is not build with tango support.");
24  }
25  System.loadLibrary("NativeRTABMap");
26  }
27 
28  // Initialize the Tango Service, this function starts the communication
29  // between the application and Tango Service.
30  // The activity object is used for checking if the API version is outdated.
31  public static native long createNativeApplication(RTABMapActivity activity);
32 
33  public static native void destroyNativeApplication(long nativeApplication);
34 
35  public static native void setScreenRotation(long nativeApplication, int displayRotation, int cameraRotation);
36 
37  public static native int openDatabase(long nativeApplication, String databasePath, boolean databaseInMemory, boolean optimize);
38  public static native int openDatabase2(long nativeApplication, String databaseSource, String databasePath, boolean databaseInMemory, boolean optimize);
39 
40  public static native boolean isBuiltWith(long nativeApplication, int cameraDriver);
41  public static native boolean startCamera(long nativeApplication, IBinder binder, Context context, Activity activity, int driver);
42  public static native void stopCamera(long nativeApplication);
43 
44  // Allocate OpenGL resources for rendering.
45  public static native void initGlContent(long nativeApplication);
46 
47  // Setup the view port width and height.
48  public static native void setupGraphic(long nativeApplication, int width, int height);
49 
50  // Main render loop.
51  public static native int render(long nativeApplication);
52 
53  // Set the render camera's viewing angle:
54  // first person, third person, or top down.
55  public static native void setCamera(long nativeApplication, int cameraIndex);
56 
57  // Pass touch events to the native layer.
58  public static native void onTouchEvent(long nativeApplication, int touchCount, int event0,
59  float x0, float y0, float x1, float y1);
60 
61  public static native void setPausedMapping(long nativeApplication, boolean paused);
62  public static native void setOnlineBlending(long nativeApplication, boolean enabled);
63  public static native void setMapCloudShown(long nativeApplication, boolean shown);
64  public static native void setOdomCloudShown(long nativeApplication, boolean shown);
65  public static native void setMeshRendering(long nativeApplication, boolean enabled, boolean withTexture);
66  public static native void setLocalizationMode(long nativeApplication, boolean enabled);
67  public static native void setTrajectoryMode(long nativeApplication, boolean enabled);
68  public static native void setGraphOptimization(long nativeApplication, boolean enabled);
69  public static native void setNodesFiltering(long nativeApplication, boolean enabled);
70  public static native void setGraphVisible(long nativeApplication, boolean visible);
71  public static native void setGridVisible(long nativeApplication, boolean visible);
72  public static native void setRawScanSaved(long nativeApplication, boolean enabled);
73  public static native void setFullResolution(long nativeApplication, boolean enabled);
74  public static native void setSmoothing(long nativeApplication, boolean enabled);
75  public static native void setDepthFromMotion(long nativeApplication, boolean enabled);
76  public static native void setCameraColor(long nativeApplication, boolean enabled);
77  public static native void setAppendMode(long nativeApplication, boolean enabled);
78  public static native void setDataRecorderMode(long nativeApplication, boolean enabled);
79  public static native void setMaxCloudDepth(long nativeApplication, float value);
80  public static native void setMinCloudDepth(long nativeApplication, float value);
81  public static native void setPointSize(long nativeApplication, float value);
82  public static native void setFOV(long nativeApplication, float value);
83  public static native void setOrthoCropFactor(long nativeApplication, float value);
84  public static native void setGridRotation(long nativeApplication, float value);
85  public static native void setLighting(long nativeApplication, boolean enabled);
86  public static native void setBackfaceCulling(long nativeApplication, boolean enabled);
87  public static native void setWireframe(long nativeApplication, boolean enabled);
88  public static native void setCloudDensityLevel(long nativeApplication, int value);
89  public static native void setMeshAngleTolerance(long nativeApplication, float value);
90  public static native void setMeshTriangleSize(long nativeApplication, int value);
91  public static native void setClusterRatio(long nativeApplication, float value);
92  public static native void setMaxGainRadius(long nativeApplication, float value);
93  public static native void setRenderingTextureDecimation(long nativeApplication, int value);
94  public static native void setBackgroundColor(long nativeApplication, float gray);
95  public static native int setMappingParameter(long nativeApplication, String key, String value);
96  public static native void setGPS(
97  long nativeApplication,
98  double stamp,
99  double longitude,
100  double latitude,
101  double altitude,
102  double accuracy,
103  double bearing);
104  public static native void addEnvSensor(long nativeApplication, int type, float value);
105 
106  public static native void save(long nativeApplication, String outputDatabasePath);
107  public static native void cancelProcessing(long nativeApplication);
108  public static native boolean exportMesh(
109  long nativeApplication,
110  float cloudVoxelSize,
111  boolean regenerateCloud,
112  boolean meshing,
113  int textureSize,
114  int textureCount,
115  int normalK,
116  boolean optimized,
117  float optimizedVoxelSize,
118  int optimizedDepth,
119  int optimizedMaxPolygons,
120  float optimizedColorRadius,
121  boolean optimizedCleanWhitePolygons,
122  int optimizedMinClusterSize,
123  float optimizedMaxTextureDistance,
124  int optimizedMinTextureClusterSize,
125  boolean blockRendering);
126  public static native boolean writeExportedMesh(long nativeApplication, String directory, String name);
127  public static native boolean postExportation(long nativeApplication, boolean visualize);
128  public static native int postProcessing(long nativeApplication, int approach);
129 
130  public static native String getStatus(long nativeApplication);
131  public static native int getTotalNodes(long nativeApplication);
132  public static native int getTotalWords(long nativeApplication);
133  public static native int getTotalPoints(long nativeApplication);
134  public static native float getUpdateTime(long nativeApplication);
135  public static native int getLoopClosureId(long nativeApplication);
136 
137  public static native void postCameraPoseEvent(long nativeApplication, float x, float y, float z, float qx, float qy, float qz, float qw);
138  public static native void postOdometryEvent(long nativeApplication,
139  float x, float y, float z, float qx, float qy, float qz, float qw,
140  float fx, float fy, float cx, float cy,
141  double stamp,
142  ByteBuffer yPlane, ByteBuffer uPlane, ByteBuffer vPlane, int yPlaneLen, int rgbWidth, int rgbHeight, int rgbFormat,
143  ByteBuffer depth, int depthLen, int depthWidth, int depthHeight, int depthFormat,
144  FloatBuffer points, int pointsLen);
145 
146 }
static native void destroyNativeApplication(long nativeApplication)
static native int render(long nativeApplication)
static native void setMeshTriangleSize(long nativeApplication, int value)
static native void setDepthFromMotion(long nativeApplication, boolean enabled)
static native int openDatabase(long nativeApplication, String databasePath, boolean databaseInMemory, boolean optimize)
static native void setMinCloudDepth(long nativeApplication, float value)
static native int openDatabase2(long nativeApplication, String databaseSource, String databasePath, boolean databaseInMemory, boolean optimize)
static native void setLighting(long nativeApplication, boolean enabled)
static native boolean writeExportedMesh(long nativeApplication, String directory, String name)
static native void setCameraColor(long nativeApplication, boolean enabled)
static native void setPausedMapping(long nativeApplication, boolean paused)
static native void setRawScanSaved(long nativeApplication, boolean enabled)
static native void setScreenRotation(long nativeApplication, int displayRotation, int cameraRotation)
static native void setFullResolution(long nativeApplication, boolean enabled)
static native boolean postExportation(long nativeApplication, boolean visualize)
static native int getLoopClosureId(long nativeApplication)
static native void setRenderingTextureDecimation(long nativeApplication, int value)
static native void setBackgroundColor(long nativeApplication, float gray)
static native void setFOV(long nativeApplication, float value)
static native void setDataRecorderMode(long nativeApplication, boolean enabled)
static native void setupGraphic(long nativeApplication, int width, int height)
static native void postCameraPoseEvent(long nativeApplication, float x, float y, float z, float qx, float qy, float qz, float qw)
static native void setLocalizationMode(long nativeApplication, boolean enabled)
static native void setSmoothing(long nativeApplication, boolean enabled)
static native void setCloudDensityLevel(long nativeApplication, int value)
static native void setMaxCloudDepth(long nativeApplication, float value)
static native void setGridVisible(long nativeApplication, boolean visible)
static native void postOdometryEvent(long nativeApplication, float x, float y, float z, float qx, float qy, float qz, float qw, float fx, float fy, float cx, float cy, double stamp, ByteBuffer yPlane, ByteBuffer uPlane, ByteBuffer vPlane, int yPlaneLen, int rgbWidth, int rgbHeight, int rgbFormat, ByteBuffer depth, int depthLen, int depthWidth, int depthHeight, int depthFormat, FloatBuffer points, int pointsLen)
static native void addEnvSensor(long nativeApplication, int type, float value)
static native void stopCamera(long nativeApplication)
static native boolean startCamera(long nativeApplication, IBinder binder, Context context, Activity activity, int driver)
static native void setGridRotation(long nativeApplication, float value)
static native float getUpdateTime(long nativeApplication)
static native void setMeshRendering(long nativeApplication, boolean enabled, boolean withTexture)
static native int getTotalPoints(long nativeApplication)
static native void initGlContent(long nativeApplication)
static native void setOdomCloudShown(long nativeApplication, boolean shown)
static native void setGPS(long nativeApplication, double stamp, double longitude, double latitude, double altitude, double accuracy, double bearing)
static native void setGraphVisible(long nativeApplication, boolean visible)
static native void setOrthoCropFactor(long nativeApplication, float value)
static native void setPointSize(long nativeApplication, float value)
static native void setOnlineBlending(long nativeApplication, boolean enabled)
static native boolean exportMesh(long nativeApplication, float cloudVoxelSize, boolean regenerateCloud, boolean meshing, int textureSize, int textureCount, int normalK, boolean optimized, float optimizedVoxelSize, int optimizedDepth, int optimizedMaxPolygons, float optimizedColorRadius, boolean optimizedCleanWhitePolygons, int optimizedMinClusterSize, float optimizedMaxTextureDistance, int optimizedMinTextureClusterSize, boolean blockRendering)
static native boolean isBuiltWith(long nativeApplication, int cameraDriver)
static native long createNativeApplication(RTABMapActivity activity)
static native int getTotalWords(long nativeApplication)
static native String getStatus(long nativeApplication)
RTABMapApp * native(jlong ptr)
static native void setTrajectoryMode(long nativeApplication, boolean enabled)
static native void setGraphOptimization(long nativeApplication, boolean enabled)
static native void setClusterRatio(long nativeApplication, float value)
static native void setMapCloudShown(long nativeApplication, boolean shown)
static native int postProcessing(long nativeApplication, int approach)
static native void cancelProcessing(long nativeApplication)
static native void setMaxGainRadius(long nativeApplication, float value)
static native void save(long nativeApplication, String outputDatabasePath)
static native void setBackfaceCulling(long nativeApplication, boolean enabled)
static native int getTotalNodes(long nativeApplication)
static native void setWireframe(long nativeApplication, boolean enabled)
static native void onTouchEvent(long nativeApplication, int touchCount, int event0, float x0, float y0, float x1, float y1)
static native int setMappingParameter(long nativeApplication, String key, String value)
static native void setMeshAngleTolerance(long nativeApplication, float value)
static native void setAppendMode(long nativeApplication, boolean enabled)
static native void setCamera(long nativeApplication, int cameraIndex)
static native void setNodesFiltering(long nativeApplication, boolean enabled)


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Dec 14 2020 03:35:00