// Start is called before the first frame update void Start() { Origin = transform.position; SphereOriginVec = UFOSphere.transform.position; StickOriginVec = Stick.transform.position; gameManager = GameObject.Find("GameManager").GetComponent <GameManager>(); LeftArm1Controller = LeftArm1.GetComponent <ArmController>(); LeftArm2Controller = LeftArm2.GetComponent <ArmController>(); LeftArm3Controller = LeftArm3.GetComponent <ArmController>(); RightArm1Controller = RightArm1.GetComponent <ArmController>(); RightArm2Controller = RightArm2.GetComponent <ArmController>(); RightArm3Controller = RightArm3.GetComponent <ArmController>(); ArmList.Add(GameObject.Find("L1").gameObject); ArmList.Add(GameObject.Find("L2").gameObject); ArmList.Add(GameObject.Find("L3").gameObject); ArmList.Add(GameObject.Find("R1").gameObject); ArmList.Add(GameObject.Find("R2").gameObject); ArmList.Add(GameObject.Find("R3").gameObject); foreach (GameObject obj in ArmList) { ArmPos.Add(obj, obj.transform.position); } }
void Start() { arm = gameObject.GetComponentInChildren <ArmController>(); camera = gameObject.GetComponentInChildren <Camera>(); follow = gameObject.GetComponent <Follow>(); handleSettings(invertYaxis); }
void OnEnable() { if (serializedObject == null) { return; } _arm = target as ArmController; //Find hips Transform spine2 = _arm.gameObject.transform.Find("Hips").GetChild(2).GetChild(0).GetChild(0); if (_arm == null) { Debug.Log("No torso controller found"); return; } _arm.Arms[0].Shoulder.transform = spine2.transform.GetChild(0).GetChild(0); _arm.Arms[0].Elbow.transform = spine2.transform.GetChild(0).GetChild(0).GetChild(0); _arm.Arms[0].Wrist.transform = spine2.transform.GetChild(0).GetChild(0).GetChild(0).GetChild(0); _arm.Arms[1].Shoulder.transform = spine2.transform.GetChild(2).GetChild(0); _arm.Arms[1].Elbow.transform = spine2.transform.GetChild(2).GetChild(0).GetChild(0); _arm.Arms[1].Wrist.transform = spine2.transform.GetChild(2).GetChild(0).GetChild(0).GetChild(0); }
public void enableAbility(CenterController centerController) { _isEnable = true; rotateArm = centerController.getRotateArm(); armController = centerController.getArmController(); this.centerController = centerController; }
private void OnCollisionStay2D(Collision2D collision) { // determine if objects on the treadmill are supposed to move if (collision.collider.CompareTag("Physical Object")) { GameObject objectOnTreadmill = collision.gameObject; Rigidbody2D rb = objectOnTreadmill.GetComponent <Rigidbody2D>(); if (rb.velocity.magnitude < speed) { float horizontal = dir * speed * Time.deltaTime; float vertical = rb.velocity.y * Time.deltaTime; rb.velocity = new Vector3(horizontal, vertical, 0.0f); } } if (collision.collider.CompareTag("Player")) { PlayerController player = collision.gameObject.GetComponent <PlayerController>(); if (!player.GetOnTreadMill()) { player.SetOnTreadmill(true); player.SetTreadmillVelocity(dir * speed); } } if (collision.collider.CompareTag("Arm")) { ArmController hand = collision.gameObject.GetComponent <ArmController>(); if (!hand.GetOnTreadMill()) { hand.SetOnTreadmill(true); hand.SetTreadmillVelocity(dir * speed); } } }
public void enableAbility(CenterController centerController) { _isEnable = true; armRig = centerController.getArmController().getRig(); playerRig = centerController.getRig(); armController = centerController.getArmController(); }
void Start() { rng = new MersenneTwister(seed); arm = GetComponent <ArmController>(); // Logging log = new List <string>(); logDataPath = Path.Combine(Application.persistentDataPath, "data"); logDataPath = Path.Combine(logDataPath, name); if (!Directory.Exists(logDataPath)) { Directory.CreateDirectory(logDataPath); } // Initialize Nik if (useNik) { nik = new NikHtm(); nik.Start(); if (serializedModelName != null && serializedModelName.Trim().Length > 0) { StartCoroutine(Load()); } } isTraining = false; }
public void enableAbility(CenterController centerController) { armController = centerController.getArmController(); joint2D = armController.getJoint(); rig = armController.getRig(); armController.showArm(); _isEnable = true; }
// Start is called before the first frame update void Start() { if (arm == null) { arm = GetComponent <ArmController>(); } StartCoroutine(JumpHandler()); }
public GeneralStatus(MyGridProgram program, ArmController arm, ConnectionClient conClient) { IMyGridTerminalSystem gts = program.GridTerminalSystem; IMyCubeGrid grid = program.Me.CubeGrid; gts.GetBlocksOfType(this.armLights, l => grid != l.CubeGrid && l.CubeGrid.IsSameConstructAs(grid)); gts.GetBlocksOfType(this.frontLights, l => l.CubeGrid == grid && l.DisplayNameText.Contains("Front")); this.arm = arm; this.conClient = conClient; }
void Start() { camTransform = Camera.main.transform; camOffset = camTransform.position - transform.position; rb = GetComponent <Rigidbody>(); armController = Shoulder.GetComponent <ArmController>(); movingActions = new LinkedList <int>(); buttonDowns = new bool[] { false, false, false, false }; buttonUps = new bool[] { false, false, false, false }; bodyTransform = transform.GetChild(0); }
private void Start() { // Pega referencia do RosConnector this.rosConnector = GetComponent <RosConnector>(); // Pega referencia do ArmController this.ac = GetComponent <ArmController>(); // Instancia o action-server this.kinovagen3ActionServer = new KinovaGen3ActionServer(actionName, rosConnector.RosSocket, new Log(x => Debug.Log(x)), this.ac, this.timeout_ms); // Inicia o servidor this.kinovagen3ActionServer.Initialize(); }
protected void UpdateInput(Controller controller, ArmController armController) { if (handTarget.isLeft) { SetControllerInput(controller.left, armController); } else { SetControllerInput(controller.right, armController); } }
private void OnCollisionExit2D(Collision2D collision) { if (collision.collider.CompareTag("Player")) { PlayerController player = collision.gameObject.GetComponent <PlayerController>(); player.SetOnTreadmill(false); } if (collision.collider.CompareTag("Arm")) { ArmController hand = collision.gameObject.GetComponent <ArmController>(); hand.SetOnTreadmill(false); } }
public KinovaGen3ActionServer(string actionName, RosSocket rosSocket, Log log, ArmController ac, float timeout) { // Nome da ação this.actionName = actionName; // RosSocket this.rosSocket = rosSocket; // Interface de log this.log = log; // Controlador do braço this.ac = ac; // Armazena quanto tempo deve-se esperar entre dois pontos de uma trajetória antes de abortar this.timeout = timeout; // Variável que armazena a ação em si (como visto em http://docs.ros.org/en/electric/api/control_msgs/html/msg/FollowJointTrajectoryAction.html) this.action = new FollowJointTrajectoryAction(); }
void Awake() { ArmC = GetComponent(typeof(ArmController)) as ArmController; if (ArmC != null) { _arms = ArmC.Arms; } #if DEBUGMODE _targetRPrev = new List <Vector3>(); _targetLPrev = new List <Vector3>(); #endif _sArr = new List <float>(); _velArr = new List <float>(); _tppArr = new List <float>(); }
private void Awake() { m_Rigidbody2D = GetComponent <Rigidbody2D>(); m_Animator = GetComponent <Animator>(); m_SpriteRenderer = GetComponent <SpriteRenderer>(); m_ArmController = gameObject.GetComponentInChildren <ArmController>(); if (OnLandEvent == null) { OnLandEvent = new UnityEvent(); } if (OnCrouchEvent == null) { OnCrouchEvent = new BoolEvent(); } initialGravity = m_Rigidbody2D.gravityScale; }
public Program() { this.Runtime.UpdateFrequency = UpdateFrequency.Update1; var cockpits = new List <IMyCockpit>(); this.GridTerminalSystem.GetBlocksOfType(cockpits, c => c.CubeGrid == this.Me.CubeGrid); IMyCockpit cockpit = cockpits.First(); this.manager = Process.CreateManager(this.Echo); var ct = new CoordinatesTransformer(cockpit, this.manager); var logger = new Logger(this.manager, cockpit.GetSurface(0), new Color(0, 39, 15), new Color(27, 228, 33), this.Echo, 1.0f); this.cmd = new CommandLine("Small welder", logger.Log, this.manager); var ini = new IniWatcher(this.Me, this.manager); var wc = new WheelsController(this.cmd, cockpit, this.GridTerminalSystem, ini, this.manager, ct); var ac = new ArmController(ini, this, this.cmd, cockpit, wc, this.manager); var client = new ConnectionClient(ini, this.GridTerminalSystem, this.IGC, this.cmd, this.manager, logger.Log); var ah = new PilotAssist(this.GridTerminalSystem, ini, logger.Log, this.manager, wc); ah.AddBraker(client); }
protected void SetControllerInput(ControllerSide controllerSide, ArmController armController) { controllerSide.stickHorizontal += armController.input.stickHorizontal; controllerSide.stickVertical += armController.input.stickVertical; controllerSide.stickButton |= armController.input.stickPress; //controllerSide.up |= armController.input.up; //controllerSide.down |= armController.input.down; //controllerSide.left |= armController.input.left; //controllerSide.right |= armController.input.right; controllerSide.buttons[0] |= armController.input.buttons[0]; controllerSide.buttons[1] |= armController.input.buttons[1]; controllerSide.buttons[2] |= armController.input.buttons[2]; controllerSide.buttons[3] |= armController.input.buttons[3]; controllerSide.trigger1 += armController.input.trigger1; controllerSide.trigger2 += armController.input.trigger2; controllerSide.option |= armController.input.option; }
public Program() { this.Runtime.UpdateFrequency = UpdateFrequency.Update1; var topLefts = new List <IMyTextSurface>(); var topRights = new List <IMyTextSurface>(); IMyTextSurface keyboard; IMyCockpit cockpit; this.manager = Process.CreateManager(this.Echo); this.initCockpit(out cockpit, topLefts, topRights, out keyboard); var ct = new CoordinatesTransformer(cockpit, this.manager); var logger = new Logger(this.manager, keyboard, new Color(0, 39, 15), new Color(27, 228, 33), this.Echo, 1.0f); this.cmd = new CommandLine("Boring machine", logger.Log, this.manager); var ini = new IniWatcher(this.Me, this.manager); var wc = new WheelsController(this.cmd, cockpit, this.GridTerminalSystem, ini, this.manager, ct); var ac = new ArmController(ini, this, this.cmd, cockpit, wc, this.manager); var iw = new InventoryWatcher(this.cmd, this.GridTerminalSystem, cockpit); var cc = new ConnectionClient(ini, this.GridTerminalSystem, this.IGC, this.cmd, this.manager, logger.Log); var rcs = new List <IMyRemoteControl>(); this.GridTerminalSystem.GetBlocksOfType(rcs, r => r.CubeGrid == this.Me.CubeGrid); IMyRemoteControl frc = rcs.First(r => r.DisplayNameText.Contains("Forward")); IMyRemoteControl brc = rcs.First(r => r.DisplayNameText.Contains("Backward")); var ap = new Autopilot(ini, wc, this.cmd, frc, logger.Log, this.manager); var ah = new PilotAssist(this.GridTerminalSystem, ini, logger.Log, this.manager, wc); ah.AddBraker(cc); ah.AddDeactivator(ap); var ar = new AutoRoutineHandler(this.cmd); // TODO parse routines new MiningRoutines(ini, this.cmd, ap, this.manager); var progs = new List <IMyProgrammableBlock>(); this.GridTerminalSystem.GetBlocksOfType(progs, pr => pr.CubeGrid == this.Me.CubeGrid); var genStatus = new GeneralStatus(this, ac, cc); new ScreensController(genStatus, iw, topLefts, topRights, this.scheme, cockpit.CustomData, this.manager); }
public InterpOperation(ArmController arm, Vector3D worldtarg, double WristPitch, double WristYaw) { this.arm = arm; CurrentState = arm.GetCurrentState(); EndState = arm.FindAnglesState(worldtarg, WristPitch, WristYaw); EndPos = worldtarg; CurrentPos = arm.FindPos(out StartWristPitch, out StartWristYaw); //CurrentPos += arm.wristYaw.WorldMatrix.Up * arm.headHeight; stepAmount = stepSize / Vector3D.Distance(CurrentPos, EndPos); // StartWristPitch = arm.wristPitch.Angle + arm.shoulderPitch.Angle - arm.Elbow.Angle; // StartWristYaw = arm.wristYaw.Angle - arm.shoulderYaw.Angle; EndWristPitch = WristPitch; EndWristYaw = WristYaw; }
// Inicializa mensagem e armazena referência do controlador do braço protected override void Start() { this.ac = this.transform.GetComponent <ArmController>(); base.Start(); InitializeMessage(); }
void Awake () { ArmC = GetComponent(typeof(ArmController)) as ArmController; if (ArmC != null) _arms = ArmC.Arms; #if DEBUGMODE _targetRPrev = new List<Vector3>(); _targetLPrev = new List<Vector3>(); #endif _sArr = new List<float>(); _velArr = new List<float>(); _tppArr = new List<float>(); }
void Start() { armController = GetComponent <ArmController> (); }