public void Connect(string ip) { com = CDLL.Com_construct(); if (!CDLL.Com_setAddress(com, ip)) { throw new Exception("SetAddress error"); } if (!CDLL.Com_connect(com)) { throw new Exception("Cann't connect with robotino"); } omniDrive = CDLL.OmniDrive_construct(); for (int i = 0; i < 9; i++) { distanceSensor[i] = CDLL.DistanceSensor_construct((int)i); if (!CDLL.DistanceSensor_setComId(distanceSensor[i], com)) { throw new Exception("Cann't set DistanceSensor"); } } if (!CDLL.OmniDrive_setComId(omniDrive, com)) { throw new Exception("Cann't set OmniDrive"); } cameraID = CDLL.Camera_construct(); var ok = CDLL.Camera_setComId(cameraID, com); ok = CDLL.Camera_setStreaming(cameraID, true); }
public void Connect(string ip) { com = CDLL.Com_construct(); if (!CDLL.Com_setAddress(com, ip)) { throw new Exception("SetAddress error"); } if (!CDLL.Com_connect(com)) { throw new Exception("Cann't connect with robotino"); } omniDrive = CDLL.OmniDrive_construct(); if (!CDLL.OmniDrive_setComId(omniDrive, com)) { throw new Exception("Cann't set OmniDrive"); } }