Ejemplo n.º 1
0
        /// <summary>
        /// Returns the RAPID declaration code line of the this action.
        /// </summary>
        /// <param name="robot"> The Robot were the code is generated for. </param>
        /// <returns> The RAPID code line. </returns>
        public override string ToRAPIDDeclaration(Robot robot)
        {
            string code = Enum.GetName(typeof(ReferenceType), _referenceType);

            code += " jointtarget ";
            code += _name;
            code += " := [";
            code += _robotJointPosition.ToRAPID();
            code += ", ";
            code += _externalJointPosition.ToRAPID();
            code += "];";

            return(code);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns the RAPID declaration code line of the this action.
        /// </summary>
        /// <param name="robot"> The Robot were the code is generated for. </param>
        /// <returns> The RAPID code line. </returns>
        public override string ToRAPIDDeclaration(Robot robot)
        {
            string code = Enum.GetName(typeof(ReferenceType), _referenceType);

            code += " robtarget ";
            code += _name;
            code += " := [";
            code += "[" + _plane.Origin.X.ToString("0.##") + ", ";
            code += _plane.Origin.Y.ToString("0.##") + ", ";
            code += _plane.Origin.Z.ToString("0.##") + "]";
            code += ", ";
            code += "[" + _quat.A.ToString("0.######") + ", ";
            code += _quat.B.ToString("0.######") + ", ";
            code += _quat.C.ToString("0.######") + ", ";
            code += _quat.D.ToString("0.######") + "]";
            code += ", ";
            code += "[0,0,0," + _axisConfig + "]";
            code += ", ";
            code += _externalJointPosition.ToRAPID(); //TODO: Use the external axis values one from the IK of the robot?
            code += "];";

            return(code);
        }