Ejemplo n.º 1
0
        protected override void Start()
        {
            base.Start();

            this.angleMin = -AngleInc * this.laserNum / 2;
            this.angleMax = +AngleInc * this.laserNum / 2 - AngleInc;


            if (!RosConnectionManager.Instance.rosConnections.sigverseRosBridgeTcpClientMap.ContainsKey(topicName))
            {
                this.tcpClient = SIGVerseRosBridgeConnection.GetConnection(this.rosBridgeIP, this.sigverseBridgePort);

                RosConnectionManager.Instance.rosConnections.sigverseRosBridgeTcpClientMap.Add(topicName, this.tcpClient);
            }
            else
            {
                this.tcpClient = RosConnectionManager.Instance.rosConnections.sigverseRosBridgeTcpClientMap[topicName];
            }

            this.networkStream = this.tcpClient.GetStream();

            this.networkStream.ReadTimeout  = 100000;
            this.networkStream.WriteTimeout = 100000;

            this.header = new Header(0, new SIGVerse.RosBridge.msg_helpers.Time(0, 0), this.sensorLink.name);

            this.laserScan = new LaserScanForSIGVerseBridge();

            this.laserScan.header = this.header;

            this.laserScan.angle_min       = this.angleMin;
            this.laserScan.angle_max       = this.angleMax;
            this.laserScan.angle_increment = AngleInc;
            this.laserScan.time_increment  = 0.0;
            this.laserScan.scan_time       = this.sendingInterval / 1000.0f;
            this.laserScan.range_min       = RangeMin;
            this.laserScan.range_max       = RangeMax;
            this.laserScan.ranges          = new double[this.laserNum];
            this.laserScan.intensities     = new double[this.laserNum];

            this.laserScanMsg = new SIGVerseRosBridgeMessage <LaserScanForSIGVerseBridge>("publish", this.topicName, LaserScanForSIGVerseBridge.GetMessageType(), this.laserScan);

//			Debug.Log("AngleMin="+this.angleMin+", AngleMax="+this.angleMax+", AngleInc="+AngleInc);
        }
Ejemplo n.º 2
0
        protected override void Start()
        {
            base.Start();

            if (!RosConnectionManager.Instance.rosConnections.sigverseRosBridgeTcpClientMap.ContainsKey(topicName))
            {
                this.tcpClient = SIGVerseRosBridgeConnection.GetConnection(this.rosBridgeIP, this.sigverseBridgePort);

                RosConnectionManager.Instance.rosConnections.sigverseRosBridgeTcpClientMap.Add(topicName, this.tcpClient);
            }
            else
            {
                this.tcpClient = RosConnectionManager.Instance.rosConnections.sigverseRosBridgeTcpClientMap[topicName];
            }

            this.networkStream = this.tcpClient.GetStream();

            this.networkStream.ReadTimeout  = 100000;
            this.networkStream.WriteTimeout = 100000;

            this.header = new Header(0, new SIGVerse.RosBridge.msg_helpers.Time(0, 0), this.sensorLink.name);

            this.laserScan = new LaserScanForSIGVerseBridge();

            this.numLines = (int)Mathf.Round(LaserAngle / LaserAngularResolution) + 1;

            this.laserScan.header = this.header;

            this.laserScan.angle_min       = -HalfOfLaserAngle * Mathf.Deg2Rad;
            this.laserScan.angle_max       = +HalfOfLaserAngle * Mathf.Deg2Rad;
            this.laserScan.angle_increment = LaserAngularResolution * Mathf.Deg2Rad;
            this.laserScan.time_increment  = 0.0;
            this.laserScan.scan_time       = 0.1;       // tentative
            this.laserScan.range_min       = 0.05;
            this.laserScan.range_max       = 20.0;
            this.laserScan.ranges          = new double[this.numLines];
            this.laserScan.intensities     = new double[this.numLines];

            this.laserScanMsg = new SIGVerseRosBridgeMessage <LaserScanForSIGVerseBridge>("publish", this.topicName, LaserScanForSIGVerseBridge.GetMessageType(), this.laserScan);

//			Debug.Log("this.layerMask.value = "+this.layerMask.value);
        }
        void Start()
        {
            if (this.rosBridgeIP.Equals(string.Empty))
            {
                this.rosBridgeIP = ConfigManager.Instance.configInfo.rosbridgeIP;
            }
            if (this.sigverseBridgePort == 0)
            {
                this.sigverseBridgePort = ConfigManager.Instance.configInfo.sigverseBridgePort;
            }

            this.tcpClient = HSRCommon.GetSIGVerseRosbridgeConnection(this.rosBridgeIP, this.sigverseBridgePort);

            this.networkStream = this.tcpClient.GetStream();

            this.networkStream.ReadTimeout  = 100000;
            this.networkStream.WriteTimeout = 100000;

            this.header = new Header(0, new SIGVerse.ROSBridge.msg_helpers.Time(0, 0), this.sensorLink.name);

            this.laserScan = new LaserScanForSIGVerseBridge();

            this.numLines = (int)Mathf.Round(LaserAngle / LaserAngularResolution) + 1;

            this.laserScan.header = this.header;

            this.laserScan.angle_min       = -HalfOfLaserAngle * Mathf.Deg2Rad;
            this.laserScan.angle_max       = +HalfOfLaserAngle * Mathf.Deg2Rad;
            this.laserScan.angle_increment = LaserAngularResolution * Mathf.Deg2Rad;
            this.laserScan.time_increment  = 0.0;
            this.laserScan.scan_time       = 0.1;       // tentative
            this.laserScan.range_min       = 0.05;
            this.laserScan.range_max       = 20.0;
            this.laserScan.ranges          = new double[this.numLines];
            this.laserScan.intensities     = new double[this.numLines];

            this.laserScanMsg = new SIGVerseROSBridgeMessage <LaserScanForSIGVerseBridge>("publish", this.topicName, LaserScanForSIGVerseBridge.GetMessageType(), this.laserScan);

//			Debug.Log("this.layerMask.value = "+this.layerMask.value);
        }
        protected override void Start()
        {
            base.Start();

            if (!RosConnectionManager.Instance.rosConnections.sigverseRosBridgeTcpClientMap.ContainsKey(topicName))
            {
                this.tcpClient = SIGVerseRosBridgeConnection.GetConnection(this.rosBridgeIP, this.sigverseBridgePort);

                RosConnectionManager.Instance.rosConnections.sigverseRosBridgeTcpClientMap.Add(topicName, this.tcpClient);
            }
            else
            {
                this.tcpClient = RosConnectionManager.Instance.rosConnections.sigverseRosBridgeTcpClientMap[topicName];
            }

            this.networkStream = this.tcpClient.GetStream();

            this.networkStream.ReadTimeout  = 100000;
            this.networkStream.WriteTimeout = 100000;

            this.header = new Header(0, new SIGVerse.RosBridge.msg_helpers.Time(0, 0), this.sensorLink.name);

            this.laserScan = new LaserScanForSIGVerseBridge();

            this.laserScan.header = this.header;

            this.laserScan.angle_min       = AngleMin * Mathf.Deg2Rad;
            this.laserScan.angle_max       = AngleMax * Mathf.Deg2Rad;
            this.laserScan.angle_increment = AngleIncrement * Mathf.Deg2Rad;
            this.laserScan.time_increment  = 0.0;             // (1.0f / (ScanRate / 60.0f)) / NumLines;
            this.laserScan.scan_time       = 0.0;             //  1.0f / (ScanRate / 60.0f);
            this.laserScan.range_min       = RangeMin;
            this.laserScan.range_max       = RangeMax;
            this.laserScan.ranges          = new double[NumLines];
            this.laserScan.intensities     = new double[NumLines];

            this.laserScanMsg = new SIGVerseRosBridgeMessage <LaserScanForSIGVerseBridge>("publish", this.topicName, LaserScanForSIGVerseBridge.GetMessageType(), this.laserScan);
        }
        protected override void Start()
        {
            base.Start();

            if (!RosConnectionManager.Instance.rosConnections.sigverseRosBridgeTcpClientMap.ContainsKey(topicName))
            {
                this.tcpClient = SIGVerseRosBridgeConnection.GetConnection(this.rosBridgeIP, this.sigverseBridgePort);

                RosConnectionManager.Instance.rosConnections.sigverseRosBridgeTcpClientMap.Add(topicName, this.tcpClient);
            }
            else
            {
                this.tcpClient = RosConnectionManager.Instance.rosConnections.sigverseRosBridgeTcpClientMap[topicName];
            }

            this.networkStream = this.tcpClient.GetStream();

            this.networkStream.ReadTimeout  = 100000;
            this.networkStream.WriteTimeout = 100000;

            this.laserScanMsg = new SIGVerseRosBridgeMessage <LaserScanForSIGVerseBridge>("publish", this.topicName, LaserScanForSIGVerseBridge.GetMessageType(), this.laserScan);

//			Debug.Log("this.layerMask.value = "+this.layerMask.value);
        }