Minor upgrades to android lidar support
This commit is contained in:
@@ -36,9 +36,9 @@ dependencies {
|
|||||||
testImplementation 'junit:junit:4.12'
|
testImplementation 'junit:junit:4.12'
|
||||||
androidTestImplementation 'androidx.test:runner:1.2.0'
|
androidTestImplementation 'androidx.test:runner:1.2.0'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||||
implementation 'io.grpc:grpc-okhttp:1.28.1' // CURRENT_GRPC_VERSION
|
implementation 'io.grpc:grpc-okhttp:1.29.0' // CURRENT_GRPC_VERSION
|
||||||
implementation 'io.grpc:grpc-protobuf-lite:1.28.1' // CURRENT_GRPC_VERSION
|
implementation 'io.grpc:grpc-protobuf-lite:1.29.0' // CURRENT_GRPC_VERSION
|
||||||
implementation 'io.grpc:grpc-stub:1.28.1' // CURRENT_GRPC_VERSION
|
implementation 'io.grpc:grpc-stub:1.29.0' // CURRENT_GRPC_VERSION
|
||||||
implementation 'javax.annotation:javax.annotation-api:1.2'
|
implementation 'javax.annotation:javax.annotation-api:1.2'
|
||||||
implementation 'org.zeromq:jeromq:0.5.2'
|
implementation 'org.zeromq:jeromq:0.5.2'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import android.graphics.Canvas;
|
|||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.SurfaceHolder;
|
import android.view.SurfaceHolder;
|
||||||
import android.view.SurfaceView;
|
import android.view.SurfaceView;
|
||||||
@@ -115,8 +116,22 @@ public class LidarView extends SurfaceView
|
|||||||
|
|
||||||
|
|
||||||
public void stop() {
|
public void stop() {
|
||||||
// TODO: Use grpc to tell zmq to stop.
|
|
||||||
lidar.stop();
|
lidar.stop();
|
||||||
|
StreamObserver<Empty> responseObserver = new StreamObserver<Empty>() {
|
||||||
|
@Override
|
||||||
|
public void onNext(Empty value) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable t) {
|
||||||
|
Log.d("LIDAR", "Failed to stop SLAM", t);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCompleted() {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
stub.stopTracking(Empty.newBuilder().build(), responseObserver);
|
||||||
try {
|
try {
|
||||||
lidarThread.join(1000);
|
lidarThread.join(1000);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
@@ -141,6 +156,15 @@ public class LidarView extends SurfaceView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param groupNumber
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private static int convertGroupNumberToHue(int groupNumber){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
private static class Point {
|
private static class Point {
|
||||||
private double x;
|
private double x;
|
||||||
private double y;
|
private double y;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import android.graphics.Canvas;
|
|||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.SurfaceHolder;
|
import android.view.SurfaceHolder;
|
||||||
import android.view.SurfaceView;
|
import android.view.SurfaceView;
|
||||||
|
|
||||||
@@ -128,6 +129,20 @@ public class SlamView extends SurfaceView implements AbstractUpdater.MapChangedL
|
|||||||
public void stop() {
|
public void stop() {
|
||||||
// TODO: Use grpc to tell zmq to stop.
|
// TODO: Use grpc to tell zmq to stop.
|
||||||
slam.stop();
|
slam.stop();
|
||||||
|
stub.stopStreaming(Empty.newBuilder().build(), new StreamObserver<Empty>() {
|
||||||
|
@Override
|
||||||
|
public void onNext(Empty value) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable t) {
|
||||||
|
Log.d("SLAM", "Failed to stop SLAM", t);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCompleted() {
|
||||||
|
}
|
||||||
|
});
|
||||||
try {
|
try {
|
||||||
mapThread.join(1000);
|
mapThread.join(1000);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ public class GrpcUpdater<T extends MessageLite> extends AbstractUpdater<T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stop() {
|
public void stop() {
|
||||||
|
// TODO... may not be needed here.
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user