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, boolean clearDatabase);
38 
39  public static native boolean recover(long nativeApplication, String from, String to);
40 
41  public static native boolean isBuiltWith(long nativeApplication, int cameraDriver);
42  public static native boolean startCamera(long nativeApplication, IBinder binder, Context context, Activity activity, int driver);
43  public static native void stopCamera(long nativeApplication);
44 
45  // Allocate OpenGL resources for rendering.
46  public static native void initGlContent(long nativeApplication);
47 
48  // Setup the view port width and height.
49  public static native void setupGraphic(long nativeApplication, int width, int height);
50 
51  // Main render loop.
52  public static native int render(long nativeApplication);
53 
54  // Set the render camera's viewing angle:
55  // first person, third person, or top down.
56  public static native void setCamera(long nativeApplication, int cameraIndex);
57 
58  // Pass touch events to the native layer.
59  public static native void onTouchEvent(long nativeApplication, int touchCount, int event0,
60  float x0, float y0, float x1, float y1);
61 
62  public static native void setPausedMapping(long nativeApplication, boolean paused);
63  public static native void setOnlineBlending(long nativeApplication, boolean enabled);
64  public static native void setMapCloudShown(long nativeApplication, boolean shown);
65  public static native void setOdomCloudShown(long nativeApplication, boolean shown);
66  public static native void setMeshRendering(long nativeApplication, boolean enabled, boolean withTexture);
67  public static native void setLocalizationMode(long nativeApplication, boolean enabled);
68  public static native void setTrajectoryMode(long nativeApplication, boolean enabled);
69  public static native void setGraphOptimization(long nativeApplication, boolean enabled);
70  public static native void setNodesFiltering(long nativeApplication, boolean enabled);
71  public static native void setGraphVisible(long nativeApplication, boolean visible);
72  public static native void setGridVisible(long nativeApplication, boolean visible);
73  public static native void setRawScanSaved(long nativeApplication, boolean enabled);
74  public static native void setFullResolution(long nativeApplication, boolean enabled);
75  public static native void setSmoothing(long nativeApplication, boolean enabled);
76  public static native void setDepthFromMotion(long nativeApplication, boolean enabled);
77  public static native void setCameraColor(long nativeApplication, boolean enabled);
78  public static native void setAppendMode(long nativeApplication, boolean enabled);
79  public static native void setDataRecorderMode(long nativeApplication, boolean enabled);
80  public static native void setMaxCloudDepth(long nativeApplication, float value);
81  public static native void setMinCloudDepth(long nativeApplication, float value);
82  public static native void setPointSize(long nativeApplication, float value);
83  public static native void setFOV(long nativeApplication, float value);
84  public static native void setOrthoCropFactor(long nativeApplication, float value);
85  public static native void setGridRotation(long nativeApplication, float value);
86  public static native void setLighting(long nativeApplication, boolean enabled);
87  public static native void setBackfaceCulling(long nativeApplication, boolean enabled);
88  public static native void setWireframe(long nativeApplication, boolean enabled);
89  public static native void setCloudDensityLevel(long nativeApplication, int value);
90  public static native void setMeshAngleTolerance(long nativeApplication, float value);
91  public static native void setMeshTriangleSize(long nativeApplication, int value);
92  public static native void setClusterRatio(long nativeApplication, float value);
93  public static native void setMaxGainRadius(long nativeApplication, float value);
94  public static native void setRenderingTextureDecimation(long nativeApplication, int value);
95  public static native void setBackgroundColor(long nativeApplication, float gray);
96  public static native int setMappingParameter(long nativeApplication, String key, String value);
97  public static native void setGPS(
98  long nativeApplication,
99  double stamp,
100  double longitude,
101  double latitude,
102  double altitude,
103  double accuracy,
104  double bearing);
105  public static native void addEnvSensor(long nativeApplication, int type, float value);
106 
107  public static native void save(long nativeApplication, String outputDatabasePath);
108  public static native void cancelProcessing(long nativeApplication);
109  public static native boolean exportMesh(
110  long nativeApplication,
111  float cloudVoxelSize,
112  boolean regenerateCloud,
113  boolean meshing,
114  int textureSize,
115  int textureCount,
116  int normalK,
117  boolean optimized,
118  float optimizedVoxelSize,
119  int optimizedDepth,
120  int optimizedMaxPolygons,
121  float optimizedColorRadius,
122  boolean optimizedCleanWhitePolygons,
123  int optimizedMinClusterSize,
124  float optimizedMaxTextureDistance,
125  int optimizedMinTextureClusterSize,
126  boolean blockRendering);
127  public static native boolean writeExportedMesh(long nativeApplication, String directory, String name);
128  public static native boolean postExportation(long nativeApplication, boolean visualize);
129  public static native int postProcessing(long nativeApplication, int approach);
130 
131  public static native String getStatus(long nativeApplication);
132  public static native int getTotalNodes(long nativeApplication);
133  public static native int getTotalWords(long nativeApplication);
134  public static native int getTotalPoints(long nativeApplication);
135  public static native float getUpdateTime(long nativeApplication);
136  public static native int getLoopClosureId(long nativeApplication);
137 
138  public static native void postCameraPoseEvent(long nativeApplication, float x, float y, float z, float qx, float qy, float qz, float qw, double stamp);
139  public static native void postOdometryEvent(long nativeApplication,
140  float x, float y, float z, float qx, float qy, float qz, float qw,
141  float rgb_fx, float rgb_fy, float rgb_cx, float rgb_cy,
142  float rgbFrameX, float rgbFrameY, float rgbFrameZ, float rgbFrameQX, float rgbFrameQY, float rgbFrameQZ, float rgbFrameQW,
143  double stamp,
144  ByteBuffer yPlane, ByteBuffer uPlane, ByteBuffer vPlane, int yPlaneLen, int rgbWidth, int rgbHeight, int rgbFormat,
145  FloatBuffer points, int pointsLen,
146  float vx, float vy, float vz, float vqx, float vqy, float vqz, float vqw, //view matrix
147  float p00, float p11, float p02, float p12, float p22, float p32, float p23, // projection matrix
148  float t0, float t1, float t2, float t3, float t4, float t5, float t6, float t7); // tex coord
149  public static native void postOdometryEventDepth(long nativeApplication,
150  float x, float y, float z, float qx, float qy, float qz, float qw,
151  float rgb_fx, float rgb_fy, float rgb_cx, float rgb_cy,
152  float depth_fx, float depth_fy, float depth_cx, float depth_cy,
153  float rgbFrameX, float rgbFrameY, float rgbFrameZ, float rgbFrameQX, float rgbFrameQY, float rgbFrameQZ, float rgbFrameQW,
154  float depthFrameX, float depthFrameY, float depthFrameZ, float depthFrameQX, float depthFrameQY, float depthFrameQZ, float depthFrameQW,
155  double rgbStamp,
156  double depthStamp,
157  ByteBuffer yPlane, ByteBuffer uPlane, ByteBuffer vPlane, int yPlaneLen, int rgbWidth, int rgbHeight, int rgbFormat,
158  ByteBuffer depth, int depthLen, int depthWidth, int depthHeight, int depthFormat,
159  FloatBuffer points, int pointsLen,
160  float vx, float vy, float vz, float vqx, float vqy, float vqz, float vqw, //view matrix
161  float p00, float p11, float p02, float p12, float p22, float p32, float p23, // projection matrix
162  float t0, float t1, float t2, float t3, float t4, float t5, float t6, float t7); // tex coord
163 
164 }
static native void destroyNativeApplication(long nativeApplication)
static native int render(long nativeApplication)
static native void postOdometryEventDepth(long nativeApplication, float x, float y, float z, float qx, float qy, float qz, float qw, float rgb_fx, float rgb_fy, float rgb_cx, float rgb_cy, float depth_fx, float depth_fy, float depth_cx, float depth_cy, float rgbFrameX, float rgbFrameY, float rgbFrameZ, float rgbFrameQX, float rgbFrameQY, float rgbFrameQZ, float rgbFrameQW, float depthFrameX, float depthFrameY, float depthFrameZ, float depthFrameQX, float depthFrameQY, float depthFrameQZ, float depthFrameQW, double rgbStamp, double depthStamp, 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, float vx, float vy, float vz, float vqx, float vqy, float vqz, float vqw, float p00, float p11, float p02, float p12, float p22, float p32, float p23, float t0, float t1, float t2, float t3, float t4, float t5, float t6, float t7)
static native void setMeshTriangleSize(long nativeApplication, int value)
static native void setDepthFromMotion(long nativeApplication, boolean enabled)
static native void postCameraPoseEvent(long nativeApplication, float x, float y, float z, float qx, float qy, float qz, float qw, double stamp)
static native void setMinCloudDepth(long nativeApplication, float value)
x
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 int openDatabase(long nativeApplication, String databasePath, boolean databaseInMemory, boolean optimize, boolean clearDatabase)
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 boolean recover(long nativeApplication, String from, String to)
static native void setDataRecorderMode(long nativeApplication, boolean enabled)
static native void setupGraphic(long nativeApplication, int width, int height)
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)
string name
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 void postOdometryEvent(long nativeApplication, float x, float y, float z, float qx, float qy, float qz, float qw, float rgb_fx, float rgb_fy, float rgb_cx, float rgb_cy, float rgbFrameX, float rgbFrameY, float rgbFrameZ, float rgbFrameQX, float rgbFrameQY, float rgbFrameQZ, float rgbFrameQW, double stamp, ByteBuffer yPlane, ByteBuffer uPlane, ByteBuffer vPlane, int yPlaneLen, int rgbWidth, int rgbHeight, int rgbFormat, FloatBuffer points, int pointsLen, float vx, float vy, float vz, float vqx, float vqy, float vqz, float vqw, float p00, float p11, float p02, float p12, float p22, float p32, float p23, float t0, float t1, float t2, float t3, float t4, float t5, float t6, float t7)
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 Jan 23 2023 03:37:30