2 package com.introlab.rtabmap;
3 import java.nio.ByteBuffer;
4 import java.nio.FloatBuffer;
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;
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.");
25 System.loadLibrary(
"NativeRTABMap");
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);
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);
55 public static native void setCamera(
long nativeApplication,
int cameraIndex);
58 public static native void onTouchEvent(
long nativeApplication,
int touchCount,
int event0,
59 float x0,
float y0,
float x1,
float y1);
82 public static native void setFOV(
long nativeApplication,
float value);
97 long nativeApplication,
104 public static native void addEnvSensor(
long nativeApplication,
int type,
float value);
106 public static native void save(
long nativeApplication, String outputDatabasePath);
109 long nativeApplication,
110 float cloudVoxelSize,
111 boolean regenerateCloud,
117 float optimizedVoxelSize,
119 int optimizedMaxPolygons,
120 float optimizedColorRadius,
121 boolean optimizedCleanWhitePolygons,
122 int optimizedMinClusterSize,
123 float optimizedMaxTextureDistance,
124 int optimizedMinTextureClusterSize,
125 boolean blockRendering);
137 public static native void postCameraPoseEvent(
long nativeApplication,
float x,
float y,
float z,
float qx,
float qy,
float qz,
float qw);
139 float x,
float y,
float z,
float qx,
float qy,
float qz,
float qw,
140 float fx,
float fy,
float cx,
float cy,
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);
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 final int ARCH_ERROR
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 final int loadTangoSharedLibrary()
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)