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 }
com.introlab.rtabmap.RTABMapLib.postProcessing
static native int postProcessing(long nativeApplication, int approach)
com.introlab.rtabmap.RTABMapLib.setOnlineBlending
static native void setOnlineBlending(long nativeApplication, boolean enabled)
com.introlab.rtabmap.RTABMapLib.setOrthoCropFactor
static native void setOrthoCropFactor(long nativeApplication, float value)
com.introlab.rtabmap.RTABMapLib.setTrajectoryMode
static native void setTrajectoryMode(long nativeApplication, boolean enabled)
com.introlab.rtabmap.RTABMapLib.setLighting
static native void setLighting(long nativeApplication, boolean enabled)
com.introlab.rtabmap.RTABMapLib.createNativeApplication
static native long createNativeApplication(RTABMapActivity activity)
com.introlab.rtabmap.RTABMapLib.setMeshTriangleSize
static native void setMeshTriangleSize(long nativeApplication, int value)
com.introlab.rtabmap.RTABMapLib.setDataRecorderMode
static native void setDataRecorderMode(long nativeApplication, boolean enabled)
com.introlab.rtabmap.RTABMapLib.setGridVisible
static native void setGridVisible(long nativeApplication, boolean visible)
name
com.introlab.rtabmap.TangoInitializationHelper
Definition: TangoInitializationHelper.java:34
x1
x1
com.introlab.rtabmap.RTABMapLib.setBackfaceCulling
static native void setBackfaceCulling(long nativeApplication, boolean enabled)
com.introlab.rtabmap.RTABMapLib.setCamera
static native void setCamera(long nativeApplication, int cameraIndex)
com.introlab.rtabmap.RTABMapLib.setMinCloudDepth
static native void setMinCloudDepth(long nativeApplication, float value)
com.introlab.rtabmap.RTABMapLib.setMappingParameter
static native int setMappingParameter(long nativeApplication, String key, String value)
com.introlab.rtabmap.RTABMapLib.setAppendMode
static native void setAppendMode(long nativeApplication, boolean enabled)
type
com.introlab.rtabmap.RTABMapLib.setLocalizationMode
static native void setLocalizationMode(long nativeApplication, boolean enabled)
com.introlab.rtabmap.RTABMapLib.setNodesFiltering
static native void setNodesFiltering(long nativeApplication, boolean enabled)
com.introlab.rtabmap.RTABMapLib.setMaxCloudDepth
static native void setMaxCloudDepth(long nativeApplication, float value)
com.introlab.rtabmap.RTABMapLib.postOdometryEventDepth
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)
y
Matrix3f y
com.introlab.rtabmap.RTABMapLib.setGridRotation
static native void setGridRotation(long nativeApplication, float value)
com.introlab.rtabmap.RTABMapLib.setGPS
static native void setGPS(long nativeApplication, double stamp, double longitude, double latitude, double altitude, double accuracy, double bearing)
com.introlab.rtabmap.RTABMapLib.writeExportedMesh
static native boolean writeExportedMesh(long nativeApplication, String directory, String name)
com.introlab.rtabmap.RTABMapLib.addEnvSensor
static native void addEnvSensor(long nativeApplication, int type, float value)
com.introlab.rtabmap.RTABMapLib.stopCamera
static native void stopCamera(long nativeApplication)
optimize
gtsam.ISAM2 optimize(List[GpsMeasurement] gps_measurements, List[ImuMeasurement] imu_measurements, gtsam.noiseModel.Diagonal sigma_init_x, gtsam.noiseModel.Diagonal sigma_init_v, gtsam.noiseModel.Diagonal sigma_init_b, gtsam.noiseModel.Diagonal noise_model_gps, KittiCalibration kitti_calibration, int first_gps_pose, int gps_skip)
com.introlab.rtabmap.RTABMapLib.setRenderingTextureDecimation
static native void setRenderingTextureDecimation(long nativeApplication, int value)
com.introlab.rtabmap.RTABMapLib
Definition: RTABMapLib.java:15
com.introlab.rtabmap.RTABMapLib.onTouchEvent
static native void onTouchEvent(long nativeApplication, int touchCount, int event0, float x0, float y0, float x1, float y1)
com.introlab.rtabmap.RTABMapLib.setSmoothing
static native void setSmoothing(long nativeApplication, boolean enabled)
vy
StridedVectorType vy(make_vector(y, *n, std::abs(*incy)))
com.introlab.rtabmap.RTABMapLib.setCloudDensityLevel
static native void setCloudDensityLevel(long nativeApplication, int value)
x0
x0
com.introlab.rtabmap.RTABMapLib.setMeshRendering
static native void setMeshRendering(long nativeApplication, boolean enabled, boolean withTexture)
com.introlab.rtabmap.RTABMapLib.getTotalNodes
static native int getTotalNodes(long nativeApplication)
com.introlab.rtabmap.RTABMapLib.setRawScanSaved
static native void setRawScanSaved(long nativeApplication, boolean enabled)
com.introlab.rtabmap.RTABMapLib.exportMesh
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)
com.introlab.rtabmap.RTABMapLib.getTotalWords
static native int getTotalWords(long nativeApplication)
com.introlab.rtabmap.RTABMapLib.setMeshAngleTolerance
static native void setMeshAngleTolerance(long nativeApplication, float value)
z
z
x
x
com.introlab.rtabmap.RTABMapLib.initGlContent
static native void initGlContent(long nativeApplication)
com.introlab.rtabmap.RTABMapLib.isBuiltWith
static native boolean isBuiltWith(long nativeApplication, int cameraDriver)
com.introlab.rtabmap.RTABMapLib.getTotalPoints
static native int getTotalPoints(long nativeApplication)
com.introlab.rtabmap.RTABMapLib.recover
static native boolean recover(long nativeApplication, String from, String to)
com.introlab.rtabmap.RTABMapLib.postExportation
static native boolean postExportation(long nativeApplication, boolean visualize)
key
const gtsam::Symbol key( 'X', 0)
com.introlab.rtabmap.RTABMapLib.setupGraphic
static native void setupGraphic(long nativeApplication, int width, int height)
com.introlab.rtabmap.RTABMapLib.setGraphOptimization
static native void setGraphOptimization(long nativeApplication, boolean enabled)
y1
CEPHES_EXTERN_EXPORT double y1(double x)
qz
RealQZ< MatrixXf > qz(4)
com.introlab.rtabmap.TangoInitializationHelper.loadTangoSharedLibrary
static final int loadTangoSharedLibrary()
Definition: TangoInitializationHelper.java:80
native
RTABMapApp * native(jlong ptr)
Definition: jni_interface.cpp:53
com.introlab.rtabmap.RTABMapLib.getStatus
static native String getStatus(long nativeApplication)
com.introlab.rtabmap.RTABMapLib.setMapCloudShown
static native void setMapCloudShown(long nativeApplication, boolean shown)
com.introlab.rtabmap.TangoInitializationHelper.ARCH_ERROR
static final int ARCH_ERROR
Definition: TangoInitializationHelper.java:35
y0
CEPHES_EXTERN_EXPORT double y0(double x)
com.introlab.rtabmap.RTABMapLib.setCameraColor
static native void setCameraColor(long nativeApplication, boolean enabled)
com.introlab.rtabmap.RTABMapLib.cancelProcessing
static native void cancelProcessing(long nativeApplication)
com.introlab.rtabmap.RTABMapLib.setOdomCloudShown
static native void setOdomCloudShown(long nativeApplication, boolean shown)
com.introlab.rtabmap.RTABMapLib.getLoopClosureId
static native int getLoopClosureId(long nativeApplication)
com.introlab.rtabmap.RTABMapLib.setScreenRotation
static native void setScreenRotation(long nativeApplication, int displayRotation, int cameraRotation)
com.introlab.rtabmap.RTABMapLib.startCamera
static native boolean startCamera(long nativeApplication, IBinder binder, Context context, Activity activity, int driver)
com.introlab.rtabmap.RTABMapLib.setBackgroundColor
static native void setBackgroundColor(long nativeApplication, float gray)
com.introlab.rtabmap.RTABMapLib.setPointSize
static native void setPointSize(long nativeApplication, float value)
com.introlab.rtabmap.RTABMapLib.save
static native void save(long nativeApplication, String outputDatabasePath)
p22
p22
com.introlab.rtabmap.RTABMapLib.postCameraPoseEvent
static native void postCameraPoseEvent(long nativeApplication, float x, float y, float z, float qx, float qy, float qz, float qw, double stamp)
com.introlab.rtabmap.RTABMapLib.postOdometryEvent
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)
com.introlab.rtabmap.RTABMapLib.setFullResolution
static native void setFullResolution(long nativeApplication, boolean enabled)
com.introlab.rtabmap.RTABMapLib.setWireframe
static native void setWireframe(long nativeApplication, boolean enabled)
com.introlab.rtabmap.RTABMapLib.setGraphVisible
static native void setGraphVisible(long nativeApplication, boolean visible)
com.introlab.rtabmap.RTABMapLib.setClusterRatio
static native void setClusterRatio(long nativeApplication, float value)
com.introlab.rtabmap.RTABMapLib.getUpdateTime
static native float getUpdateTime(long nativeApplication)
com.introlab.rtabmap.RTABMapLib.setDepthFromMotion
static native void setDepthFromMotion(long nativeApplication, boolean enabled)
com.introlab.rtabmap.RTABMapLib.openDatabase
static native int openDatabase(long nativeApplication, String databasePath, boolean databaseInMemory, boolean optimize, boolean clearDatabase)
com.introlab.rtabmap.RTABMapLib.setMaxGainRadius
static native void setMaxGainRadius(long nativeApplication, float value)
com.introlab.rtabmap.RTABMapLib.destroyNativeApplication
static native void destroyNativeApplication(long nativeApplication)
com.introlab.rtabmap.RTABMapLib.render
static native int render(long nativeApplication)
com.introlab.rtabmap.RTABMapLib.setFOV
static native void setFOV(long nativeApplication, float value)
value
value
vx
StridedVectorType vx(make_vector(x, *n, std::abs(*incx)))
com.introlab.rtabmap.RTABMapLib.setPausedMapping
static native void setPausedMapping(long nativeApplication, boolean paused)
com.introlab.rtabmap.RTABMapActivity
Definition: RTABMapActivity.java:107


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:15