/// <summary> /// メイン /// </summary> public override void Drive() { RLeg.DriveParts(); LLeg.DriveParts(); //RArm.DriveParts(); //LArm.DriveParts(); if (RLeg.myMotorKnee.finishFlg && RLeg.myMotorAnkle.finishFlg && RLeg.myMotorThigh.finishFlg) { RLeg.LegStatus = Utilty.PartsMoveEnum.Move_middle; RLeg.myMotorThigh.MyMotor.CustomData = "1," + TargetListMiddleward[0] + "," + "10"; RLeg.myMotorKnee.MyMotor.CustomData = "1," + TargetListMiddleward[1] + "," + "10"; RLeg.myMotorAnkle.MyMotor.CustomData = "1," + TargetListMiddleward[2] + "," + "10"; LLeg.LegStatus = Utilty.PartsMoveEnum.Move_middle; LLeg.myMotorThigh.MyMotor.CustomData = "0," + TargetListMiddleward[0] + "," + "10"; LLeg.myMotorKnee.MyMotor.CustomData = "0," + TargetListMiddleward[1] + "," + "30"; LLeg.myMotorAnkle.MyMotor.CustomData = "0," + TargetListMiddleward[2] + "," + "10"; RArm.myMotor1.MyMotor.CustomData = "0,0,10"; RArm.myMotor2.MyMotor.CustomData = "0,0,10"; LArm.myMotor1.MyMotor.CustomData = "0,0,10"; LArm.myMotor2.MyMotor.CustomData = "0,0,10"; } }
/// <summary> /// メイン /// </summary> public override void Drive() { //RLeg.setAngle(TargetListForward); RLeg.DriveParts(); //RArm.DriveParts(); //LLeg.setAngle(TargetListForward); LLeg.DriveParts(); //LArm.DriveParts();10 //if (RLeg.LegStatus == Utilty.PartsMoveEnum.Move_forward && LLeg.LegStatus == Utilty.PartsMoveEnum.Move_Backward) //{ // if (RLeg.DriveParts() && LLeg.DriveParts() && ctrlStatus == Utilty.StatusEnum.Forword) // { // RLeg.LegStatus = Utilty.PartsMoveEnum.Move_Backward; // RLeg.setAngle(TargetListBackward); // LLeg.LegStatus = Utilty.PartsMoveEnum.Move_middle; // LLeg.setAngle(TargetListMiddleward); // } //} //else if (RLeg.LegStatus == Utilty.PartsMoveEnum.Move_Backward && LLeg.LegStatus == Utilty.PartsMoveEnum.Move_forward) //{ // if (RLeg.DriveParts() && LLeg.DriveParts() && ctrlStatus == Utilty.StatusEnum.Forword) // { // RLeg.LegStatus = Utilty.PartsMoveEnum.Move_middle; // RLeg.setAngle(TargetListMiddleward); // LLeg.LegStatus = Utilty.PartsMoveEnum.Move_Backward; // LLeg.setAngle(TargetListBackward); // } //} //else if (RLeg.LegStatus == Utilty.PartsMoveEnum.Move_middle) //{ // LLeg.DriveParts(); // if (RLeg.DriveParts()) // { // RLeg.LegStatus = Utilty.PartsMoveEnum.Move_forward; // RLeg.setAngle(TargetListForward); // } //} //else if (LLeg.LegStatus == Utilty.PartsMoveEnum.Move_middle) //{ // RLeg.DriveParts(); // if (LLeg.DriveParts()) // { // LLeg.LegStatus = Utilty.PartsMoveEnum.Move_forward; // LLeg.setAngle(TargetListForward); // } //} }
/// <summary> /// メイン /// </summary> public override void Drive() { RLeg.DriveParts(); LLeg.DriveParts(); //RArm.DriveParts(); //LArm.DriveParts(); if ((DateTime.UtcNow - lasttime) > TimeSpan.FromSeconds(3)) { RLeg.LegStatus = Utilty.PartsMoveEnum.off; RLeg.myMotorThigh.MyMotor.CustomData = "1,90,10"; RLeg.myMotorKnee.MyMotor.CustomData = "1,100,10"; RLeg.myMotorAnkle.MyMotor.CustomData = "1,30,10"; LLeg.LegStatus = Utilty.PartsMoveEnum.off; LLeg.myMotorThigh.MyMotor.CustomData = "0,90,10"; LLeg.myMotorKnee.MyMotor.CustomData = "0,100,10"; LLeg.myMotorAnkle.MyMotor.CustomData = "0,30,10"; return; } if (RLeg.myMotorThigh.finishFlg && LLeg.myMotorThigh.finishFlg) { RLeg.LegStatus = Utilty.PartsMoveEnum.Move_middle; RLeg.myMotorThigh.MyMotor.CustomData = "1,5,10"; RLeg.myMotorKnee.MyMotor.CustomData = "1,10,10"; RLeg.myMotorAnkle.MyMotor.CustomData = "1,5,10"; LLeg.LegStatus = Utilty.PartsMoveEnum.Move_middle; LLeg.myMotorThigh.MyMotor.CustomData = "0,5,10"; LLeg.myMotorKnee.MyMotor.CustomData = "0,10,10"; LLeg.myMotorAnkle.MyMotor.CustomData = "0,5,10"; lasttime = DateTime.UtcNow; return; } }
public override void Drive() { RLeg.DriveParts(); RArm.DriveParts(); LLeg.DriveParts(); LArm.DriveParts(); if (ctrlStatus == Utilty.StatusEnum.Forword) { if (RLeg.LegStatus == Utilty.PartsMoveEnum.Move_forward || RLeg.LegStatus == Utilty.PartsMoveEnum.Run_forward) { if (RLeg.myMotorKnee.finishFlg && RLeg.myMotorAnkle.finishFlg && RLeg.myMotorThigh.finishFlg) { RLeg.LegStatus = Utilty.PartsMoveEnum.Run_Backward; RLeg.myMotorThigh.MyMotor.CustomData = "1," + TargetListBackward[0] + "," + "30"; RLeg.myMotorKnee.MyMotor.CustomData = "1," + TargetListBackward[1] + "," + "30"; RLeg.myMotorAnkle.MyMotor.CustomData = "1," + TargetListBackward[2] + "," + "5"; LLeg.LegStatus = Utilty.PartsMoveEnum.Move_middle; LLeg.myMotorThigh.MyMotor.CustomData = "0," + TargetListMiddleward[0] + "," + "30"; LLeg.myMotorKnee.MyMotor.CustomData = "0," + TargetListMiddleward[1] + "," + "50"; LLeg.myMotorAnkle.MyMotor.CustomData = "0," + TargetListMiddleward[2] + "," + "10"; return; } } else if (LLeg.LegStatus == Utilty.PartsMoveEnum.Move_forward || LLeg.LegStatus == Utilty.PartsMoveEnum.Run_forward) { if (LLeg.myMotorKnee.finishFlg && LLeg.myMotorAnkle.finishFlg && LLeg.myMotorThigh.finishFlg) { LLeg.LegStatus = Utilty.PartsMoveEnum.Run_Backward; LLeg.myMotorThigh.MyMotor.CustomData = "0," + TargetListBackward[0] + "," + "30"; LLeg.myMotorKnee.MyMotor.CustomData = "0," + TargetListBackward[1] + "," + "30"; LLeg.myMotorAnkle.MyMotor.CustomData = "0," + TargetListBackward[2] + "," + "5"; RLeg.LegStatus = Utilty.PartsMoveEnum.Move_middle; RLeg.myMotorThigh.MyMotor.CustomData = "1," + TargetListMiddleward[0] + "," + "30"; RLeg.myMotorKnee.MyMotor.CustomData = "1," + TargetListMiddleward[1] + "," + "50"; RLeg.myMotorAnkle.MyMotor.CustomData = "1," + TargetListMiddleward[2] + "," + "10"; return; } } if (LLeg.LegStatus == Utilty.PartsMoveEnum.Move_middle) { if (LLeg.myMotorThigh.finishFlg) { LLeg.LegStatus = Utilty.PartsMoveEnum.Run_forward; LLeg.myMotorThigh.MyMotor.CustomData = "0," + TargetListForward[0] + "," + "30"; LLeg.myMotorKnee.MyMotor.CustomData = "0," + TargetListForward[1] + "," + "50"; LLeg.myMotorAnkle.MyMotor.CustomData = "0," + TargetListForward[2] + "," + "50"; } } if (RLeg.LegStatus == Utilty.PartsMoveEnum.Move_middle) { if (RLeg.myMotorThigh.finishFlg) { RLeg.myMotorThigh.MyMotor.CustomData = "1," + TargetListForward[0] + "," + "30"; RLeg.myMotorKnee.MyMotor.CustomData = "1," + TargetListForward[1] + "," + "50"; RLeg.myMotorAnkle.MyMotor.CustomData = "1," + TargetListForward[2] + "," + "50"; RLeg.LegStatus = Utilty.PartsMoveEnum.Run_forward; } } } else if (ctrlStatus == Utilty.StatusEnum.Halt) { if (RLeg.LegStatus == Utilty.PartsMoveEnum.Run_forward) { if (RLeg.myMotorKnee.finishFlg && RLeg.myMotorAnkle.finishFlg && RLeg.myMotorThigh.finishFlg) { RLeg.LegStatus = Utilty.PartsMoveEnum.Move_Backward; RLeg.myMotorThigh.MyMotor.CustomData = "1," + TargetListBackward[0] + "," + "10"; RLeg.myMotorKnee.MyMotor.CustomData = "1," + TargetListBackward[1] + "," + "10"; RLeg.myMotorAnkle.MyMotor.CustomData = "1," + TargetListBackward[2] + "," + "5"; LLeg.LegStatus = Utilty.PartsMoveEnum.Move_middle; LLeg.myMotorThigh.MyMotor.CustomData = "0," + TargetListMiddleward[0] + "," + "10"; LLeg.myMotorKnee.MyMotor.CustomData = "0," + TargetListMiddleward[1] + "," + "30"; LLeg.myMotorAnkle.MyMotor.CustomData = "0," + TargetListMiddleward[2] + "," + "10"; return; } } else if (LLeg.LegStatus == Utilty.PartsMoveEnum.Run_forward) { if (LLeg.myMotorKnee.finishFlg && LLeg.myMotorAnkle.finishFlg && LLeg.myMotorThigh.finishFlg) { LLeg.LegStatus = Utilty.PartsMoveEnum.Move_Backward; LLeg.myMotorThigh.MyMotor.CustomData = "0," + TargetListBackward[0] + "," + "10"; LLeg.myMotorKnee.MyMotor.CustomData = "0," + TargetListBackward[1] + "," + "10"; LLeg.myMotorAnkle.MyMotor.CustomData = "0," + TargetListBackward[2] + "," + "5"; RLeg.LegStatus = Utilty.PartsMoveEnum.Move_middle; RLeg.myMotorThigh.MyMotor.CustomData = "1," + TargetListMiddleward[0] + "," + "10"; RLeg.myMotorKnee.MyMotor.CustomData = "1," + TargetListMiddleward[1] + "," + "30"; RLeg.myMotorAnkle.MyMotor.CustomData = "1," + TargetListMiddleward[2] + "," + "10"; return; } } if (LLeg.LegStatus == Utilty.PartsMoveEnum.Move_middle) { if (LLeg.myMotorThigh.finishFlg) { LLeg.LegStatus = Utilty.PartsMoveEnum.Move_forward; LLeg.myMotorThigh.MyMotor.CustomData = "0," + TargetListForward[0] + "," + "30"; LLeg.myMotorKnee.MyMotor.CustomData = "0," + TargetListForward[1] + "," + "50"; LLeg.myMotorAnkle.MyMotor.CustomData = "0," + TargetListForward[2] + "," + "50"; } } if (RLeg.LegStatus == Utilty.PartsMoveEnum.Move_middle) { if (RLeg.myMotorThigh.finishFlg) { RLeg.myMotorThigh.MyMotor.CustomData = "1," + TargetListForward[0] + "," + "30"; RLeg.myMotorKnee.MyMotor.CustomData = "1," + TargetListForward[1] + "," + "50"; RLeg.myMotorAnkle.MyMotor.CustomData = "1," + TargetListForward[2] + "," + "50"; RLeg.LegStatus = Utilty.PartsMoveEnum.Move_forward; } } } }