private void Update() { if (!_modalityEnabled || internalFlag) { return; } try { threadNewSamp = AnimusClient.AnimusClient.GetModality(robotID, modalityName, false); if (threadNewSamp == null) { return; } if (threadNewSamp.Error != null) { if (threadNewSamp.Error.Success) { updateNewSamp = AnimusUtils.DecodeData(threadNewSamp.Sample); setModality.Invoke(client, new object[] { updateNewSamp.Data }); setModalityFPS.increment(-1); } } } catch (Exception e) { Debug.Log($"Set Modality error for {modalityName} modality: {e}"); } }
public static unsafe GetModalityProto GetModality(string robotID, string modalityName, bool blocking) { var sdkReturn = animus_client_sdk.GetModalityGo(robotID, modalityName, (blocking) ? 1:0); if (sdkReturn == null) { return(new GetModalityProto { Error = new Error { Success = false } }); } var err = new GetModalityProto(); err.MergeFrom(sdkReturn.GetBytes()); return(err); }