-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SVO logging #598
SVO logging #598
Changes from 4 commits
02db48a
24babaf
638114c
c2418cf
57ca991
a6ca5cf
1eb1221
c5f4c8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,8 @@ public class ZEDImageSensor extends ImageSensor | |
ZEDJavaAPINativeLibrary.load(); | ||
} | ||
|
||
private static int nextStreamingPort = 30000; | ||
|
||
public static final int LEFT_COLOR_IMAGE_KEY = 0; | ||
public static final int RIGHT_COLOR_IMAGE_KEY = 1; | ||
public static final int DEPTH_IMAGE_KEY = 2; | ||
|
@@ -45,6 +47,7 @@ public class ZEDImageSensor extends ImageSensor | |
private final int cameraID; | ||
private final ZEDModelData zedModel; | ||
private final int slInputType; | ||
private final int streamingPort = nextStreamingPort++; | ||
|
||
private final RawImage[] grabbedImages = new RawImage[OUTPUT_IMAGE_COUNT]; | ||
private final Pointer[] slMatPointers = new Pointer[OUTPUT_IMAGE_COUNT]; | ||
|
@@ -109,6 +112,8 @@ protected boolean startSensor() | |
sl_enable_positional_tracking(cameraID, positionalTrackingParameters, ""); | ||
} | ||
|
||
sl_enable_streaming(cameraID, SL_STREAMING_CODEC_H264, 8000, (short) streamingPort, -1, 0, 16084, CAMERA_FPS); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I want to keep it like this, since ZED SDK typically always uses port 30000 or around there |
||
|
||
// Get camera intrinsics | ||
SL_CalibrationParameters sensorIntrinsics = sl_get_calibration_parameters(cameraID, false); | ||
imageWidth = sl_get_width(cameraID); | ||
|
@@ -180,7 +185,8 @@ protected int openCamera() | |
@Override | ||
public boolean isSensorRunning() | ||
{ | ||
return sl_is_opened(cameraID) && !lastGrabFailed; | ||
boolean recentlyGrabbed = lastGrabTime != null && lastGrabTime.isAfter(Instant.now().minusSeconds(1)); | ||
return sl_is_opened(cameraID) && !lastGrabFailed && recentlyGrabbed; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
} | ||
|
||
@Override | ||
|
@@ -304,6 +310,11 @@ public int getCameraID() | |
return cameraID; | ||
} | ||
|
||
public int getStreamingPort() | ||
{ | ||
return streamingPort; | ||
} | ||
|
||
public void enablePositionalTracking(boolean enable) | ||
{ | ||
positionalTrackingEnabled = enable; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean it's always streaming, even when doing local tests & development?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Streaming is always enabled, not necessarily streaming to anything