Update to LeapSDK 5.17.1

Update to Ultraleap Unity Plugin 6.13.0
This commit is contained in:
SDraw 2023-11-28 19:08:30 +03:00
parent 4aaca216d7
commit da09ce831a
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
8 changed files with 43 additions and 73 deletions

View file

@ -18,6 +18,7 @@ namespace Leap
/// ///
/// @since 1.0 /// @since 1.0
/// </summary> /// </summary>
[Obsolete("Config.cs is not used in Ultraleap's Tracking Service 5.X+. This will be removed in the next Major release")]
public class Config public class Config
{ {
private Connection _connection; private Connection _connection;
@ -29,12 +30,15 @@ namespace Leap
/// Note that the Controller.Config provides a properly initialized Config object already. /// Note that the Controller.Config provides a properly initialized Config object already.
/// @since 3.0 /// @since 3.0
/// </summary> /// </summary>
[Obsolete("Config.cs is not used in Ultraleap's Tracking Service 5.X+. This will be removed in the next Major release")]
public Config(Connection.Key connectionKey) public Config(Connection.Key connectionKey)
{ {
_connection = Connection.GetConnection(connectionKey); _connection = Connection.GetConnection(connectionKey);
_connection.LeapConfigChange += handleConfigChange; _connection.LeapConfigChange += handleConfigChange;
_connection.LeapConfigResponse += handleConfigResponse; _connection.LeapConfigResponse += handleConfigResponse;
} }
[Obsolete("Config.cs is not used in Ultraleap's Tracking Service 5.X+. This will be removed in the next Major release")]
public Config(int connectionId) : this(new Connection.Key(connectionId)) { } public Config(int connectionId) : this(new Connection.Key(connectionId)) { }
private void handleConfigChange(object sender, ConfigChangeEventArgs eventArgs) private void handleConfigChange(object sender, ConfigChangeEventArgs eventArgs)
@ -87,6 +91,7 @@ namespace Leap
/// ///
/// @since 3.0 /// @since 3.0
/// </summary> /// </summary>
[Obsolete("Config.cs is not used in Ultraleap's Tracking Service 5.X+. This will be removed in the next Major release")]
public bool Get<T>(string key, Action<T> onResult) public bool Get<T>(string key, Action<T> onResult)
{ {
uint requestId = _connection.GetConfigValue(key); uint requestId = _connection.GetConfigValue(key);
@ -107,6 +112,7 @@ namespace Leap
/// ///
/// @since 3.0 /// @since 3.0
/// </summary> /// </summary>
[Obsolete("Config.cs is not used in Ultraleap's Tracking Service 5.X+. This will be removed in the next Major release")]
public bool Set<T>(string key, T value, Action<bool> onResult) where T : IConvertible public bool Set<T>(string key, T value, Action<bool> onResult) where T : IConvertible
{ {
uint requestId = _connection.SetConfigValue<T>(key, value); uint requestId = _connection.SetConfigValue<T>(key, value);
@ -123,6 +129,7 @@ namespace Leap
/// Enumerates the possible data types for configuration values. /// Enumerates the possible data types for configuration values.
/// @since 1.0 /// @since 1.0
/// </summary> /// </summary>
[Obsolete("Config.cs is not used in Ultraleap's Tracking Service 5.X+. This will be removed in the next Major release")]
public enum ValueType public enum ValueType
{ {
TYPE_UNKNOWN = 0, TYPE_UNKNOWN = 0,

View file

@ -359,9 +359,6 @@ namespace LeapInternal
StructMarshal<LEAP_CONFIG_CHANGE_EVENT>.PtrToStruct(_msg.eventStructPtr, out config_change_evt); StructMarshal<LEAP_CONFIG_CHANGE_EVENT>.PtrToStruct(_msg.eventStructPtr, out config_change_evt);
handleConfigChange(ref config_change_evt); handleConfigChange(ref config_change_evt);
break; break;
case eLeapEventType.eLeapEventType_ConfigResponse:
handleConfigResponse(ref _msg);
break;
case eLeapEventType.eLeapEventType_DroppedFrame: case eLeapEventType.eLeapEventType_DroppedFrame:
LEAP_DROPPED_FRAME_EVENT dropped_frame_evt; LEAP_DROPPED_FRAME_EVENT dropped_frame_evt;
StructMarshal<LEAP_DROPPED_FRAME_EVENT>.PtrToStruct(_msg.eventStructPtr, out dropped_frame_evt); StructMarshal<LEAP_DROPPED_FRAME_EVENT>.PtrToStruct(_msg.eventStructPtr, out dropped_frame_evt);
@ -749,55 +746,6 @@ namespace LeapInternal
} }
} }
private void handleConfigResponse(ref LEAP_CONNECTION_MESSAGE configMsg)
{
LEAP_CONFIG_RESPONSE_EVENT config_response_evt;
StructMarshal<LEAP_CONFIG_RESPONSE_EVENT>.PtrToStruct(configMsg.eventStructPtr, out config_response_evt);
string config_key = "";
_configRequests.TryGetValue(config_response_evt.requestId, out config_key);
if (config_key != null)
_configRequests.Remove(config_response_evt.requestId);
Config.ValueType dataType;
object value;
uint requestId = config_response_evt.requestId;
if (config_response_evt.value.type != eLeapValueType.eLeapValueType_String)
{
switch (config_response_evt.value.type)
{
case eLeapValueType.eLeapValueType_Boolean:
dataType = Config.ValueType.TYPE_BOOLEAN;
value = config_response_evt.value.boolValue;
break;
case eLeapValueType.eLeapValueType_Int32:
dataType = Config.ValueType.TYPE_INT32;
value = config_response_evt.value.intValue;
break;
case eLeapValueType.eLeapValueType_Float:
dataType = Config.ValueType.TYPE_FLOAT;
value = config_response_evt.value.floatValue;
break;
default:
dataType = Config.ValueType.TYPE_UNKNOWN;
value = new object();
break;
}
}
else
{
LEAP_CONFIG_RESPONSE_EVENT_WITH_REF_TYPE config_ref_value;
StructMarshal<LEAP_CONFIG_RESPONSE_EVENT_WITH_REF_TYPE>.PtrToStruct(configMsg.eventStructPtr, out config_ref_value);
dataType = Config.ValueType.TYPE_STRING;
value = config_ref_value.value.stringValue;
}
SetConfigResponseEventArgs args = new SetConfigResponseEventArgs(config_key, dataType, value, requestId);
if (LeapConfigResponse != null)
{
LeapConfigResponse.DispatchOnContext(this, EventContext, args);
}
}
private void reportLogMessage(ref LEAP_LOG_EVENT logMsg) private void reportLogMessage(ref LEAP_LOG_EVENT logMsg)
{ {
if (LeapLogEvent != null) if (LeapLogEvent != null)

View file

@ -43,7 +43,6 @@ namespace Leap
bool _disposed = false; bool _disposed = false;
bool _supportsMultipleDevices = true; bool _supportsMultipleDevices = true;
string _serverNamespace = "Leap Service"; string _serverNamespace = "Leap Service";
Config _config;
/// <summary> /// <summary>
/// The SynchronizationContext used for dispatching events. /// The SynchronizationContext used for dispatching events.
@ -871,13 +870,12 @@ namespace Leap
/// ///
/// @since 1.0 /// @since 1.0
/// </summary> /// </summary>
[Obsolete("Config.cs is not used in Ultraleap's Tracking Service 5.X+. This will be removed in the next Major release")]
public Config Config public Config Config
{ {
get get
{ {
if (_config == null) return null;
_config = new Config(this._connection.ConnectionKey);
return _config;
} }
} }

View file

@ -121,14 +121,6 @@ namespace Leap
IsStreaming = true; IsStreaming = true;
else else
IsStreaming = false; IsStreaming = false;
if ((status & eLeapDeviceStatus.eLeapDeviceStatus_Smudged) == eLeapDeviceStatus.eLeapDeviceStatus_Smudged)
IsSmudged = true;
else
IsSmudged = false;
if ((status & eLeapDeviceStatus.eLeapDeviceStatus_Robust) == eLeapDeviceStatus.eLeapDeviceStatus_Robust)
IsLightingBad = true;
else
IsLightingBad = false;
if ((status & eLeapDeviceStatus.eLeapDeviceStatus_LowResource) == eLeapDeviceStatus.eLeapDeviceStatus_LowResource) if ((status & eLeapDeviceStatus.eLeapDeviceStatus_LowResource) == eLeapDeviceStatus.eLeapDeviceStatus_LowResource)
IsLowResource = true; IsLowResource = true;
else else
@ -349,6 +341,7 @@ namespace Leap
/// over the Leap Motion cameras. /// over the Leap Motion cameras.
/// @since 3.0 /// @since 3.0
/// </summary> /// </summary>
[Obsolete("IsSmudged is not used in Ultraleap's Tracking Service 5.X+. This will be removed in the next Major release")]
public bool IsSmudged { get; internal set; } public bool IsSmudged { get; internal set; }
/// <summary> /// <summary>
@ -363,6 +356,7 @@ namespace Leap
/// isLightingBad() is true. /// isLightingBad() is true.
/// @since 3.0 /// @since 3.0
/// </summary> /// </summary>
[Obsolete("IsLightingBad is not used in Ultraleap's Tracking Service 5.X+. This will be removed in the next Major release")]
public bool IsLightingBad { get; internal set; } public bool IsLightingBad { get; internal set; }
/// <summary> /// <summary>

View file

@ -179,6 +179,7 @@ namespace Leap
/// Provides the configuration key, whether the change was successful, and the id of the original change request. /// Provides the configuration key, whether the change was successful, and the id of the original change request.
/// @since 3.0 /// @since 3.0
/// </summary> /// </summary>
[Obsolete("Config.cs is not used in Ultraleap's Tracking Service 5.X+. This will be removed in the next Major release")]
public class SetConfigResponseEventArgs : LeapEventArgs public class SetConfigResponseEventArgs : LeapEventArgs
{ {
public SetConfigResponseEventArgs(string config_key, Config.ValueType dataType, object value, uint requestId) : base(LeapEvent.EVENT_CONFIG_RESPONSE) public SetConfigResponseEventArgs(string config_key, Config.ValueType dataType, object value, uint requestId) : base(LeapEvent.EVENT_CONFIG_RESPONSE)

View file

@ -24,7 +24,7 @@ namespace Leap
long Now(); long Now();
bool IsConnected { get; } bool IsConnected { get; }
Config Config { get; }
DeviceList Devices { get; } DeviceList Devices { get; }
event EventHandler<ConnectionEventArgs> Connect; event EventHandler<ConnectionEventArgs> Connect;

View file

@ -84,21 +84,43 @@ cmake --build $env:REPOS_BUILD_ROOT/$env:BUILD_TYPE/LeapSDK/leapc_example -j --c
4. Open and build the CMake generated project files. For more help, see the CMake documentation. 4. Open and build the CMake generated project files. For more help, see the CMake documentation.
* An example script would be : * An example script would be :
```bash ```bash
SRC_DIR=/usr/share/doc/ultraleap-hand-tracking-service/samples SRC_DIR=/usr/share/doc/ultraleap-hand-tracking-service/samples
BUILD_TYPE='Release' BUILD_TYPE='Release'
REPOS_BUILD_ROOT=~/ultraleap-tracking-samples/build REPOS_BUILD_ROOT=~/ultraleap-tracking-samples/build
REPOS_INSTALL_ROOT=/usr/bin/ultraleap-tracking-samples REPOS_INSTALL_ROOT=/usr/bin/ultraleap-tracking-samples
cmake -S ${SRC_DIR} -B ${REPOS_BUILD_ROOT}/${BUILD_TYPE}/LeapSDK/leapc_example ` cmake -S ${SRC_DIR} -B ${REPOS_BUILD_ROOT}/${BUILD_TYPE}/LeapSDK/leapc_example `
-DCMAKE_INSTALL_PREFIX="${REPOS_INSTALL_ROOT}/leapc_example" ` -DCMAKE_INSTALL_PREFIX="${REPOS_INSTALL_ROOT}/leapc_example" `
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}"
cmake --build ${REPOS_BUILD_ROOT}/${BUILD_TYPE}/LeapSDK/leapc_example -j --config ${BUILD_TYPE} cmake --build ${REPOS_BUILD_ROOT}/${BUILD_TYPE}/LeapSDK/leapc_example -j --config ${BUILD_TYPE}
```
### ARM64 Linux
1. Open the top level directory of the untarred release and select a build directory (eg. ~/ultraleap-tracking-samples/build) to use
2. Set the CMAKE_PREFIX_PATH directory to the absolute location of LeapSDK
3. Configure & Generate CMake with the generator of your choice
4. Open and build the CMake generated project files. For more help, see the CMake documentation.
* An example script would be :
```bash
SRC_DIR='LeapSDK/samples'
BUILD_TYPE='Release'
REPOS_BUILD_ROOT=~/ultraleap-tracking-samples/build
REPOS_INSTALL_ROOT=~/ultraleap-tracking-samples/bin
PREFIX_PATH=$(pwd)/LeapSDK
cmake -S ${SRC_DIR} -B ${REPOS_BUILD_ROOT}/${BUILD_TYPE}/LeapSDK/leapc_example `
-DCMAKE_INSTALL_PREFIX="${REPOS_INSTALL_ROOT}/leapc_example"`
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" -DCMAKE_PREFIX_PATH="${PREFIX_PATH}"
cmake --build ${REPOS_BUILD_ROOT}/${BUILD_TYPE}/LeapSDK/leapc_example -j --config ${BUILD_TYPE}
``` ```
### MacOS ### MacOS
1. Open CMake using /Applications/Ultraleap\ Hand\ Tracking\ Service.app/Contents/LeapSDK/samples as the source directory 1. Open CMake using /Applications/Ultraleap\ Hand\ Tracking.app/Contents/LeapSDK/samples as the source directory
2. Select a build directory (eg. ~/ultraleap-tracking-samples/build) to use 2. Select a build directory (eg. ~/ultraleap-tracking-samples/build) to use
@ -107,7 +129,7 @@ cmake --build ${REPOS_BUILD_ROOT}/${BUILD_TYPE}/LeapSDK/leapc_example -j --confi
4. Open and build the CMake generated project files. For more help, see the CMake documentation. 4. Open and build the CMake generated project files. For more help, see the CMake documentation.
* An example script would be : * An example script would be :
```bash ```bash
SRC_DIR='/Applications/Ultraleap\ Hand\ Tracking\ Service.app/Contents/LeapSDK/samples' SRC_DIR='/Applications/Ultraleap\ Hand\ Tracking.app/Contents/LeapSDK/samples'
BUILD_TYPE='Release' BUILD_TYPE='Release'
REPOS_BUILD_ROOT=~/ultraleap-tracking-samples/build REPOS_BUILD_ROOT=~/ultraleap-tracking-samples/build
REPOS_INSTALL_ROOT=~/ultraleap-tracking-samples/bin REPOS_INSTALL_ROOT=~/ultraleap-tracking-samples/bin

Binary file not shown.