コード例 #1
0
        public Target Lerp(ProgramTarget prevTarget, RobotSystem robot, double t, double start, double end)
        {
            double[] allJoints = JointTarget.Lerp(prevTarget.Kinematics.Joints, Kinematics.Joints, t, start, end);
            var      external  = allJoints.RangeSubset(6, Target.External.Length);

            if (IsJointMotion)
            {
                var joints = allJoints.RangeSubset(0, 6);
                return(new JointTarget(joints, Target, external));
            }
            else
            {
                Plane prevPlane = GetPrevPlane(prevTarget);
                Plane plane     = robot.CartesianLerp(prevPlane, Plane, t, start, end);
                //   Plane plane = CartesianTarget.Lerp(prevTarget.WorldPlane, this.WorldPlane, t, start, end);
                //  Target.RobotConfigurations? configuration = (Abs(prevTarget.cellTarget.TotalTime - t) < TimeTol) ? prevTarget.Kinematics.Configuration : this.Kinematics.Configuration;

                var target = new CartesianTarget(plane, Target, prevTarget.Kinematics.Configuration, Motions.Linear, external);
                // target.Frame = Frame.Default;
                return(target);
            }
        }
コード例 #2
0
ファイル: Target.cs プロジェクト: visose/Robots
        public Target Lerp(ProgramTarget prevTarget, RobotSystem robot, double t, double start, double end)
        {
            double[] allJoints = JointTarget.Lerp(prevTarget.Kinematics.Joints, Kinematics.Joints, t, start, end);
            var external = allJoints.RangeSubset(6, Target.External.Length);

            if (IsJointMotion)
            {
                var joints = allJoints.RangeSubset(0, 6);
                return new JointTarget(joints, Target, external);
            }
            else
            {
                Plane prevPlane = GetPrevPlane(prevTarget);
                Plane plane = robot.CartesianLerp(prevPlane, Plane, t, start, end);
                //   Plane plane = CartesianTarget.Lerp(prevTarget.WorldPlane, this.WorldPlane, t, start, end);
                //  Target.RobotConfigurations? configuration = (Abs(prevTarget.cellTarget.TotalTime - t) < TimeTol) ? prevTarget.Kinematics.Configuration : this.Kinematics.Configuration;

                 var target = new CartesianTarget(plane, Target, prevTarget.Kinematics.Configuration, Target.Motions.Linear, external);
                // target.Frame = Frame.Default;
                return target;
            }
        }