public void testConvertAngles() { RArm rArm = new RArm(); rArm.angles = new Angles(); rArm.angles.currAngles = new List<float> { Angles.inRadian(90), Angles.inRadian(90), Angles.inRadian(90), Angles.inRadian(90), Angles.inRadian(90) }; float ninety = Angles.inRadian(90); float[] convertedAngles = rArm.convertAngles(new float[] { ninety, ninety, ninety, ninety }); Assert.AreEqual(convertedAngles[0], 0); Assert.AreEqual(convertedAngles[1], 0); Assert.AreEqual(convertedAngles[2], 0.9849572f); Assert.AreEqual(convertedAngles[3], 0); }
private void init() { try { rp = new RobotPostureProxy(ip, 9559); rp.goToPosture("StandZero", 1); } catch (Exception) { MessageBox.Show("IP Adresse von Nao nicht erreichbar, prüfen Sie die Konfiguration!", "Fehler"); Application.Exit(); throw new Exception("Cannot connect to Proxy. Check IP-Configuration!"); } try { List <String> joints = new List <string> { "LArm", "RArm" }; //mp = new MotionProxy(ip, port); mpL = new MotionProxy(ip, port); mpR = new MotionProxy(ip, port); //mp.setStiffnesses(joints, 0.6f); //List<float> angles = mp.getAngles(new String[] { "RShoulderPitch", "RShoulderRoll", "RElbowRoll", "RElbowYaw", "RWristYaw" } ,true); } catch (Exception) { throw new Exception("Cannot connect to Proxy"); } RArm = new RArm(mpR); LArm = new LArm(mpL); }
private void init() { try { rp = new RobotPostureProxy(ip, 9559); rp.goToPosture("StandZero", 1); } catch (Exception) { MessageBox.Show("IP Adresse von Nao nicht erreichbar, prüfen Sie die Konfiguration!", "Fehler"); Application.Exit(); throw new Exception("Cannot connect to Proxy. Check IP-Configuration!"); } try { List<String> joints = new List<string> { "LArm", "RArm" }; //mp = new MotionProxy(ip, port); mpL = new MotionProxy(ip, port); mpR = new MotionProxy(ip, port); //mp.setStiffnesses(joints, 0.6f); //List<float> angles = mp.getAngles(new String[] { "RShoulderPitch", "RShoulderRoll", "RElbowRoll", "RElbowYaw", "RWristYaw" } ,true); } catch (Exception) { throw new Exception("Cannot connect to Proxy"); } RArm = new RArm(mpR); LArm = new LArm(mpL); }