public void LoadAbleBodiedAvatar() { // Load SaveSystem.LoadUserData("MD1942"); AvatarSystem.LoadPlayer(SaveSystem.ActiveUser.type, AvatarType.AbleBodied); AvatarSystem.LoadAvatar(SaveSystem.ActiveUser, AvatarType.AbleBodied, false); // Initialize UI. //InitializeUI(); // Change the number for the forearm tracker being used GameObject faTrackerGO = GameObject.FindGameObjectWithTag("ForearmTracker"); SteamVR_TrackedObject steamvrConfig = faTrackerGO.GetComponent <SteamVR_TrackedObject>(); steamvrConfig.index = SteamVR_TrackedObject.EIndex.Device5; // Configure the grasp manager GameObject graspManagerGO = GameObject.FindGameObjectWithTag("GraspManager"); if (graspManagerGO == null) { throw new System.Exception("Grasp Manager not found."); } GraspManager graspManager = graspManagerGO.GetComponent <GraspManager>(); graspManager.managerType = GraspManager.GraspManagerType.Assisted; graspManager.managerMode = GraspManager.GraspManagerMode.Restriced; }
public void LoadTHAvatar() { SaveSystem.LoadUserData("MD1942"); AvatarSystem.LoadPlayer(UserType.Ablebodied, AvatarType.Transhumeral); AvatarSystem.LoadAvatar(SaveSystem.ActiveUser, AvatarType.Transhumeral); // Initialize prosthesis GameObject prosthesisManagerGO = GameObject.FindGameObjectWithTag("ProsthesisManager"); elbowManager = prosthesisManagerGO.AddComponent <ConfigurableElbowManager>(); elbowManager.InitializeProsthesis(SaveSystem.ActiveUser.upperArmLength, (SaveSystem.ActiveUser.forearmLength + SaveSystem.ActiveUser.handLength / 2.0f), 1.5f); // Set the reference generator to jacobian-based. elbowManager.ChangeReferenceGenerator("VAL_REFGEN_LINKINSYN"); //elbowManager.ChangeReferenceGenerator("VAL_REFGEN_JACOBIANSYN"); // Initialize UI. //InitializeUI(); // Configure the grasp manager GameObject graspManagerGO = GameObject.FindGameObjectWithTag("GraspManager"); if (graspManagerGO == null) { throw new System.Exception("Grasp Manager not found."); } GraspManager graspManager = graspManagerGO.GetComponent <GraspManager>(); graspManager.managerType = GraspManager.GraspManagerType.Assisted; graspManager.managerMode = GraspManager.GraspManagerMode.Restriced; // set syn elbowManager.SetSynergy(theta); }
// Start is called before the first frame update void Start() { // Load player SaveSystem.LoadUserData("MD1942"); AvatarSystem.LoadPlayer(SaveSystem.ActiveUser.type, avatarType); InitialiseExperimentSystems(); InitializeUI(); }
// Start is called before the first frame update void Awake() { // Load player if (debug) { SaveSystem.LoadUserData("MD1942"); AvatarSystem.LoadPlayer(SaveSystem.ActiveUser.type, AvatarType.AbleBodied); AvatarSystem.LoadAvatar(SaveSystem.ActiveUser, AvatarType.AbleBodied); } }
// Here are all the methods you need to write for your experiment. #region GameMaster Inherited Methods // Place debug stuff here, for when you want to test the experiment directly from the world without // having to load it from the menus. private void Awake() { if (debug) { SaveSystem.LoadUserData("DB1942174"); // Load the test/demo user (Mr Demo) // // Debug using able-bodied configuration // AvatarSystem.LoadPlayer(SaveSystem.ActiveUser.type, AvatarType.AbleBodied); AvatarSystem.LoadAvatar(SaveSystem.ActiveUser, AvatarType.AbleBodied); } }
private void Awake() { if (debug) { SaveSystem.LoadUserData("MD1942"); //SaveSystem.LoadUserData("RG1988"); // // Debug Able // AvatarSystem.LoadPlayer(SaveSystem.ActiveUser.type, AvatarType.AbleBodied); AvatarSystem.LoadAvatar(SaveSystem.ActiveUser, AvatarType.AbleBodied); } }
// Debug // private GameObject handGO; // private GameObject elbowGO; // Start is called before the first frame update protected override void Start() { TrainingCamera.enabled = false; if (debug) { // Load player SaveSystem.LoadUserData("MD1942"); AvatarSystem.LoadPlayer(SaveSystem.ActiveUser.type, avatarType); } else { InitialiseExperimentSystems(); InitializeUI(); } }
public void LoadAbleBodiedAvatar() { try { AvatarSystem.LoadPlayer(SaveSystem.ActiveUser.type, AvatarType.AbleBodied); AvatarSystem.LoadAvatar(SaveSystem.ActiveUser, AvatarType.AbleBodied); KeepPlayerGameObjects(); StartCoroutine(ResetCamera()); StartCoroutine(DisplayInformationAndReturn(2.0f, "Successfully loaded able-bodied avatar.")); } catch (System.Exception e) { StartCoroutine(DisplayInformationAndReturn(10.0f, e.Message)); } }
// Start is called before the first frame update void Start() { if (debug) { SaveSystem.LoadUserData("MD1942"); AvatarSystem.LoadPlayer(UserType.Ablebodied, AvatarType.AbleBodied); AvatarSystem.LoadAvatar(SaveSystem.ActiveUser, AvatarType.AbleBodied); } // Initialize ExperimentSystem InitialiseExperimentSystems(); // Initialize UI. InitializeUI(); // Initialize iteration management. timeIterationLimit = iterationsPerAngle * startAngleList.Count; totalIterationLimit = iterationsPerAngle * startAngleList.Count * movementTimeList.Count; // SetWaitFlag(5.0f); }
// Here are all the methods you need to write for your experiment. #region GameMaster Inherited Methods // Place debug stuff here, for when you want to test the experiment directly from the world without // having to load it from the menus. private void Awake() { if (debug) { //// Save some test config data //string configFilePath = Application.dataPath + "/Resources/Experiments/GridReaching2020.json"; //Debug.Log(configFilePath); //configurator = new GridReachingConfigurator(); //string configuratorAsJson = JsonUtility.ToJson(configurator); //File.WriteAllText(configFilePath, configuratorAsJson); // // Debug able // SaveSystem.LoadUserData("TB1995175"); // Load the test/demo user (Mr Demo) // // Debug using able-bodied configuration // /* * AvatarSystem.LoadPlayer(SaveSystem.ActiveUser.type, AvatarType.AbleBodied); * AvatarSystem.LoadAvatar(SaveSystem.ActiveUser, AvatarType.AbleBodied); */ // // Debug prosthetic // AvatarSystem.LoadPlayer(UserType.Ablebodied, AvatarType.Transhumeral); AvatarSystem.LoadAvatar(SaveSystem.ActiveUser, AvatarType.Transhumeral); // Initialize prosthesis GameObject prosthesisManagerGO = GameObject.FindGameObjectWithTag("ProsthesisManager"); ConfigurableElbowManager elbowManager = prosthesisManagerGO.AddComponent <ConfigurableElbowManager>(); elbowManager.InitializeProsthesis(SaveSystem.ActiveUser.upperArmLength, (SaveSystem.ActiveUser.forearmLength + SaveSystem.ActiveUser.handLength / 2.0f)); // Set the reference generator to jacobian-based. //elbowManager.ChangeReferenceGenerator("VAL_REFGEN_JACOBIANSYN"); // Set the reference generator to linear synergy. elbowManager.ChangeReferenceGenerator("VAL_REFGEN_LINKINSYN"); } }
public void LoadNoFeedbackTransradialAvatar() { try { AvatarSystem.LoadPlayer(SaveSystem.ActiveUser.type, AvatarType.Transradial); AvatarSystem.LoadAvatar(SaveSystem.ActiveUser, AvatarType.Transradial); //mainCamera.fieldOfView = 60; KeepPlayerGameObjects(); StartCoroutine(ResetCamera()); StartCoroutine(DisplayInformationAndReturn(2.0f, "Successfully loaded transradial avatar.")); // Initialize prosthesis GameObject prosthesisManagerGO = GameObject.FindGameObjectWithTag("ProsthesisManager"); FakeEMGBoniHand prosthesisManager = prosthesisManagerGO.AddComponent <FakeEMGBoniHand>(); //prosthesisManager.InitializeProsthesis(); } catch (System.Exception e) { StartCoroutine(DisplayInformationAndReturn(10.0f, e.Message)); } }