Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/build-natives.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build-linux-x86_64:
runs-on: [ubuntu-22.04]
container:
image: stereolabs/zed:5.2-devel-cuda12.8-ubuntu22.04
image: stereolabs/zed:5.3-devel-cuda12.8-ubuntu22.04
steps:
- name: Install dependencies
run: |
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
build-linux-l4t:
runs-on: [ubuntu-22.04-arm]
container:
image: stereolabs/zed:5.2-devel-l4t-r35.4
image: stereolabs/zed:5.3-devel-l4t-r36.4
needs: [build-linux-x86_64]
steps:
- name: Install dependencies
Expand All @@ -63,6 +63,9 @@ jobs:
- name: Compile native library (arm64)
run: |
cd /work/zed-java-api
export CMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs:$CMAKE_LIBRARY_PATH
# Force the linker to ignore the fact that the stub is just a placeholder
export CXXFLAGS="-Wl,--allow-shlib-undefined"
Comment on lines +66 to +68
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This addition fixes some linking issue with CUDA. We don't fully understand why this is needed, but AI suggested it and it works

LINUX_CROSS_COMPILE_ARM=1 bash cppbuild.bash
- name: Commit generated java and native libraries
run: |
Expand Down Expand Up @@ -103,8 +106,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install gdown
gdown https://drive.google.com/uc?id=1bQ4x6fYodflO2yI6ekdKmT5HmdrF0W-j
tar -xvf ZEDSDK-Windows-5.2.0.tar.gz -C "C:\\Program Files (x86)"
gdown https://drive.google.com/uc?id=14EC5TVjwoGxp_lUAqFGycZYT9MZep2UN
tar -xvf ZEDSDK-Windows-5.3.0.tar.gz -C "C:\\Program Files (x86)"
- uses: ilammy/msvc-dev-cmd@v1
with:
vsversion: 2022
Expand Down
10 changes: 5 additions & 5 deletions cppbuild.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ pushd .
mkdir cppbuild
cd cppbuild

if [ ! -f "zed-c-api-5.2.tar.gz" ]; then
curl -L -o zed-c-api-5.2.tar.gz https://codeload.github.com/stereolabs/zed-c-api/tar.gz/refs/tags/v5.2
if [ ! -f "zed-c-api-5.3.0.tar.gz" ]; then
curl -L -o zed-c-api-5.3.0.tar.gz https://github.com/stereolabs/zed-c-api/archive/refs/tags/v5.3.0.tar.gz
fi

tar -xvf zed-c-api-5.2.tar.gz
tar -xvf zed-c-api-5.3.0.tar.gz

cp ../patches/CMakeLists.txt.zed_c_api.patch zed-c-api-5.2/CMakeLists.txt.zed_c_api.patch
cp ../patches/CMakeLists.txt.zed_c_api.patch zed-c-api-5.3.0/CMakeLists.txt.zed_c_api.patch

cd zed-c-api-5.2
cd zed-c-api-5.3.0

patch CMakeLists.txt CMakeLists.txt.zed_c_api.patch

Expand Down
17 changes: 13 additions & 4 deletions src/main/java/us/ihmc/zed/SL_InitParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ therefore the number of cameras used at the same time can be limited by the conf
\note Small resolutions offer higher framerate and lower computation time.
\note In most situations, \ref SL_RESOLUTION_HD720 at 60 FPS is the best balance between image quality and framerate.
<p>
Default: <ul>
<li>ZED X/X Mini: \ref SL_RESOLUTION_HD1200</li>
<li>other cameras: \ref SL_RESOLUTION_HD720</li></ul>
Default: \ref SL_RESOLUTION_AUTO <ul>
<li>Resolves to \ref SL_RESOLUTION_HD1200 for ZED X/X Mini</li>
<li>Resolves to \ref SL_RESOLUTION_HD720 for other cameras</li></ul>
\note Available resolutions are listed here: \ref SL_RESOLUTION.
*/
public native @Cast("SL_RESOLUTION") int resolution(); public native SL_InitParameters resolution(int setter);
Expand Down Expand Up @@ -282,7 +282,7 @@ This can be used for example when using a USB3.0 only extension cable (some fibe
This will perform additional verification on the image to identify corrupted data. This verification is done in the grab function and requires some computations.
If an issue is found, the grab function will output a warning as sl_ERROR_CODE_CORRUPTED_FRAME.
This version doesn't detect frame tearing currently.
\n default: disabled
\n default: enabled
*/
public native @Cast("bool") boolean enable_image_validity_check(); public native SL_InitParameters enable_image_validity_check(boolean setter);

Expand All @@ -299,4 +299,13 @@ This can be used for example when using a USB3.0 only extension cable (some fibe
* - maximum_working_resolution = sl::Resolution(4, 4) -> (image_width/4) x (image_height/4) = quarter size
*/
public native @ByRef SL_Resolution maximum_working_resolution(); public native SL_InitParameters maximum_working_resolution(SL_Resolution setter);

/**
\brief Decryption key required to open an SVO file that was recorded with encryption.
<p>
Leave empty (all zeros) if the SVO file is not encrypted.
\note Must match the \ref SL_RecordingParameters::encryption_key used during recording.
*/
public native @Cast("unsigned char") byte svo_decryption_key(int i); public native SL_InitParameters svo_decryption_key(int i, byte setter);
@MemberGetter public native @Cast("unsigned char*") BytePointer svo_decryption_key();
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public class SL_PositionalTrackingParameters extends Pointer {
\brief Positional tracking mode used.

Can be used to improve accuracy in some types of scene at the cost of longer runtime.
\n Default: \ref SL_POSITIONAL_TRACKING_MODE_GEN_1
\n Default: \ref SL_POSITIONAL_TRACKING_MODE_GEN_3
*/
public native @Cast("SL_POSITIONAL_TRACKING_MODE") int mode(); public native SL_PositionalTrackingParameters mode(int setter);

Expand Down
17 changes: 17 additions & 0 deletions src/main/java/us/ihmc/zed/SL_RecordingParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,21 @@ public class SL_RecordingParameters extends Pointer {
\note \ref compression_mode, \ref target_framerate and \ref bitrate will be ignored in this mode.
*/
public native @Cast("bool") boolean transcode_streaming_input(); public native SL_RecordingParameters transcode_streaming_input(boolean setter);

/**
\brief Encryption key used to protect the SVO file.
<p>
Leave empty (all zeros) to record without encryption.
\note The same key must be provided in \ref SL_InitParameters::svo_decryption_key for playback.
*/
public native @Cast("unsigned char") byte encryption_key(int i); public native SL_RecordingParameters encryption_key(int i, byte setter);
@MemberGetter public native @Cast("unsigned char*") BytePointer encryption_key();

/**
\brief Encoding preset for H264/H265 compression.
<p>
Controls the tradeoff between encoding speed and quality.
Default: \ref SL_SVO_ENCODING_PRESET_DEFAULT
*/
public native @Cast("SL_SVO_ENCODING_PRESET") int encoding_preset(); public native SL_RecordingParameters encoding_preset(int setter);
}
60 changes: 60 additions & 0 deletions src/main/java/us/ihmc/zed/SL_VoxelMeasureParameters.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Targeted by JavaCPP version 1.5.11: DO NOT EDIT THIS FILE

package us.ihmc.zed;

import org.bytedeco.cuda.cudart.CUctx_st;
import org.bytedeco.cuda.cudart.CUstream_st;
import java.nio.*;
import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.annotation.*;

import static us.ihmc.zed.global.zed.*;


/**
\brief Parameters controlling voxel decimation in sl_retrieve_voxel_measure.
*/
@Properties(inherit = us.ihmc.zed.ZEDJavaAPIConfig.class)
public class SL_VoxelMeasureParameters extends Pointer {
static { Loader.load(); }
/** Default native constructor. */
public SL_VoxelMeasureParameters() { super((Pointer)null); allocate(); }
/** Native array allocator. Access with {@link Pointer#position(long)}. */
public SL_VoxelMeasureParameters(long size) { super((Pointer)null); allocateArray(size); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public SL_VoxelMeasureParameters(Pointer p) { super(p); }
private native void allocate();
private native void allocateArray(long size);
@Override public SL_VoxelMeasureParameters position(long position) {
return (SL_VoxelMeasureParameters)super.position(position);
}
@Override public SL_VoxelMeasureParameters getPointer(long i) {
return new SL_VoxelMeasureParameters((Pointer)this).offsetAddress(i);
}

/**
\brief Voxel grid cell size in coordinate_units defined in SL_InitParameters.
If <= 0, a 100 mm equivalent default is used. Clamped internally to [5 mm equivalent, max_depth_range].
*/
public native float voxel_size(); public native SL_VoxelMeasureParameters voxel_size(float setter);

/**
\brief Controls output point positions within each voxel.
If true, output point positions are the centroid of all points in each voxel.
If false, output positions are snapped to the voxel grid center.
*/
public native @Cast("bool") boolean centroid(); public native SL_VoxelMeasureParameters centroid(boolean setter);

/**
\brief How voxel size adapts with depth.
Default: SL_VOXELIZATION_MODE_STEREO_UNCERTAINTY
*/
public native @Cast("SL_VOXELIZATION_MODE") int resolution_mode(); public native SL_VoxelMeasureParameters resolution_mode(int setter);

/**
\brief Scale factor for depth-adaptive voxel growth.
Typical range: [0.01, 1.0]. Clamped internally to [0.01, 3.0].
\note Only used when resolution_mode is not SL_VOXELIZATION_MODE_FIXED.
*/
public native float resolution_scale(); public native SL_VoxelMeasureParameters resolution_scale(float setter);
}
Loading