public ObjectLibrary(MainController parent, Rpc.Client client) { this.objects = new SerializableDictionary<string, RecogObject>(); this.lookupByProperty = new SerializableDictionary<string, List<RecogObject>>(); this.knownPointClouds = new Dictionary<string, PointCloud>(); this.unknownPointClouds = new Dictionary<string, PointCloud>(); this.client = client; }
public MainController(MainWindow window) { this.window = window; this.nao = new NaoController(NAO_IP, this); this.thriftTransport = new TSocket(SERVER_IP, 9090); thriftTransport.Open(); TProtocol protocol = new TBinaryProtocol(thriftTransport); this.thriftClient = new Rpc.Client(protocol); this.lib = new ObjectLibrary(this, this.thriftClient, MainController.OBJECT_LIB_PATH); this.updateThread = new Thread(this.lib.updatePointClouds); this.updateThread.Start(); this.nav = new NavigationController(this, nao, lib); this.navThread = null; switchStates(State.waiting); }
public static void Start() { try { TTransport transport = new TSocket("128.208.4.237", 9090); TProtocol protocol = new TBinaryProtocol(transport); Rpc.Client client = new Rpc.Client(protocol); transport.Open(); client.ping(); Console.WriteLine("ping"); Console.WriteLine(client.getObjects()); Console.WriteLine("getObjects"); transport.Close(); } catch (TApplicationException x) { Console.WriteLine(x.StackTrace); } }
public ObjectLibrary(MainController parent, Rpc.Client client, string path) { this.objects = new SerializableDictionary<string, RecogObject>(); this.lookupByProperty = new Dictionary<string, List<RecogObject>>(); this.knownPointClouds = new Dictionary<string, PointCloud>(); this.unknownPointClouds = new Dictionary<string, PointCloud>(); this.shut_down = false; this.block = false; this.parent = parent; this.client = client; if (System.IO.File.Exists(path)) { string[] lines = System.IO.File.ReadAllLines(path); foreach (string line in lines) { RecogObject obj = RecogObject.fromString(line); this.addObject(obj); } } }