Asked — Edited

Vr Options?

Does anyone know if the SDK of the Oculus Rift package would work with EZB if there was a plug in developed for it? It doesn't really need to be something as big and bulky as that. Very unfortunate that Vuzix is no longer offering support with EZB. That would work great.

Like the Vuzix, I'd like to pull from the IMU data to move servos and transfer the camera feed from the EZ camera to the goggles over two complete separate computers in different places.

Any ideas or suggestions on how to POC this, would be grateful.


ARC Pro

Upgrade to ARC Pro

Join the ARC Pro community and gain access to a wealth of resources and support, ensuring your robot's success.

#185  

Quote:

Are rotation values absolute, or related to the Parent's joint ?
They are related to their parents values!

PRO
USA
#186  

@Mickey666Maus, So 0 degrees => servo 90 degrees

Next question: X,Y,Z - where they point ? (when you increase the value): (CW/CCW, UP/Down, Left/Right)

#187  

Quote:

  1. Joint name

  2. Axis value X,Y,Z

  3. Inverted calculation or a Formula

  • Is always just the number of the servo that will be adressed!

  • Is either joint.Y.GetTargetValue(), joint.X.GetTargetValue(), or joint.Z.GetTargetValue(), during the setup in BioIK the axis to be extracted is specified and then later on the corresponding script is attached!

  • is actually just 180 - TargetValue:)

  • #188  

    Quote:

    X,Y,Z - where they point ? (when you increase the value): (CW/CCW, UP/Down, Left/Right)
    This is handled by the BioIK plugin, no need to think about up Vectors, Gimbal Lock, or any of this type of stuff...I spend countless hours to solve those problems, and I am so happy that finally there is a solution for this at hand! At setup we can restrict the axis and the rotational freedom in angles for each joint, BioIK uses an Algorithm to calculate the underlying math!

    PRO
    USA
    #189  

    The previous script has a bug!

    Try this one. Look to debug window!

    
    namespace BioIK
    {
        using System;
        using EZ_B;
        using UnityEngine;
    
        public class RotNew : MonoBehaviour
        {
            private int[] lastRotation = new [] { int.MinValue, int.MinValue, int.MinValue };
    
            private void Start()
            {
                EZBController.Instance.Connect("192.168.1.1");
            }
    
            private void OnApplicationQuit()
            {
                EZBController.Instance.Disconnect();
            }
    
            private void Update()
            {
                BioJoint joint = this.GetComponent<BioJoint>();
                var rotation = new int[]
                {
                    Mathf.RoundToInt((float)joint.X.GetTargetValue()),
                    Mathf.RoundToInt((float)joint.Y.GetTargetValue()),
                    Mathf.RoundToInt((float)joint.Z.GetTargetValue()),
                };
    
                if (rotation[0] == this.lastRotation[0] && rotation[1] == this.lastRotation[1] && rotation[2] == this.lastRotation[2])
                {
                    //nothing changed
                    return;
                }
    
                if (rotation[0] != this.lastRotation[0])
                {
                    Debug.Log(string.Format("Joint:[{0}] X changed New=[{1}] Prev=[{2}]", this.name, rotation[0], this.lastRotation[0]));
                }
                if (rotation[1] != this.lastRotation[1])
                {
                    Debug.Log(string.Format("Joint:[{0}] Y changed New=[{1}] Prev=[{2}]", this.name, rotation[1], this.lastRotation[1]));
                }
                if (rotation[2] != this.lastRotation[2])
                {
                    Debug.Log(string.Format("Joint:[{0}] Z changed New=[{1}] Prev=[{2}]", this.name, rotation[2], this.lastRotation[2]));
                }
    
                this.lastRotation = rotation;
    
                EZBController.Instance.SetServo(this.name, rotation[1] + 90);
            }
    
            private class EZBController
            {
                private EZB ezb;
                private object lockObject = new object();
    
                private EZBController()
                {
                    this.ezb = new EZB("MyEzb" );
                    this.ezb.OnConnectionChange += this.EzbOnConnectionChange;
                }
    
                public static EZBController Instance
                {
                    get { return Creator.Singleton; }
                }
    
                public void Connect(string hostname)
                {
                    lock (this.lockObject)
                    {
                        if (!this.ezb.IsConnected)
                        {
                            Debug.Log("Connecting to EZB hostname:" + hostname);
                            this.ezb.Connect(hostname);
                        }
                    }
                }
    
                public void Disconnect()
                {
                    lock (this.lockObject)
                    {
                        if (this.ezb.IsConnected)
                        {
                            this.ezb.Disconnect();
                        }
                    }
                }
    
                public void SetServo(string port, int position)
                {
                    if (!this.ezb.IsConnected)
                    {
                        Debug.LogWarning("EZB is not connected, SetServo will be ignored" );
                        return;
                    }
    
                    try
                    {
                        var servoPort = (Servo.ServoPortEnum)Enum.Parse(typeof(Servo.ServoPortEnum), "D" + port);
                        this.ezb.Servo.SetServoPosition(servoPort, position);
                    }
                    catch (Exception ex)
                    {
                        Debug.LogError(ex);
                    }
                }
                private void EzbOnConnectionChange(bool isConnected)
                {
                    Debug.Log("EZB connection changed to: " + (isConnected ? "Connected" : "Disconnect" ));
                }
    
                private sealed class Creator
                {
                    private static readonly EZBController instance = new EZBController();
    
                    internal static EZBController Singleton
                    {
                        get { return instance; }
                    }
                }
            }
        }
    }
    
    #190  

    I have it all working, I wanted to make a clip today to show how good it works with live control of a robot with 8 DOF, no lag...full IK!

    But now we get going with ARC integration, I want to participate of course! Especially now we are having you here to get things going!:D

    PRO
    USA
    #191  

    Yes we are are extracting math that has already been calculated via the Bio IK plug in. It converts the angles to somewhere between 0 -90, 90 those are the only values produced for X,Y and Z rotate or translated. We just need to get those values to the servos in a form of 1-180 degrees.