Skip to content

Commit

Permalink
Merge pull request #21 from stereolabs/v4.0.5
Browse files Browse the repository at this point in the history
update to 4.0.5
  • Loading branch information
Bvallon-sl authored Jul 5, 2023
2 parents 7c341fe + 57a570d commit 7797605
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 90 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ This package lets you use the ZED stereo camera in C#. The C# API is a wrapper a
- Visual Studio 2017 with C# extensions
- Cmake 3.23 at least
- [C wrapper](https://github.com/stereolabs/zed-c-api) of the ZED SDK
- [ZED SDK **4.0**](https://www.stereolabs.com/developers/release/) and its dependency ([CUDA](https://developer.nvidia.com/cuda-downloads))
- [ZED SDK **4.0.5**](https://www.stereolabs.com/developers/release/) and its dependency ([CUDA](https://developer.nvidia.com/cuda-downloads))

## From NuGet

The C# API is available as a Nuget Package on Nuget.org.

| Package | Description | Link |
|---------|-------------|------|
|**sl_zed_interface**| C interface of the ZED SDK | [![NuGet version](https://badge.fury.io/nu/sl_zed_interface.svg)](https://badge.fury.io/nu/sl_zed_interface) |
|**Stereolabs.zed**| .NET Wrapper that imports the functions from the interface | [![NuGet version](https://badge.fury.io/nu/Stereolabs.zed.svg)](https://badge.fury.io/nu/Stereolabs.zed) |

## Add the package to your Project
Expand Down
64 changes: 0 additions & 64 deletions Stereolabs.zed/Readme.md

This file was deleted.

14 changes: 13 additions & 1 deletion Stereolabs.zed/src/ZEDCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,15 @@ struct sl_initParameters
/// </summary>
[MarshalAs(UnmanagedType.U1)]
public bool asyncGrabCameraRecovery;
/// <summary>
/// Define a computation upper limit to the grab frequency.
/// This can be useful to get a known constant fixed rate or limit the computation load while keeping a short exposure time by setting a high camera capture framerate.
/// The value should be inferior to the InitParameters::camera_fps and strictly positive.It has no effect when reading an SVO file.
/// This is an upper limit and won't make a difference if the computation is slower than the desired compute capping fps.
/// \note Internally the grab function always tries to get the latest available image while respecting the desired fps as much as possible.
/// </summary>
public float grabComputeCappingFPS;


/// <summary>
/// Copy constructor.
Expand Down Expand Up @@ -798,6 +807,7 @@ public sl_initParameters(InitParameters init)
enableImageEnhancement = init.enableImageEnhancement;
openTimeoutSec = init.openTimeoutSec;
asyncGrabCameraRecovery = init.asyncGrabCameraRecovery;
grabComputeCappingFPS = init.grabComputeCappingFPS;
}
}

Expand Down Expand Up @@ -1030,7 +1040,9 @@ public InitParameters GetInitParameters()
depthStabilization = sl_parameters.depthStabilization,
sensorsRequired = sl_parameters.sensorsRequired,
openTimeoutSec = sl_parameters.openTimeoutSec,
asyncGrabCameraRecovery = sl_parameters.asyncGrabCameraRecovery
asyncGrabCameraRecovery = sl_parameters.asyncGrabCameraRecovery,
grabComputeCappingFPS = sl_parameters.grabComputeCappingFPS

};
return parameters;
}
Expand Down
58 changes: 35 additions & 23 deletions Stereolabs.zed/src/ZEDCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
using System.Numerics;
using System;
using System.Collections.Generic;
using System.Windows.Documents;
using System.Windows.Controls;
using System.Reflection;

/// \defgroup Video_group Video Module
/// \defgroup Depth_group Depth Sensing Module
Expand Down Expand Up @@ -1353,6 +1350,15 @@ public class InitParameters
/// The default behavior is synchronous (false), like previous ZED SDK versions
/// </summary>
public bool asyncGrabCameraRecovery;
/// <summary>
/// Define a computation upper limit to the grab frequency.
/// This can be useful to get a known constant fixed rate or limit the computation load while keeping a short exposure time by setting a high camera capture framerate.
/// The value should be inferior to the InitParameters::camera_fps and strictly positive.It has no effect when reading an SVO file.
/// This is an upper limit and won't make a difference if the computation is slower than the desired compute capping fps.
/// \note Internally the grab function always tries to get the latest available image while respecting the desired fps as much as possible.
/// </summary>
public float grabComputeCappingFPS = 0;


/// <summary>
/// Constructor. Sets default initialization parameters.
Expand Down Expand Up @@ -1385,6 +1391,7 @@ public InitParameters()
this.optionalOpencvCalibrationFile = "";
this.openTimeoutSec = 5.0f;
this.asyncGrabCameraRecovery = false;
this.grabComputeCappingFPS = 0;
}

}
Expand Down Expand Up @@ -3045,40 +3052,40 @@ public struct BodyData
/// <summary>
/// A set of useful points representing the human body, expressed in 2D. We use a classic 18 points representation, the points semantic and order is given by BODY_PARTS.
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 70)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 38)]
public Vector2[] keypoints2D;
/// <summary>
/// A set of useful points representing the human body, expressed in 3D. We use a classic 18 points representation, the points semantic and order is given by BODY_PARTS.
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 70)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 38)]
public Vector3[] keypoints;// 3D position of the joints of the skeleton

/// <summary>
/// Per keypoint detection confidence, can not be lower than the \ref ObjectDetectionRuntimeParameters.detectionConfidenceThreshold.
/// Not available with DETECTION_MODEL.MULTI_CLASS_BOX.
/// in some cases, eg. body partially out of the image or missing depth data, some keypoint can not be detected, they will have non finite values.
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 70)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 38)]
public float[] keypointConfidence;

/// <summary>
/// Per keypoint detection confidence, can not be lower than the \ref ObjectDetectionRuntimeParameters.detectionConfidenceThreshold.
/// Not available with DETECTION_MODEL.MULTI_CLASS_BOX.
/// in some cases, eg. body partially out of the image or missing depth data, some keypoint can not be detected, they will have non finite values.
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 70)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 38)]
public CovarMatrix[] keypointCovariances;

/// <summary>
/// Global position per joint in the coordinate frame of the requested skeleton format.
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 70)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 38)]
public Vector3[] localPositionPerJoint;
/// <summary>
/// Local orientation per joint in the coordinate frame of the requested skeleton format.
/// The orientation is represented by a quaternion.
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 70)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 38)]
public Quaternion[] localOrientationPerJoint;
/// <summary>
/// Global root position.
Expand Down Expand Up @@ -3129,21 +3136,23 @@ public enum BODY_FORMAT
/// Simple body model, including simplified face and tracking wrists and ankle positions.
/// No hands nor feet tracking available with this model.
/// </summary>
POSE_18,
BODY_18,
/// <summary>
/// Body model, including feet, simplified face and simplified hands.
/// This body model does not provide wrist/ankle rotations.
/// </summary>
POSE_34,
BODY_34,
/// <summary>
/// Body model, including feet, simplified face and simplified hands
/// </summary>
POSE_38,
BODY_38,
#if false
/// <summary>
/// Body model, including feet, simplified face and detailed hands
/// </summary>
POSE_70
};
BODY_70
#endif
};

public enum BODY_KEYPOINTS_SELECTION
{
Expand Down Expand Up @@ -3340,6 +3349,7 @@ public enum AI_MODELS
/// related to sl.DETECTION_MODEL.HUMAN_BODY_ACCURATE
/// </summary>
HUMAN_BODY_38_ACCURATE_DETECTION,
#if false
/// <summary>
/// related to sl.DETECTION_MODEL.HUMAN_BODY_FAST
/// </summary>
Expand All @@ -3352,6 +3362,7 @@ public enum AI_MODELS
/// related to sl.DETECTION_MODEL.HUMAN_BODY_ACCURATE
/// </summary>
HUMAN_BODY_70_ACCURATE_DETECTION,
#endif
/// <summary>
/// related to sl.DETECTION_MODEL.PERSON_HEAD
/// </summary>
Expand Down Expand Up @@ -3509,10 +3520,11 @@ public enum BODY_38_PARTS
LAST
};

#if false
///\ingroup Object_group
/// <summary>
/// ssemantic of human body parts and order keypoints for BODY_FORMAT.POSE_70.
/// </summary>
/// <summary>
/// ssemantic of human body parts and order keypoints for BODY_FORMAT.POSE_70.
/// </summary>
public enum BODY_70_PARTS
{
PELVIS,
Expand Down Expand Up @@ -3592,7 +3604,7 @@ public enum BODY_70_PARTS

};


#endif
///\ingroup Object_group
/// <summary>
/// Contains batched data of a detected object
Expand Down Expand Up @@ -3767,13 +3779,13 @@ public class BodiesBatch



#endregion
#endregion

////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////// Fusion API ///////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////

#region Fusion API Module
#region Fusion API Module

public enum FUSION_ERROR_CODE
{
Expand Down Expand Up @@ -3985,13 +3997,13 @@ public struct FusionMetrics
public CameraMetrics[] cameraIndividualStats;
};

#endregion
#endregion

////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////// GNSS API ////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////

#region GNSS API
#region GNSS API

public struct GNSSData
{
Expand Down Expand Up @@ -4052,5 +4064,5 @@ public struct UTM
public string UTMZone;
}

#endregion
#endregion
}// end namespace sl

0 comments on commit 7797605

Please sign in to comment.