Ejemplo n.º 1
0
        public void Create_Hinge(string type, AgX_Frame left, AgX_Frame right, double lowerLimit, double upperLimit)
        {
            this.type = type;

            //Hinge is locked between the two objects.
            hinge_Frame.setCenter((left.GetAgxObject().getPosition() + right.GetAgxObject().getPosition()).Divide(2));
            if (left.GetRotation().x == 0)                  //pitch or yaw module
            {
                hinge_Frame.setAxis(new agx.Vec3(1, 0, 0)); //axis along the x direction
            }
            else
            {
                hinge_Frame.setAxis(new agx.Vec3(0, 1, 0)); //axis along the x direction
            }
            joint = new agx.Hinge(hinge_Frame, left.GetAgxObject(), right.GetAgxObject());

            joint.asHinge().getMotor1D().setEnable(true);
            joint.asHinge().getRange1D().setEnable(true);

            joint.asHinge().getRange1D().setRange(lowerLimit, upperLimit);
        }
Ejemplo n.º 2
0
        public void Create_Hinge(string type, AgX_Frame left, AgX_Frame right, double leftLimit, double rightLimit)
        {
            this.type = type;

            //Hinge is locked between the two objects.
            hinge_Frame.setCenter((left.GetAgxObject().getPosition() + right.GetAgxObject().getPosition()).Divide(2));
            if (left.Get_Rotation().x == 0)
            {
                hinge_Frame.setAxis(new agx.Vec3(1, 0, 0)); //axis along the x direction
                //UnityEngine.Debug.Log("z in agxint: " + left.Get_Rotation().x);
            }
            else
            {
                hinge_Frame.setAxis(new agx.Vec3(0, 1, 0)); //axis along the x direction
            }
            Joint = new agx.Hinge(hinge_Frame, left.GetAgxObject(), right.GetAgxObject());
            //Joint.asHinge().getLock1D().setEnable(true);
            Joint.asHinge().getMotor1D().setEnable(true);
            Joint.asHinge().getRange1D().setEnable(true);
            //Might want to have this as a modifyable parameter:
            Joint.asHinge().getRange1D().setRange(leftLimit, rightLimit /*-Math.PI / 2, Math.PI / 2*/);

            //Joint.asHinge().getMotor1D().setSpeed(0.2f);
        }
Ejemplo n.º 3
0
 public void Create_Lock(string type, AgX_Primitive s_mod, AgX_Frame left)
 {
     //THIS IS NOT THE MIDDLE OF THE LOCK FRAME (frames are longer than sensors)
     joint = new agx.LockJoint(s_mod.GetAgxObject(), left.GetAgxObject(), (left.GetAgxObject().getPosition() + s_mod.GetAgxObject().getPosition()).Divide(2));
 }
Ejemplo n.º 4
0
 //Sensory module locks:
 public void Create_Lock(string type, AgX_Frame right, AgX_Primitive s_mod)
 {
     //Creates a joint with a specified middle position for the lockframe.
     //THIS IS NOT THE MIDDLE OF THE LOCK FRAME (frames are longer than sensors)
     joint = new agx.LockJoint(right.GetAgxObject(), s_mod.GetAgxObject(), (right.GetAgxObject().getPosition() + s_mod.GetAgxObject().getPosition()).Divide(2));
 }
Ejemplo n.º 5
0
 public void Create_Lock(string type, AgX_Frame left, AgX_Frame right)
 {
     //connects right frame of left robot (LEFT) to left frame of right robot (RIGHT)
     joint = new agx.LockJoint(left.GetAgxObject(), right.GetAgxObject(), (left.GetAgxObject().getPosition() + right.GetAgxObject().getPosition()).Divide(2));
 }