void Start()
        {
            _robotArm     = GetComponent <RobotArm>();
            _ik           = GetComponent <RobotArmIK>();
            _targetAngles = new TargetPositions();

            _targetPositions = new List <PositionAndEndeffectorAngle>();

            /*
             * // look up/down
             * _targetPositions.Add(new PositionAndEndeffectorAngle {
             *  Position = new Vector3(134f, 60f, 0f),
             *  EndeffectorAngle = Mathf.PI / 2f + 0.4f,
             *  ElbowUp = true
             * });
             *
             * _targetPositions.Add(new PositionAndEndeffectorAngle {
             *  Position = new Vector3(144f, 94f, 0f),
             *  EndeffectorAngle = Mathf.PI / 2f,
             *  ElbowUp = true
             * });
             *
             * _targetPositions.Add(new PositionAndEndeffectorAngle {
             *  Position = new Vector3(144f, 94f, 0f),
             *  EndeffectorAngle = Mathf.PI / 2f - 0.4f,
             *  ElbowUp = true
             * });
             *
             * _targetPositions.Add(new PositionAndEndeffectorAngle {
             *  Position = new Vector3(144f, 94f, 0f),
             *  EndeffectorAngle = Mathf.PI / 2f + 0.4f,
             *  ElbowUp = true
             * });
             */

            // drill left
            _targetPositions.Add(new PositionAndEndeffectorAngle {
                Position         = new Vector3(124f, 74f, 0f),
                EndeffectorAngle = Mathf.PI / 2f,
                ElbowUp          = true
            });

            _targetPositions.Add(new PositionAndEndeffectorAngle {
                Position         = new Vector3(144f, 74f, 0f),
                EndeffectorAngle = Mathf.PI / 2f,
                ElbowUp          = true
            });

            _targetPositions.Add(new PositionAndEndeffectorAngle {
                Position         = new Vector3(124f, 74f, 0f),
                EndeffectorAngle = Mathf.PI / 2f,
                ElbowUp          = true
            });
        }
Beispiel #2
0
        void Start()
        {
            _robotArmIK = GetComponent <RobotArmIK>();

            _circle0 = Instantiate(_circlePrefab, _joint0.transform);
            _circle1 = Instantiate(_circlePrefab, _joint1.transform);
            _circle2 = Instantiate(_circlePrefab, _joint3.transform);
            _circle3 = Instantiate(_circlePrefab, _joint3.transform);

            _circle0.transform.localScale = Vector3.one * _robotArmIK.Link1 * 4;
            _circle1.transform.localScale = Vector3.one * _robotArmIK.Link2 * 4;
            _circle2.transform.localScale = Vector3.one * _robotArmIK.Link3 * 4;
            _circle3.transform.localScale = Vector3.one * _robotArmIK.Link4 * 4;
        }