コード例 #1
0
        protected override List<PoseProfile> CoreParameterToPose(bool right = true)
        {
            double width  = Parameters["Width"].Value;
            double height = Parameters["Height"].Value;
            double palmdir = Parameters["PalmDirection"].Value;
            double finger = Parameters["Finger"].Value;
            double headud = Parameters["HeadUpDown"].Value;
            double headlr = Parameters["HeadLeftRight"].Value;

            double lsrA = 5 * width + 25;
            double rsrA = 8 * width + 10;
            double lerA = -30;
            double rerA = 30;
            double lspA = -20 * height + 40;
            double rspA = -15 * height + 40;
            double leyA = -105*palmdir + 15;
            double reyA = 60 * palmdir - 15;
            double lwyA = -90 * palmdir;
            double rwyA = 104 * palmdir;

            double lsrB = -8 * width - 10;
            double rsrB = -10 * width - 10;
            double lerB = -15 * width - 30;
            double rerB = 30;
            double lspB = -20 * height + 40;
            double rspB = -20 * height + 40;
            double leyB = -45 * palmdir + 15;
            double reyB = 90*palmdir;
            double lwyB = -104 * palmdir;
            double rwyB = 90 * palmdir;

            // finger 0~1
            double hand = 0.4 * finger + 0.6;
            // degree
            double headPitch = base.NormalizeHeadPitch(headud);
            // degree
            double headYaw = 30.0 * headlr;

            LArm larmA = new LArm(false, lspA, lsrA, leyA, lerA, lwyA, hand);
            RArm rarmA = new RArm(false, rspA, rsrA, reyA, rerA, rwyA, hand);
            LArm larmB = new LArm(false, lspB, lsrB, leyB, lerB, lwyB, hand);
            RArm rarmB = new RArm(false, rspB, rsrB, reyB, rerB, rwyB, hand);
            Head head = new Head(false, headPitch, headYaw);

            // Joints
            PoseProfile pose_A_arm_l = new PoseProfile("FromA", larmA);
            PoseProfile pose_A_arm_r = new PoseProfile("FromA", rarmA);
            PoseProfile pose_A_head = new PoseProfile("FromA", head);
            PoseProfile pose_B_arm_l = new PoseProfile("ToB", larmB);
            PoseProfile pose_B_arm_r = new PoseProfile("ToB", rarmB);

            List<PoseProfile> lpp = new List<PoseProfile>();
            lpp.Add(pose_A_arm_l);
            lpp.Add(pose_A_arm_r);
            lpp.Add(pose_A_head);
            lpp.Add(pose_B_arm_l);
            lpp.Add(pose_B_arm_r);

            return lpp;
        }
コード例 #2
0
        protected override List<PoseProfile> CoreParameterToPose(bool right = true)
        {
            double amp = Parameters["Amplitude"].Value;
            double height = Parameters["Height"].Value;
            double finger = Parameters["Finger"].Value;
            double headud = Parameters["HeadUpDown"].Value;

            double lsr = 3*height-18;
            double rsr = 15*height;
            double lsp = 10*height+50;
            double rsp = 30*height+30;
            double ley = 5*height-5;
            double rey = 25*height+15;
            double ler = 15*height-50;
            double rer = -20*height+80;
            double lwy = -90;
            double rwy = -45;

            // finger 0~1
            double hand = 0.6 * finger;
            // degree
            double headPitch = base.NormalizeHeadPitch(headud);
            // -30 ~ 30 degree
            double headYaw_L = 10.0 * amp + 20;
            double headYaw_R = -10.0 * amp - 20;

            LArm larm = new LArm(false, lsp, lsr, ley, ler, lwy, hand);
            RArm rarm = new RArm(false, rsp, rsr, rey, rer, rwy, hand);
            Head lhead = new Head(false, headPitch, headYaw_L);
            Head rhead = new Head(false, headPitch, headYaw_R);

            // Joints       
            PoseProfile pose_close_arm_l = new PoseProfile("ArmClose", larm);
            PoseProfile pose_close_arm_r = new PoseProfile("ArmClose", rarm);
            PoseProfile pose_look_left;
            PoseProfile pose_look_right;

            if (headud >= 0) // positive
            {
	            pose_look_left = new PoseProfile("LookLeft", lhead, true, 0, 0.05);
	            pose_look_right = new PoseProfile("LookRight", rhead, true, 0, 0.05);
            } 
            else // negative
            {
                pose_look_left = new PoseProfile("LookLeft", lhead, true);
                pose_look_right = new PoseProfile("LookRight", rhead, true);
            }

            List<PoseProfile> lpp = new List<PoseProfile>();
            lpp.Add(pose_close_arm_l);
            lpp.Add(pose_close_arm_r);
            lpp.Add(pose_look_left);
            lpp.Add(pose_look_right);

            return lpp;
        }
コード例 #3
0
        protected override List<PoseProfile> CoreParameterToPose(bool right = true)
        {
            double fpwidth  = Parameters["FrontPoseWidth"].Value;
            double fpheight = Parameters["FrontPoseHeight"].Value;
            double cpheight = Parameters["ChestPoseHeight"].Value;
            double finger   = Parameters["Finger"].Value;
            double headud   = Parameters["HeadUpDown"].Value;
            double headlr   = Parameters["HeadLeftRight"].Value;

            double fp_shldroll = -30*fpwidth;
            double fp_shldptch = -30*fpheight+60;
            double fp_elbyaw   = 89.5*fpwidth+30;
            double fp_elbroll  = 30*fpheight+30;
            double fp_wrstyaw  = 30;

            double cp_shldroll = 5;
            double cp_shldptch = -30*cpheight+60;
            double cp_elbyaw   = -20*cpheight+30;
            double cp_elbroll  = 88.5;
            double cp_wrstyaw  = 30;

            // finger 0~1
            double hand = 0.4 * finger + 0.6;
            // degree
            double headPitch = base.NormalizeHeadPitch(headud);
            // - ~  degree
            double headYaw;
            if (headlr > 0.5) headYaw = -40 * headlr + 20;
            else headYaw = 0;

            RArm rarm_front = new RArm(false, fp_shldptch, fp_shldroll, fp_elbyaw, fp_elbroll, fp_wrstyaw, hand);
            Head head       = new Head(false, headPitch, headYaw);
            RArm rarm_chest = new RArm(false, cp_shldptch, cp_shldroll, cp_elbyaw, cp_elbroll, cp_wrstyaw, hand);

            LArm larm = new LArm(false, 84.6, 15, -68, -40, 5.7, 0.3);

            // Joints
            PoseProfile pose_front_arm_r = new PoseProfile("FrontPose", rarm_front, true);
            PoseProfile pose_front_head  = new PoseProfile("FrontPose", head);
            PoseProfile pose_front_arm_l = new PoseProfile("FrontPose", larm);
            PoseProfile pose_chest_arm_r = new PoseProfile("ChestPose", rarm_chest, true);

            List<PoseProfile> lppbow = BendTorsoSmall("FrontPose");

            List<PoseProfile> lpp = new List<PoseProfile>();
            lpp.Add(pose_front_arm_r);
            lpp.Add(pose_front_head);
            lpp.Add(pose_front_arm_l);
            lpp.Add(pose_chest_arm_r);
            lpp.AddRange(lppbow);

            return lpp;
        }
コード例 #4
0
        protected override List<PoseProfile> CoreParameterToPose(bool right = true)
        {
            double width  = Parameters["Width"].Value;
            double height = Parameters["Height"].Value;
            double finger = Parameters["Finger"].Value;
            double headud = Parameters["HeadUpDown"].Value;
            double headlr = Parameters["HeadLeftRight"].Value;

            double lsr = 30 * width;
            double rsr = -30 * width;
            double lsp = 10 * height + 60;
            double rsp = -55 * height + 20;
            double ley = -10 * height - 50;
            double rey = 20 * height + 60;
            double ler = -45;
            double rer = -15 * height + 75;
            double lwy = 10 * height - 100;
            double rwy = 30 * height - 30;

            // finger 0~1
            double hand = 0.4 * finger + 0.6;

            // degree
            double headPitch = base.NormalizeHeadPitch(headud);
            // degree
            double headYaw = double.NaN;

            LArm larm = new LArm(false, lsp, lsr, ley, ler, lwy, hand);
            RArm rarm = new RArm(false, rsp, rsr, rey, rer, rwy, hand);
            Head head = new Head(false, headPitch, headYaw);
            LArm larm_close = new LArm(false, 60, -15, -20, -55, -104.5, hand);
            RArm rarm_close = new RArm(false, 35, 15, 20, 75, -40, hand);

            // Joints
            PoseProfile pose_open_arm_l = new PoseProfile("ArmOpen", larm, true, 0.3, 0);
            PoseProfile pose_open_arm_r = new PoseProfile("ArmOpen", rarm, true, 0.3, 0);
            PoseProfile pose_open_head = new PoseProfile("ArmOpen", head);
            PoseProfile pose_close_arm_l = new PoseProfile("ArmClose", larm_close, true, 1, 0);
            PoseProfile pose_close_arm_r = new PoseProfile("ArmClose", rarm_close, true, 1, 0);

            List<PoseProfile> lpp = new List<PoseProfile>();
            lpp.Add(pose_open_arm_l);
            lpp.Add(pose_open_arm_r);
            lpp.Add(pose_open_head);
            lpp.Add(pose_close_arm_l);
            lpp.Add(pose_close_arm_r);

            return lpp;
        }
コード例 #5
0
 public override JointChain DeepCopy()
 {
     JointChain jc = new LArm(true, this.ShoulderPitch, this.ShoulderRoll, this.ElbowYaw, this.ElbowRoll, this.WristYaw, this.Hand);
     return jc;
 }
コード例 #6
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override JointChain MirrorLeftRight() 
        {
            Arm m_arm = null;           
            if (this.Name == "RArm")
            {
                m_arm = new LArm(                    
                    true, 
                    this.ShoulderPitch,
                    -this.ShoulderRoll,
                    -this.ElbowYaw,
                    -this.ElbowRoll,
                    -this.WristYaw,
                    this.Hand
                    );
            } 
            else if (this.Name == "LArm")
            {
                m_arm = new RArm(
                    true, 
                    this.ShoulderPitch,
                    -this.ShoulderRoll,
                    -this.ElbowYaw,
                    -this.ElbowRoll,
                    -this.WristYaw,
                    this.Hand
                    );
            }
            else
            {
                Debug.WriteLine("JointChainMirror: wrong arm joint chain name");
            }

            return m_arm; 
        }
コード例 #7
0
        protected List<PoseProfile> ArmChest(string mfname)
        {
            RArm armR = new RArm(
                false,
                60,
                5,
                50,
                88.5,
                15,
                0);
            LArm armL = new LArm(
                false,
                70,
                -5,
                -40,
                -88.5,
                -15,
                 0);
            PoseProfile armppR = new PoseProfile(mfname, armR);
            PoseProfile armppL = new PoseProfile(mfname, armL);
            List<PoseProfile> lpp = new List<PoseProfile>();
            lpp.Add(armppR);
            lpp.Add(armppL);

            return lpp;
        }