public Robot(RobotPHX robotPHX, string name) { this.robotPHX = robotPHX; servoMotors[(int)ServoType.FINGER] = robotPHX.QueryDeviceServoMotor(name + "_doigt/a1/servo"); servoMotors[(int)ServoType.ARM] = robotPHX.QueryDeviceServoMotor(name + "_bras/a1/servo"); servoMotors[(int)ServoType.SHOULDER] = robotPHX.QueryDeviceServoMotor(name + "_epaule/a1/servo"); Debug.Assert(servoMotors[0] != null && servoMotors[1] != null && servoMotors[2] != null); core = robotPHX.QueryGeom("basPlatine"); Debug.Assert(core != null); gyro = robotPHX.QueryDeviceAccelGyro("basPlatine/gyro"); Debug.Assert(gyro != null); }
public int GetRobots() { Connection connection = new Connection(true); for (int i = 0; connection.Connect("localhost", 13000 + i, true); i++) { Console.WriteLine("Connection etablished to Moda Server , on port : " + (13000 + i)); RobotPHX robotPHX = connection.QueryRobotPHX("/blli"); if (robotPHX != null) { Robot robot = new Robot(robotPHX, "p0"); mutex.WaitOne(); availableRobot.Push(robot); listRobot.Add(robot); mutex.ReleaseMutex(); } else { Console.WriteLine("Error while retreiving robot, skipping"); } connection = new Connection(true); } return(listRobot.Count); }
protected AbstractRobot(RobotPHX robot) { Robot = robot; }
protected AbstractRobot() { Robot = null; }
public RobotNN(RobotPHX robot) { Robot = robot; Network = NetworkFactory.CreateDefaultNetwork(new float[] {}); Genotype = new Genome(Network.Weights); }
public RobotNN(RobotPHX robot, Genome genome) { Robot = robot; Genotype = genome; Network = NetworkFactory.CreateDefaultNetwork(Genotype.GetWeights()); }