private void Connect() { Console.WriteLine("Connect"); try { /// The constructor is similar to SimConnect_Open in the native API m_oSimConnect = new SimConnect("Simconnect - Simvar test", m_hWnd, WM_USER_SIMCONNECT, null, bFSXcompatible? (uint)1 : 0); /// Listen to connect and quit msgs m_oSimConnect.OnRecvOpen += new SimConnect.RecvOpenEventHandler(SimConnect_OnRecvOpen); m_oSimConnect.OnRecvQuit += new SimConnect.RecvQuitEventHandler(SimConnect_OnRecvQuit); /// Listen to exceptions m_oSimConnect.OnRecvException += new SimConnect.RecvExceptionEventHandler(SimConnect_OnRecvException); /// Catch a simobject data request m_oSimConnect.OnRecvSimobjectDataBytype += new SimConnect.RecvSimobjectDataBytypeEventHandler(SimConnect_OnRecvSimobjectDataBytype); } catch (COMException ex) { Console.WriteLine("Connection to KH failed: " + ex.Message); } udpsender.init(); }
// StringMsg rosMsg = new StringMsg(""); // Use this for initialization void Start() { myref = transform; ScannerLoc = myref.position; prevScannerLoc = ScannerLoc; if (!SensorRotator) { SensorRotator = myref.Find("Laser Sensor").transform; } if (!emitter) { SensorRotator = myref.Find("Emitter").transform; } attachedRB = GetComponentInParent <Rigidbody>(); if (UDP && !ROS) { // sendObj =gameObject.AddComponent< UDPSend>(); sendObj = new UDPSend(); sendObj.init(); } PointsTemp = new List <Vector3>(); Points = new List <Vector3>(); // writer = new StreamWriter(Application.dataPath+"/Data.csv"); NoOfScansPerFrame = (int)((HorScanAngRange / HorRes) * hz * Time.fixedDeltaTime); currentangle = -HorScanAngRange / 2; if (ROS) { wsc = FindObjectOfType <WebsocketClient>(); wsc.Advertise("velodyne", "std_msgs/String"); // SimulationManager.instance.ros.AddPublisher(typeof(VelodyneStringPublisher)); } // writer.WriteLine("This is a data file"); // datacolumn=new float[lasercount]; }
// StringMsg rosMsg = new StringMsg(""); // Use this for initialization void Start() { sendObj = new UDPSend(); sendObj.IP = IP; sendObj.port = 2368; sendObj.init(); ranges = new byte[1206]; for (int i = 0; i < ranges.Length; i++) { ranges[i] = 0; } myref = transform; ScannerLoc = myref.position; prevScannerLoc = ScannerLoc; if (!SensorRotator) { SensorRotator = myref.Find("Laser Sensor").transform; } if (!emitter) { SensorRotator = myref.Find("Emitter").transform; } NoOfScansPerFrame = (int)((HorScanAngRange / HorRes) * hz * Time.fixedDeltaTime); currentangle = 0; }
// call it from shell (as program) private static void Main() { UDPSend sendObj = new UDPSend(); sendObj.init(); // as server sending endless sendObj.sendEndless(" endless infos \n"); }
// call it from shell (as program) private static void Main() { UDPSend sendObj = new UDPSend(); sendObj.init(); // testing via console // sendObj.inputFromConsole(); }
private static void Main() { UDPSend sendObj=new UDPSend(); sendObj.init(); sendObj.sendEndless(" endless infos \n"); }
void Update() { if (phoneIP) { string[] splitString = phoneIpAddress.Split(new string[] { " " }, StringSplitOptions.None); udpSendRef.init(splitString[1]); Debug.Log("Assigned IP"); phoneIP = false; } }
// call it from shell (as program) private static void Main() { UDPSend sendObj = new UDPSend(); sendObj.init(); // testing via console // sendObj.inputFromConsole(); // as server sending endless sendObj.sendEndless(" endless infos \n"); }
private static void Main() { UDPSend sendObj = new UDPSend(); sendObj.init(); }
public void sendIp(){ UDPSend sendObj = new UDPSend(); sendObj.init(); sendObj.sendString("MyIP" + " " + Network.player.ipAddress); GameObject.Destroy(sendObj); }